/* ============================================================
   COLOR CYCLE THEME - Auto-rotating palettes
   ============================================================ */

[data-theme="color-cycle"] {
  /* Will be overridden by JS - these are fallbacks */
  --bg: #0a1a1f;
  --bg-secondary: #0f2429;
  --bg-card: #122a30;
  --ink: #f4e9cd;
  --ink-soft: #c8d6d4;
  --accent: #468189;
  --accent-bright: #77aca2;
  --accent-glow: rgba(70, 129, 137, 0.35);
  --muted: #9dbebb;
  --border: rgba(119, 172, 162, 0.15);
  --glass: rgba(18, 42, 48, 0.6);
  --glass-border: rgba(119, 172, 162, 0.12);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.2);
  --shadow-md: 0 8px 32px rgba(0,0,0,0.3);
  --shadow-lg: 0 16px 64px rgba(0,0,0,0.4);
}

/* Palette 1: Ink + Teal (Default) */
[data-theme="color-cycle"][data-palette="0"] {
  --bg: #0a1a1f;
  --bg-secondary: #0f2429;
  --bg-card: #122a30;
  --ink: #f4e9cd;
  --ink-soft: #c8d6d4;
  --accent: #468189;
  --accent-bright: #77aca2;
  --accent-glow: rgba(70, 129, 137, 0.35);
  --muted: #9dbebb;
  --border: rgba(119, 172, 162, 0.15);
  --glass: rgba(18, 42, 48, 0.6);
  --glass-border: rgba(119, 172, 162, 0.12);
}

/* Palette 2: Powder Blush */
[data-theme="color-cycle"][data-palette="1"] {
  --bg: #5e6472;
  --bg-secondary: #4a5260;
  --bg-card: #6b7485;
  --ink: #faf3dd;
  --ink-soft: #f0e6c8;
  --accent: #ffa69e;
  --accent-bright: #b8f2e6;
  --accent-glow: rgba(255, 166, 158, 0.4);
  --muted: #aed9e0;
  --border: rgba(184, 242, 230, 0.2);
  --glass: rgba(107, 116, 133, 0.7);
  --glass-border: rgba(184, 242, 230, 0.15);
}

/* Palette 3: Midnight Violet */
[data-theme="color-cycle"][data-palette="2"] {
  --bg: #331832;
  --bg-secondary: #2a1429;
  --bg-card: #422040;
  --ink: #fdf0d5;
  --ink-soft: #f0e6c8;
  --accent: #d81e5b;
  --accent-bright: #f0544f;
  --accent-glow: rgba(216, 30, 91, 0.4);
  --muted: #c6d8d3;
  --border: rgba(240, 84, 79, 0.2);
  --glass: rgba(66, 32, 64, 0.7);
  --glass-border: rgba(240, 84, 79, 0.15);
}

/* Palette 4: Lavender Blush */
[data-theme="color-cycle"][data-palette="3"] {
  --bg: #fcefef;
  --bg-secondary: #f5e8e8;
  --bg-card: #ffffff;
  --ink: #331832;
  --ink-soft: #5e6472;
  --accent: #fcab64;
  --accent-bright: #fcd29f;
  --accent-glow: rgba(252, 171, 100, 0.4);
  --muted: #a89f9a;
  --border: rgba(252, 171, 100, 0.2);
  --glass: rgba(255, 255, 255, 0.9);
  --glass-border: rgba(252, 171, 100, 0.15);
}

/* Palette 5: Deep Ocean */
[data-theme="color-cycle"][data-palette="4"] {
  --bg: #031926;
  --bg-secondary: #082030;
  --bg-card: #0d2a38;
  --ink: #f4e9cd;
  --ink-soft: #c8d6d4;
  --accent: #468189;
  --accent-bright: #7fd8be;
  --accent-glow: rgba(70, 129, 137, 0.4);
  --muted: #9dbebb;
  --border: rgba(127, 216, 190, 0.2);
  --glass: rgba(13, 42, 56, 0.7);
  --glass-border: rgba(127, 216, 190, 0.15);
}

/* Palette 6: Sunset Warmth */
[data-theme="color-cycle"][data-palette="5"] {
  --bg: #331832;
  --bg-secondary: #422040;
  --bg-card: #522d4e;
  --ink: #fcefef;
  --ink-soft: #f5e8e8;
  --accent: #fcab64;
  --accent-bright: #a1fcdf;
  --accent-glow: rgba(252, 171, 100, 0.4);
  --muted: #fcd29f;
  --border: rgba(161, 252, 223, 0.2);
  --glass: rgba(82, 45, 78, 0.7);
  --glass-border: rgba(161, 252, 223, 0.15);
}

/* Transition for smooth palette switching */
[data-theme="color-cycle"] *,
[data-theme="color-cycle"] *::before,
[data-theme="color-cycle"] *::after {
  transition: background-color 1.5s ease,
              border-color 1.5s ease,
              color 1.5s ease,
              box-shadow 1.5s ease,
              background 1.5s ease;
}

/* Cycle indicator animation */
[data-theme="color-cycle"] .cycle-btn {
  animation: cycle-spin 2s linear infinite;
}

@keyframes cycle-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Palette indicator dots */
.palette-indicator {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 1rem;
  padding: 0.5rem;
}

.palette-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.3s;
}

.palette-dot.active {
  border-color: var(--ink);
  transform: scale(1.3);
  box-shadow: 0 0 12px var(--accent-glow);
}

.palette-dot:hover {
  transform: scale(1.2);
}

/* Cycle notification */
.cycle-notification {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 2rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s;
  z-index: 1000;
}

.cycle-notification.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  visibility: visible;
}

.cycle-notification .palette-name {
  color: var(--accent-bright);
  font-weight: 700;
  font-family: var(--font-mono);
}

/* Contrast fix: hero action buttons ≥ 4.5:1 at every palette.
   Ink + Teal / Deep Ocean (#468189 ≈ 4.03:1 with dark text) and
   Midnight Violet (#d81e5b ≈ 3.61:1) are too dark for the base
   `background: var(--accent)` buttons, so swap in lighter tints. */
[data-theme="color-cycle"][data-palette="0"] .btn-primary,
[data-theme="color-cycle"][data-palette="0"] .btn-download,
[data-theme="color-cycle"][data-palette="4"] .btn-primary,
[data-theme="color-cycle"][data-palette="4"] .btn-download {
  background: #4f8b96;
}

[data-theme="color-cycle"][data-palette="2"] .btn-primary,
[data-theme="color-cycle"][data-palette="2"] .btn-download {
  background: #e05f7d;
}