/**
 * Theme Switcher Component Styles
 * 共用的主题切换下拉框样式
 */

/* 主题切换下拉框容器 */
.theme-switcher {
  position: relative;
  margin-left: 0.5rem;
  flex-shrink: 0;
}

/* 切换按钮 */
.theme-switcher-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 36px;
  padding: 0 10px;
  border-radius: 18px;
  cursor: pointer;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  transition: background 0.2s, border-color 0.2s;
  color: var(--text-muted);
}

.theme-switcher-btn:hover {
  border-color: var(--accent);
  background: rgba(1, 164, 239, 0.1);
}

/* 主题图标 */
.theme-icon {
  width: 16px;
  height: 16px;
  display: none;
}

.theme-chevron {
  width: 14px;
  height: 14px;
  transition: transform 0.2s;
}

.theme-switcher.is-open .theme-chevron {
  transform: rotate(180deg);
}

/* 根据当前主题显示对应图标 */
.theme-switcher.theme-is-dark .theme-icon-dark { display: block; }
.theme-switcher.theme-is-light .theme-icon-light { display: block; }
.theme-switcher.theme-is-auto .theme-icon-auto { display: block; }

/* 兼容旧的 data-theme 方式 */
[data-theme="dark"] .theme-icon-dark { display: block; }
[data-theme="light"] .theme-icon-light { display: block; }

/* 下拉菜单 */
.theme-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 140px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  padding: 4px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
  z-index: 200;
}

.theme-switcher.is-open .theme-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* 选项 */
.theme-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
}

.theme-option:hover {
  background: rgba(1, 164, 239, 0.1);
  color: var(--text);
}

.theme-option.is-active {
  color: var(--accent);
  font-weight: 600;
}

.theme-option svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
