/* =================================
   テーマ切り替えUI v2.0 スタイル
   カラースキーム + ダークモード分離版
   ================================= */

.theme-switcher-v2 {
  position: fixed;
  top: 50%;
  right: 20px;
  transform: translateY(-50%);
  z-index: 1050;
  background: var(--background-primary);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  padding: 15px;
  box-shadow: 0 4px 20px var(--shadow-color);
  transition: all 0.3s ease;
  max-width: 300px;
}

.theme-switcher-v2.collapsed {
  width: 60px;
  padding: 15px 10px;
}

.theme-switcher-toggle-v2 {
  background: var(--primary-color);
  color: var(--text-light);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  margin: 0 auto;
}

.theme-switcher-toggle-v2:hover {
  background: var(--primary-dark);
  transform: scale(1.1);
}

.theme-switcher-content-v2 {
  margin-top: 15px;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.theme-switcher-v2.collapsed .theme-switcher-content-v2 {
  display: none;
}

.theme-section {
  margin-bottom: 20px;
}

.theme-section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 10px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* カラースキーム選択 */
.color-scheme-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 15px;
}

.color-scheme-option {
  position: relative;
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: 8px;
  padding: 8px;
  transition: all 0.3s ease;
  background: var(--background-secondary);
}

.color-scheme-option:hover {
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow-color);
}

.color-scheme-option.active {
  border-color: var(--primary-color);
  background: var(--primary-color);
}

.color-scheme-option.active .scheme-name {
  color: var(--text-light);
}

.scheme-preview {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 6px;
}

.scheme-color {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.scheme-name {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-primary);
  text-align: center;
  transition: color 0.3s ease;
}

/* 各カラースキームのプレビューカラー */
.color-scheme-option[data-scheme="tlcs-green"] .scheme-color:nth-child(1) { background: #2c8b80; }
.color-scheme-option[data-scheme="tlcs-green"] .scheme-color:nth-child(2) { background: #56d1a7; }
.color-scheme-option[data-scheme="tlcs-green"] .scheme-color:nth-child(3) { background: #0f3d3e; }

.color-scheme-option[data-scheme="ocean-blue"] .scheme-color:nth-child(1) { background: #0077be; }
.color-scheme-option[data-scheme="ocean-blue"] .scheme-color:nth-child(2) { background: #4fc3f7; }
.color-scheme-option[data-scheme="ocean-blue"] .scheme-color:nth-child(3) { background: #003d5b; }

.color-scheme-option[data-scheme="sunset-orange"] .scheme-color:nth-child(1) { background: #ff6b35; }
.color-scheme-option[data-scheme="sunset-orange"] .scheme-color:nth-child(2) { background: #ffab91; }
.color-scheme-option[data-scheme="sunset-orange"] .scheme-color:nth-child(3) { background: #d84315; }

.color-scheme-option[data-scheme="royal-purple"] .scheme-color:nth-child(1) { background: #7b1fa2; }
.color-scheme-option[data-scheme="royal-purple"] .scheme-color:nth-child(2) { background: #ba68c8; }
.color-scheme-option[data-scheme="royal-purple"] .scheme-color:nth-child(3) { background: #4a148c; }

/* ダークモード切り替え */
.dark-mode-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px;
  background: var(--background-secondary);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.dark-mode-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
}

.dark-mode-switch {
  position: relative;
  width: 50px;
  height: 24px;
  background: var(--border-color);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.dark-mode-switch.active {
  background: var(--primary-color);
}

.dark-mode-switch::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.dark-mode-switch.active::before {
  transform: translateX(26px);
}

.dark-mode-icons {
  display: flex;
  align-items: center;
  gap: 5px;
}

.mode-icon {
  font-size: 12px;
  color: var(--text-secondary);
  transition: color 0.3s ease;
}

.mode-icon.active {
  color: var(--primary-color);
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .theme-switcher-v2 {
    right: 10px;
    max-width: 280px;
  }

  .color-scheme-options {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .theme-switcher-v2 {
    position: fixed;
    bottom: 20px;
    right: 10px;
    top: auto;
    transform: none;
    max-width: 250px;
  }

  .theme-switcher-v2.collapsed {
    width: 50px;
    padding: 10px 8px;
  }

  .theme-switcher-toggle-v2 {
    width: 35px;
    height: 35px;
  }
}

/* アクセシビリティ */
.color-scheme-option:focus,
.dark-mode-switch:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

.theme-switcher-toggle-v2:focus {
  outline: 2px solid var(--text-light);
  outline-offset: 2px;
}

/* アニメーション */
@keyframes themeChangeV2 {
  0% { opacity: 0.8; }
  50% { opacity: 0.6; }
  100% { opacity: 1; }
}

.theme-changing-v2 {
  animation: themeChangeV2 0.5s ease;
}
