/* ═════════════════════════════════════════════════════════════════════════════
   TDCluster Modern Theme Library (static/style.css)
   11 Core Themes + 4 Seasonal Asian Themes + Canvas FX Integration
   ═════════════════════════════════════════════════════════════════════════════ */

/* ── 1. Default & OLED ──────────────────────────────────────────────────────── */
:root,
[data-theme="theme-oled"],
[data-theme="obsidian"] {
  --bg: #000000;
  --surface-glass: rgba(14, 14, 18, 0.82);
  --surface-glass2: rgba(24, 24, 30, 0.9);
  --surface-tile: rgba(255, 255, 255, 0.035);
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-glass2: rgba(99, 102, 241, 0.22);
  --primary: #6366f1;
  --primary-rgb: 99, 102, 241;
  --primary2: #818cf8;
  --primary2-rgb: 129, 140, 248;
  --teal: #22d3ee;
  --green: #57f287;
  --red: #ed4245;
  --gold: #fee75c;
  --text: #ffffff;
  --text-sub: #dbdee1;
  --muted: #949ba4;
  --glass-blur: blur(20px) saturate(180%);
  --glass-blur-sm: blur(14px) saturate(160%);
  --shadow-glass: 0 14px 40px -8px rgba(0, 0, 0, 0.9), inset 0 1px 1px 0 rgba(255, 255, 255, 0.1);
  --shadow-btn: 0 6px 20px -4px rgba(99, 102, 241, 0.45), inset 0 1px 1px 0 rgba(255, 255, 255, 0.35);
  --theme-swatch: #000000;
  --theme-accent: #6366f1;
}

/* ── 2. Winter Frost (New Year / Frost Indigo) ─────────────────────────── */
[data-theme="theme-winter"] {
  --bg: #050b18;
  --surface-glass: rgba(15, 27, 52, 0.78);
  --surface-glass2: rgba(22, 38, 72, 0.88);
  --surface-tile: rgba(56, 189, 248, 0.045);
  --border-glass: rgba(56, 189, 248, 0.22);
  --border-glass2: rgba(56, 189, 248, 0.45);
  --primary: #38bdf8;
  --primary-rgb: 56, 189, 248;
  --primary2: #7dd3fc;
  --primary2-rgb: 125, 211, 252;
  --teal: #38bdf8;
  --green: #34d399;
  --red: #f87171;
  --gold: #fde047;
  --text: #f0f9ff;
  --text-sub: #e0f2fe;
  --muted: #7dd3fc;
  --shadow-glass: 0 16px 40px -8px rgba(56, 189, 248, 0.18), inset 0 1px 1px 0 rgba(255, 255, 255, 0.18);
  --shadow-btn: 0 6px 20px -4px rgba(56, 189, 248, 0.45);
  --theme-swatch: #050b18;
  --theme-accent: #38bdf8;
}

/* ── 3. Spring Sakura (Cherry Blossom / Japanese Garden) ───────────────── */
[data-theme="theme-sakura"] {
  --bg: #0e0712;
  --surface-glass: rgba(30, 14, 34, 0.82);
  --surface-glass2: rgba(42, 20, 48, 0.9);
  --surface-tile: rgba(255, 117, 151, 0.045);
  --border-glass: rgba(255, 117, 151, 0.22);
  --border-glass2: rgba(255, 117, 151, 0.45);
  --primary: #ff7597;
  --primary-rgb: 255, 117, 151;
  --primary2: #f472b6;
  --primary2-rgb: 244, 114, 182;
  --teal: #2dd4bf;
  --green: #4ade80;
  --red: #fb7185;
  --gold: #fde047;
  --text: #fdf2f8;
  --text-sub: #fce7f3;
  --muted: #f472b6;
  --shadow-glass: 0 16px 40px -8px rgba(255, 117, 151, 0.18), inset 0 1px 1px 0 rgba(255, 255, 255, 0.15);
  --shadow-btn: 0 6px 20px -4px rgba(255, 117, 151, 0.45);
  --theme-swatch: #0e0712;
  --theme-accent: #ff7597;
}

/* ── 4. Summer Ocean (Ocean Azure) ──────────────────────────────────────── */
[data-theme="theme-summer"] {
  --bg: #03141b;
  --surface-glass: rgba(6, 32, 44, 0.82);
  --surface-glass2: rgba(8, 44, 60, 0.9);
  --surface-tile: rgba(6, 182, 212, 0.045);
  --border-glass: rgba(6, 182, 212, 0.24);
  --border-glass2: rgba(6, 182, 212, 0.48);
  --primary: #06b6d4;
  --primary-rgb: 6, 182, 212;
  --primary2: #22d3ee;
  --primary2-rgb: 34, 211, 238;
  --teal: #06b6d4;
  --green: #10b981;
  --red: #f43f5e;
  --gold: #f59e0b;
  --text: #ecfeff;
  --text-sub: #cffafe;
  --muted: #67e8f9;
  --shadow-glass: 0 16px 40px -8px rgba(6, 182, 212, 0.18), inset 0 1px 1px 0 rgba(255, 255, 255, 0.15);
  --shadow-btn: 0 6px 20px -4px rgba(6, 182, 212, 0.45);
  --theme-swatch: #03141b;
  --theme-accent: #06b6d4;
}

/* ── 5. Autumn Momiji (Japanese Maple) ──────────────────────────────────────── */
[data-theme="theme-autumn"] {
  --bg: #140804;
  --surface-glass: rgba(38, 18, 12, 0.82);
  --surface-glass2: rgba(52, 24, 16, 0.9);
  --surface-tile: rgba(249, 115, 22, 0.045);
  --border-glass: rgba(249, 115, 22, 0.24);
  --border-glass2: rgba(239, 68, 68, 0.45);
  --primary: #f97316;
  --primary-rgb: 249, 115, 22;
  --primary2: #fb923c;
  --primary2-rgb: 251, 146, 60;
  --teal: #06b6d4;
  --green: #22c55e;
  --red: #ef4444;
  --gold: #eab308;
  --text: #fff7ed;
  --text-sub: #ffedd5;
  --muted: #fb923c;
  --shadow-glass: 0 16px 40px -8px rgba(249, 115, 22, 0.18), inset 0 1px 1px 0 rgba(255, 255, 255, 0.15);
  --shadow-btn: 0 6px 20px -4px rgba(249, 115, 22, 0.45);
  --theme-swatch: #140804;
  --theme-accent: #f97316;
}

/* ── Theme Modal & Selector UI ──────────────────────────────────────────────── */
.theme-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.theme-card-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.theme-card-option:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--primary);
  transform: translateY(-1px);
}

.theme-card-option.active {
  background: rgba(var(--primary-rgb), 0.15);
  border-color: var(--primary);
  box-shadow: 0 0 12px rgba(var(--primary-rgb), 0.35);
}

.theme-swatch-circle {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.theme-swatch-split {
  position: absolute;
  top: 0;
  right: 0;
  width: 50%;
  height: 100%;
}

.theme-card-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fx-modes-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.fx-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-sub);
  cursor: pointer;
  transition: all 0.18s ease;
}

.fx-pill-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.fx-pill-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(var(--primary-rgb), 0.4);
}

/* ── Modal Theme Center & Mobile Alignment ── */
#modal-theme,
#modal-theme-picker {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 10050 !important;
  display: none;
  align-items: center !important;
  justify-content: center !important;
  background: rgba(0, 0, 0, 0.75) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  margin: 0 !important;
  padding: 0 !important;
}

#modal-theme .modal,
#modal-theme-picker .modal,
.theme-modal-dialog {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  width: 90% !important;
  max-width: 420px !important;
  max-height: 85vh !important;
  overflow-y: auto !important;
  z-index: 10051 !important;
  margin: 0 !important;
  box-sizing: border-box !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 0 1px var(--border-glass) !important;
}

/* ── Matrix Theme High Contrast Overhauls ── */
[data-theme="theme-matrix"],
[data-theme="cyberpunk"] {
  --text: #00ff66 !important;
  --text-main: #00ff66 !important;
  --text-sub: #34d399 !important;
  --text-muted: #22c55e !important;
  --text-muted2: #16a34a !important;
}

[data-theme="theme-matrix"] .theme-card-option,
[data-theme="theme-matrix"] .theme-card-label,
[data-theme="theme-matrix"] .theme-card-title,
[data-theme="theme-matrix"] .modal-title,
[data-theme="theme-matrix"] .modal-desc,
[data-theme="theme-matrix"] .fx-pill-btn,
[data-theme="theme-matrix"] .fx-toggle-btn,
[data-theme="theme-matrix"] .badge,
[data-theme="theme-matrix"] .perk,
[data-theme="theme-matrix"] select,
[data-theme="theme-matrix"] option,
[data-theme="theme-matrix"] input,
[data-theme="theme-matrix"] .plan-tag,
[data-theme="theme-matrix"] .plan-name,
[data-theme="theme-matrix"] .plan-price-val {
  color: #00ff66 !important;
}

[data-theme="theme-matrix"] .theme-card-option {
  background: rgba(0, 255, 102, 0.08) !important;
  border-color: rgba(0, 255, 102, 0.3) !important;
}

[data-theme="theme-matrix"] .theme-card-option:hover,
[data-theme="theme-matrix"] .theme-card-option.active {
  background: rgba(0, 255, 102, 0.2) !important;
  border-color: #00ff66 !important;
  box-shadow: 0 0 12px rgba(0, 255, 102, 0.45) !important;
}

[data-theme="theme-matrix"] .fx-pill-btn {
  background: rgba(0, 255, 102, 0.1) !important;
  border-color: rgba(0, 255, 102, 0.3) !important;
  color: #00ff66 !important;
}

[data-theme="theme-matrix"] .fx-pill-btn.active {
  background: #00ff66 !important;
  color: #040d06 !important;
  font-weight: 800 !important;
  box-shadow: 0 0 14px rgba(0, 255, 102, 0.6) !important;
}
