/* ═══════════════════════════════════════════════════════════
 * NYAS Custom Theme: Dark — Moonlit Lotus Lake (5PM–4AM)
 * Art Style: Nocturne minimalism
 * Mood: Silver moonlight, deep water, quiet lotus bloom
 * ═══════════════════════════════════════════════════════════ */

:root {
  color-scheme: dark;
  /* ── Backgrounds & Surfaces (Moonlit Water + Midnight Sky) ── */
  --color-bg: rgba(8, 14, 25, 0.24);
  --color-surface: rgba(16, 25, 40, 0.88);
  --color-surface-hover: rgba(22, 33, 52, 0.92);
  --color-surface-elevated: rgba(26, 39, 62, 0.94);
  --color-surface-secondary: rgba(11, 18, 31, 0.96);

  /* ── Text (Moon Silver + Mist) ── */
  --color-text-primary: #eaf1f8;
  --color-text-secondary: #a3b1c2;
  --color-text-muted: #8090a5;
  --color-text-disabled: #5b677b;

  /* ── Borders (Faint Moon Reflection) ── */
  --color-border: rgba(186, 204, 222, 0.18);

  /* ── Inputs (Deep Glass) ── */
  --color-input-bg: rgba(15, 24, 39, 0.94);
  --color-input-border: rgba(147, 168, 193, 0.3);

  /* ── Primary Action (Moonlit Silver) ── */
  --color-primary: #9dafc6;
  --color-primary-light: #d8e3ee;
  --color-on-primary: #08111d;

  /* ── Semantic Status (Lotus + Lily Variants) ── */
  --color-success: #879d71;
  --color-pending: #dfd09f;
  --color-urgent: #cf8daa;
  --color-danger: #a66583;
  --color-danger-strong: #8f536f;
  --color-status-in-progress: #8fd8ff;
  --color-status-on-hold: #ffd36b;

  /* ── Focus & Overlay ── */
  --color-focus-ring: #d2deea;
  --color-overlay: rgba(3, 8, 18, 0.58);
  --color-accent: #c48aad;
  --color-accent-hover: #aa7294;
  --color-search-highlight-bg: #efe1ec;
  --color-search-highlight-text: #0c1522;

  /* ── Column Backgrounds (Let the Nightscape Breathe) ── */
  --color-column-bg-odd: transparent;
  --color-column-bg-even: transparent;

  /* ── Shadows (Water Reflection) ── */
  --shadow-card: 0 12px 32px 0 rgba(4, 9, 18, 0.34), 0 0 14px 0 rgba(216, 227, 238, 0.04);
  --shadow-card-hover: 0 18px 42px 0 rgba(4, 9, 18, 0.44), 0 0 18px 0 rgba(216, 227, 238, 0.12);
  --shadow-btn-glow: 0 10px 24px rgba(157, 175, 198, 0.16);

  /* ── Glass Morphism (Midnight Mist) ── */
  --glass-blur: 22px;
  --glass-bg: rgba(15, 24, 39, 0.72);

  /* ── Logo ── */
  --color-logo: #edf4fb;
  --color-logo-shimmer: rgba(219, 231, 242, 0.72);

  /* ── Category Colors (Moon, Mountain, Lotus, Reed) ── */
  --color-category-blue: #82c8ff;
  --color-category-teal: #66e0d4;
  --color-category-green: #a8e070;
  --color-category-yellow: #ffe27a;
  --color-category-orange: #ffb26a;
  --color-category-red: #ff7fa2;
  --color-category-pink: #ff9bd2;
  --color-category-purple: #c7a2ff;
  --color-category-indigo: #9ab0ff;
  --color-category-gray: #d0d7e6;

  /* ── Status Glow ── */
  --color-status-glow: transparent;

  /* ── Card-Specific ── */
  --color-card-bg: rgba(16, 25, 40, 0.78);
  --color-card-text: #edf3f9;
  --color-card-text-secondary: #a5b3c4;
  --color-card-border: rgba(180, 198, 220, 0.18);

  /* ── Typography (Inter) ── */
  --font-family-body: 'Inter', system-ui, sans-serif;
  --font-family-heading: 'Inter', system-ui, sans-serif;
  --font-family-mono: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;

  --font-size-xs: 0.85rem;
  --font-size-sm: 0.95rem;
  --font-size-base: 1.1rem;
  --font-size-md: 1.4rem;
  --font-size-lg: 1.8rem;
  --font-size-xl: 2.2rem;
  --font-size-2xl: 3rem;

  --font-weight-normal: 500;
  --font-weight-medium: 600;
  --font-weight-semibold: 700;
  --font-weight-bold: 800;
  --font-weight-heading: 800;

  --line-height-tight: 1.4;
  --line-height-normal: 1.7;
  --line-height-relaxed: 1.85;

  --letter-spacing-tight: -0.0125em;
  --letter-spacing-normal: 0;
  --letter-spacing-wide: 0.025em;

  /* ── Shape ── */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* ── Motion ── */
  --duration-fast: 100ms;
  --duration-normal: 200ms;
  --duration-slow: 350ms;
  --easing-default: cubic-bezier(0.34, 1.56, 0.64, 1);
  --easing-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --easing-out: cubic-bezier(0, 0, 0.2, 1);

  /* ═══ M10 Extended Variables ═══ */

  /* ── Logo (Extended) ── */
  --logo-shimmer-duration: 24s;
  --logo-bg: color-mix(in srgb, var(--color-surface) 84%, var(--color-bg) 16%);
  --logo-border: color-mix(in srgb, var(--color-border) 75%, transparent);
  --logo-padding: 0;
  --logo-border-radius: 0;
  --logo-backdrop-blur: 0;

  /* ── Background Art ── */
  --bg-image-url: url('/themes/art/zen-dark.png');
  --bg-image-opacity: 0.46;
  --bg-image-position: center 80%;
  --bg-image-size: cover;

  /* ── Overdue Pulse ── */
  --color-overdue-pulse: #c27c98;
  --overdue-pulse-duration: 4s;

  /* ── Input Focus ── */
  --color-input-focus-glow: rgba(157, 175, 198, 0.18);
  --input-focus-pulse: input-focus-pulse 1.5s ease;

  /* ── Scrollbar ── */
  --color-scrollbar-thumb: rgba(142, 160, 180, 0.18);
  --color-scrollbar-track: rgba(10, 17, 29, 0.08);
  --scrollbar-width: 8px;
  --scrollbar-thumb-opacity: 0.3;

  /* ── Overlay / Dialogue ── */
  --overlay-blur: 32px;

  /* ── Cursor ── */
  --cursor-default: auto;
  --cursor-pointer: pointer;

  /* ── Empty Column ── */
  --color-empty-column-motif: rgba(157, 175, 198, 0.12);

  /* ── Navigation Lantern ── */
  --nav-active-glow: 0 0 12px 2px rgba(216, 227, 238, 0.12);
  --nav-active-border-color: #9dafc6;

  /* ── Tooltip Glass ── */
  --tooltip-bg: rgba(9, 17, 29, 0.94);
  --tooltip-backdrop-blur: 16px;

  /* ── Settings Jali ── */
  --settings-bg-image: none;
  --settings-bg-opacity: 0.9;

  /* ── Drag Target ── */
  --color-drag-target-glow: rgba(216, 227, 238, 0.16);

  /* ── Skeleton ── */
  --skeleton-shimmer-color: #1d2a3e;

  /* ── Bird & Wisps (Moonlit Breeze) ── */
  --flora-petal-color: #bb88af;
  --flora-leaf-color: #7a9967;
  --bird-color: #d7e2ee;
  --bird-trail-color-1: #eef5fb;
  --bird-trail-color-2: #c48aad;
  --wisp-color: rgba(255, 255, 255, 0.72);
  --wisp-opacity: 0.28;
  --flora-opacity: 0.62;
  --wisp-count: 4;
  --flora-count: 3;
  --fireflies-enabled: 1;
  --firefly-count: 3;
  --firefly-background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.98) 0%,
    rgba(245, 248, 252, 0.85) 45%,
    rgba(223, 208, 159, 0.22) 72%,
    transparent 100%
  );
  --firefly-box-shadow:
    0 0 8px rgba(255, 255, 255, 0.95), 0 0 18px rgba(245, 248, 252, 0.55),
    0 0 30px rgba(223, 208, 159, 0.18);

  /* ── Cross-Dissolve ── */
  --cross-dissolve-duration: 0ms;

  /* ── Assistant ── */
  --assistant-orb-color-primary: #d8e3ee;
  --assistant-orb-color-secondary: #c48aad;
  --assistant-orb-color-core: #ffffff;
  --assistant-orb-glow-intensity: 0.68;
  --assistant-orb-size: 56px;
  --assistant-orb-size-mobile: 48px;
  --assistant-chat-bg: rgba(10, 18, 31, 0.92);
  --assistant-chat-bg-elevated: rgba(14, 24, 39, 0.95);
  --assistant-chat-border: rgba(157, 175, 198, 0.18);
  --assistant-chat-width: 380px;
  --assistant-chat-height: 520px;
  --assistant-chat-radius: var(--radius-xl);
  --assistant-bubble-user-bg: var(--color-primary);
  --assistant-bubble-user-text: #08111d;
  --assistant-bubble-assistant-bg: rgba(255, 255, 255, 0.06);
  --assistant-bubble-assistant-text: var(--color-text-primary);
  --assistant-voice-active-color: var(--color-danger);
}

/* ── Component Styles ── */

.btn-primary {
  background: linear-gradient(135deg, #d8e3ee 0%, #b6c7d8 42%, #8ea4bc 100%);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-full);
  box-shadow:
    0 12px 24px rgba(4, 9, 18, 0.3),
    0 4px 14px rgba(157, 175, 198, 0.16),
    inset 0 1px 1px rgba(255, 255, 255, 0.42);
  color: var(--color-on-primary) !important;
  font-family: var(--font-family-body);
  font-weight: var(--font-weight-medium);
  padding: 0.625rem 1.5rem;
  transition: all var(--duration-normal) var(--easing-default);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #e2ebf4 0%, #c3d1df 42%, #9aacbf 100%);
  box-shadow:
    0 14px 28px rgba(4, 9, 18, 0.36),
    0 6px 18px rgba(157, 175, 198, 0.22),
    inset 0 1px 1px rgba(255, 255, 255, 0.42);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(16, 25, 40, 0.9);
  color: #eaf1f8 !important;
  border: 1px solid rgba(186, 204, 222, 0.22);
  box-shadow:
    0 10px 22px rgba(4, 9, 18, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.btn-secondary:hover {
  background: rgba(22, 33, 52, 0.96);
  border-color: rgba(216, 227, 238, 0.26);
  color: #f1f7fd !important;
}

.btn-primary svg,
.btn-secondary svg {
  color: currentColor !important;
}

.btn-ghost svg {
  color: var(--color-text-primary) !important;
}

.btn-ghost {
  color: #d1ddeb !important;
  background: rgba(196, 138, 173, 0.1);
}

.btn-ghost:hover {
  background: rgba(196, 138, 173, 0.18);
  color: var(--color-accent) !important;
}

.input-field {
  background: var(--color-input-bg);
  border: 1px solid var(--color-input-border);
  border-radius: var(--radius-md);
  font-family: var(--font-family-body);
  box-shadow: inset 0 1px 2px rgba(3, 8, 18, 0.28);
  transition: all 150ms ease;
}

.input-field:focus,
.input-field:focus-within {
  border-width: 1px;
  border-color: var(--color-primary);
  outline: none;
  box-shadow:
    0 0 0 3px var(--color-input-focus-glow),
    inset 0 1px 2px rgba(3, 8, 18, 0.34);
  animation: var(--input-focus-pulse);
}

.card-glass {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-radius: var(--radius-xl);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-card);
}

@supports not (backdrop-filter: blur(1px)) {
  .card-glass {
    background: var(--color-surface);
  }
}

.card-hover:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
}

.progress-bar-glow {
  position: relative;
  height: 6px;
  background: var(--color-border);
  border-radius: var(--radius-full);
  overflow: visible;
}

.progress-bar-glow-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--color-primary-light) 0%, var(--color-primary) 100%);
  box-shadow:
    0 0 10px 2px rgba(157, 175, 198, 0.6),
    0 0 24px 4px rgba(216, 227, 238, 0.22);
  transition:
    width 0.4s ease,
    box-shadow 0.3s ease;
}

.nyas-logo {
  color: var(--color-logo);
  font-family: var(--font-family-heading);
  font-size: 27px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-wide);
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--logo-bg);
  border: 1px solid var(--logo-border);
  padding: var(--logo-padding);
  border-radius: var(--logo-border-radius);
  backdrop-filter: blur(var(--logo-backdrop-blur));
  -webkit-backdrop-filter: blur(var(--logo-backdrop-blur));
  transform-origin: center;
  animation: logo-breathing-soft 8s ease-in-out infinite;
  will-change: transform, box-shadow, text-shadow;
}

@keyframes logo-breathing-soft {
  0%,
  100% {
    transform: scale(1);
    box-shadow:
      0 0 0 0 transparent,
      0 0 0 0 transparent;
    text-shadow: 0 0 0 transparent;
  }

  30% {
    transform: scale(1.015);
    box-shadow:
      0 0 3px 1px color-mix(in srgb, var(--color-logo-shimmer) 12%, transparent),
      0 0 8px 2px color-mix(in srgb, var(--color-logo-shimmer) 6%, transparent);
    text-shadow: 0 0 2px color-mix(in srgb, var(--color-logo-shimmer) 10%, transparent);
  }

  50% {
    transform: scale(1.045);
    box-shadow:
      0 0 6px 2px color-mix(in srgb, var(--color-logo-shimmer) 20%, transparent),
      0 0 14px 5px color-mix(in srgb, var(--color-logo-shimmer) 10%, transparent);
    text-shadow: 0 0 3px color-mix(in srgb, var(--color-logo-shimmer) 12%, transparent);
  }

  70% {
    transform: scale(1.015);
    box-shadow:
      0 0 3px 1px color-mix(in srgb, var(--color-logo-shimmer) 10%, transparent),
      0 0 7px 2px color-mix(in srgb, var(--color-logo-shimmer) 5%, transparent);
    text-shadow: 0 0 2px color-mix(in srgb, var(--color-logo-shimmer) 8%, transparent);
  }
}

/* ── Task Completion Moonlit Glow ── */
.task-done-sunrise,
.task-done-moonlit {
  animation: moonlit-glow-animation 3s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  position: relative;
  z-index: 50;
}

@keyframes moonlit-glow-animation {
  0% {
    box-shadow: 0 0 0 0 rgba(216, 227, 238, 0);
    border-color: var(--color-card-border);
    transform: scale(1);
  }

  18% {
    box-shadow:
      0 0 42px 14px rgba(216, 227, 238, 0.38),
      0 0 78px 28px rgba(157, 175, 198, 0.18);
    border-color: #d8e3ee;
    transform: scale(1.03);
  }

  34% {
    box-shadow:
      0 0 54px 18px rgba(196, 138, 173, 0.34),
      0 0 92px 34px rgba(216, 227, 238, 0.14);
    border-color: #c48aad;
  }

  100% {
    box-shadow: 0 0 0 0 rgba(216, 227, 238, 0);
    border-color: var(--color-card-border);
    transform: scale(1);
  }
}

/* Moonlit Water Sparkles */
.sparkle {
  position: absolute;
  width: 14px;
  height: 14px;
  background: #ffffff;
  border: 3px solid #d8e3ee;
  border-radius: 50%;
  pointer-events: none;
  z-index: 999;
  box-shadow:
    0 0 18px 8px rgba(216, 227, 238, 0.78),
    0 0 34px 14px rgba(255, 255, 255, 0.7),
    0 0 48px 18px rgba(196, 138, 173, 0.16);
  animation: moonlit-sparkle-twinkle 0.8s ease-in-out infinite alternate;
}

@keyframes moonlit-sparkle-twinkle {
  0% {
    transform: scale(0.45) rotate(0deg);
    opacity: 0.45;
  }

  100% {
    transform: scale(1.18) rotate(45deg);
    opacity: 1;
  }
}

/* Lighten scrollbar specifically in the Board columns for better focus on art */
[data-testid='board-column'] ::-webkit-scrollbar-thumb,
.board-container ::-webkit-scrollbar-thumb {
  background: rgba(142, 160, 180, 0.08) !important;
}

.flex-1.flex.overflow-x-auto::-webkit-scrollbar-thumb {
  background: rgba(142, 160, 180, 0.08) !important;
}
