/* sidebars.css - 边栏组件样式 */

/* 通用边栏样式 */
.sidebar {
  background: var(--surface-1);
  border-radius: var(--border-radius-xl);
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--box-shadow-md);
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: var(--z-index-sidebar);
}

/* 边栏折叠按钮 */
.sidebar-toggle {
  position: absolute;
  width: 24px;
  height: 24px;
  border-radius: var(--border-radius-circle);
  background: var(--primary);
  color: var(--text-light);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 20;
  box-shadow: var(--box-shadow-md);
  transition: transform var(--transition-normal);
}

.left-sidebar .sidebar-toggle {
  right: -12px;
  top: 20px;
}

.right-sidebar .sidebar-toggle {
  left: -12px;
  top: 20px;
}

.left-sidebar.collapsed .sidebar-toggle {
  transform: rotate(180deg);
}

.right-sidebar.collapsed .sidebar-toggle {
  transform: rotate(180deg);
}

/* 左侧边栏样式 */
.left-sidebar {
  height: 100%;
}

/* API密钥区域 */
#api-key-section {
  margin-bottom: 16px;
}

.api-key-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.api-key-header h3 {
  margin-bottom: 0;
  white-space: nowrap;
}

/* 模型信息样式 */
#model-info {
  font-size: 12px;
  background-color: var(--surface-2);
  padding: 10px;
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color-light);
  margin-top: 8px;
  color: var(--text-secondary);
  box-shadow: var(--box-shadow-sm);
}

.model-name-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-color-light);
}

.info-row {
  display: flex;
  margin-bottom: 5px;
  align-items: baseline;
}

.info-label {
  min-width: 90px;
  font-weight: 500;
  color: var(--text-primary);
  flex-shrink: 0;
}

.info-value {
  flex-grow: 1;
  text-align: right;
  color: var(--text-secondary);
  max-width: 170px;
}

.info-value.id-value {
  white-space: normal;
  word-break: break-all;
  font-size: 11px;
  line-height: 1.2;
  max-width: none;
  overflow: visible;
  text-overflow: clip;
}

.info-row.description-row {
  align-items: center;
  margin-bottom: 8px;
}

.info-row.description-row .info-value {
  text-align: right;
  font-style: italic;
  font-size: 11px;
  line-height: 1.3;
  max-width: none;
  background-color: transparent;
  border: none;
  padding: 0;
}

/* 版本信息 */
.version-info {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border-color-light);
}

/* 模型选择器 */
#model-selector {
  background-color: var(--surface-1);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 8px 12px;
  font-size: 14px;
  color: var(--text-primary);
  width: 100%;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23868e96' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 36px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

#model-selector:hover {
  border-color: var(--primary);
}

#model-selector:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(66, 99, 235, 0.15);
  outline: none;
}

/* 刷新模型按钮 */
#refresh-models-btn {
  margin-top: 6px;
  font-size: 13px;
  padding: 6px 10px;
}

#refresh-models-btn::before {
  content: '';
  width: 14px;
  height: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='1 4 1 10 7 10'%3E%3C/polyline%3E%3Cpolyline points='23 20 23 14 17 14'%3E%3C/polyline%3E%3Cpath d='M20.49 9A9 9 0 0 0 5.64 5.64L1 10m22 4l-4.64 4.36A9 9 0 0 1 3.51 15'%3E%3C/path%3E%3C/svg%3E");
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  display: inline-block;
  margin-right: 6px;
}

/* 左侧边栏折叠状态 */
.left-sidebar.collapsed h2 small,
.left-sidebar.collapsed h3,
.left-sidebar.collapsed #api-key,
.left-sidebar.collapsed .api-status,
.left-sidebar.collapsed #model-selector,
.left-sidebar.collapsed #model-info,
.left-sidebar.collapsed .version-info p {
  display: none;
}

.left-sidebar.collapsed h2 {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  white-space: nowrap;
  margin: 10px auto;
  border: none;
}

.left-sidebar.collapsed button {
  width: 36px;
  height: 36px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--border-radius-circle);
  overflow: hidden;
  margin: 10px auto;
}

.left-sidebar.collapsed button span {
  display: none;
}

/* 右侧边栏样式 */
.right-sidebar {
  height: 100%;
  background-color: var(--surface-1);
}

.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color-light);
}

.settings-header h2 {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.settings-section {
  margin-bottom: 20px;
}

.settings-section-header {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  cursor: pointer;
}

.settings-section-header h3 {
  margin-bottom: 0;
  margin-left: 8px;
}

.settings-section-header .toggle-icon {
  width: 16px;
  height: 16px;
  transition: transform var(--transition-fast);
}

.settings-section.collapsed .toggle-icon {
  transform: rotate(-90deg);
}

.settings-section-content {
  padding-left: 24px;
  display: none;
}

.settings-section.expanded .settings-section-content {
  display: block;
}

.setting-item {
  margin-bottom: 12px;
}

.setting-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.setting-label {
  font-size: 13px;
  color: var(--text-secondary);
}

.setting-value {
  font-size: 13px;
  color: var(--primary);
  font-weight: 500;
}

.setting-description {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.radio-group-setting {
  display: flex;
  gap: 12px;
  margin-top: 6px;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 6px;
}

.radio-option label {
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
}

.setting-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

/* 右侧边栏折叠状态 */
.right-sidebar.collapsed .settings-content,
.right-sidebar.collapsed .version-info {
  display: none;
}

.right-sidebar.collapsed .settings-header h2 {
  writing-mode: vertical-lr;
  transform: rotate(180deg);
  white-space: nowrap;
  margin: 10px auto;
  border: none;
  padding: 0;
}

.right-sidebar.collapsed {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 8px;
}
