/* ═══════════════════════════════════════════════════════════
 * NYAS Custom Theme: Light — Royal Balcony (4AM–11AM)
 * Art Style: Rajasthani Miniature Minimalism
 * Mood: Warm dawn, golden hope, misty desert serenity
 * ═══════════════════════════════════════════════════════════ */

:root {
  color-scheme: light;
  /* ── Backgrounds & Surfaces (Luminous Sunrise Cream) ── */
  --color-bg: rgba(248, 243, 236, 0.3);
  /* Lighter and more transparent for better art integration */
  --color-surface: rgba(255, 251, 246, 0.9);
  --color-surface-hover: #faf5ee;
  --color-surface-elevated: #fffdfa;
  --color-surface-secondary: #f6efe8;

  /* ── Text (Deep Umber/Desert Earth) ── */
  --color-text-primary: #4a3f35;
  --color-text-secondary: #7d6d62;
  --color-text-muted: #a7998d;
  --color-text-disabled: #d3c7bd;

  /* ── Borders (Sun-bleached Sand) ── */
  --color-border: rgba(193, 177, 160, 0.22);

  /* ── Inputs (warmer cloud white) ── */
  --color-input-bg: #fffdfa;
  --color-input-border: rgba(179, 138, 111, 0.16);

  /* ── Primary Action (Sandstone Gem) ── */
  --color-primary: #b38a6f;
  /* Soft Sandstone */
  --color-primary-light: #d7b4a0;
  /* Sunrise Petal */

  /* ── Semantic Status (Misty Watercolor Aliases) ── */
  --color-on-primary: #ffffff;
  --color-success: #869d7d;
  /* Sage */
  --color-pending: #dbc39d;
  /* Sand */
  --color-urgent: #d8aaab;
  /* Dusty Rose */
  --color-danger: #bf8e82;
  /* Faded Terracotta */

  /* ── Focus & Overlay ── */
  --color-focus-ring: #ead8cb;
  --color-overlay: rgba(74, 63, 53, 0.3);
  --color-accent: #e8c3bf;
  /* Pale Lotus */
  --color-accent-hover: #dbb0ab;
  --color-search-highlight-bg: #f4e8cf;
  --color-search-highlight-text: #4a3f35;

  /* ── Column Backgrounds (Transparent for Art) ── */
  --color-column-bg-odd: transparent;
  --color-column-bg-even: transparent;

  /* ── Shadows (Warm-tinted) ── */
  --shadow-card: 0 8px 24px 0 rgba(74, 63, 53, 0.07), 0 0 12px 0 rgba(255, 255, 255, 0.65);
  --shadow-card-hover: 0 14px 34px 0 rgba(74, 63, 53, 0.1), 0 0 20px 0 rgba(255, 255, 255, 0.9);
  --shadow-btn-glow: 0 10px 22px 0 rgba(179, 138, 111, 0.18);

  /* ── Glass Morphism (Sunrise Mist) ── */
  --glass-blur: 20px;
  --glass-bg: rgba(255, 252, 248, 0.78);

  /* ── Logo ── */
  --color-logo: #5a493b;
  --color-logo-shimmer: #edd8ca;

  /* ── Category Colors (Watercolor Gem Tones) ── */
  --color-category-blue: #8ba5ae;
  --color-category-teal: #8baf9f;
  --color-category-green: #93a677;
  --color-category-yellow: #d6bf89;
  --color-category-orange: #d2a66c;
  --color-category-red: #b98578;
  --color-category-pink: #d3a0a2;
  --color-category-purple: #a693aa;
  --color-category-indigo: #8792ad;
  --color-category-gray: #b7aea5;

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

  /* ── Card-Specific ── */
  --color-card-bg: rgba(255, 250, 245, 0.94);
  --color-card-text: #312720;
  --color-card-text-secondary: #615246;
  --color-card-border: rgba(188, 170, 153, 0.16);

  /* ── Typography (Inter globally as requested) ── */
  --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;
  /* Tiny: Metadata, hints */
  --font-size-sm: 0.95rem;
  /* Small: Descriptions, secondary info */
  --font-size-base: 1.1rem;
  /* Base: Body text, category names */
  --font-size-md: 1.4rem;
  /* Medium: Sub-headings (Theme Mode, inner Categories) */
  --font-size-lg: 1.8rem;
  /* Large: Specific prominent titles */
  --font-size-xl: 2.2rem;
  /* Extra Large: Main Section headers (APPEARANCE) */
  --font-size-2xl: 3rem;
  /* Display: Hero titles */

  --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) 88%, var(--color-bg) 12%);
  --logo-border: color-mix(in srgb, var(--color-border) 70%, transparent);
  --logo-padding: 0;
  --logo-border-radius: 0;
  --logo-backdrop-blur: 0;

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

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

  /* ── Input Focus ── */
  --color-input-focus-glow: rgba(179, 138, 111, 0.14);
  --input-focus-pulse: input-focus-pulse 1.5s ease;

  /* ── Scrollbar ── */
  --color-scrollbar-thumb: rgba(90, 73, 59, 0.1);
  --color-scrollbar-track: rgba(255, 255, 255, 0.18);
  --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(190, 173, 154, 0.12);

  /* ── Navigation Lantern ── */
  --nav-active-glow: 0 0 12px 2px rgba(179, 138, 111, 0.14);
  --nav-active-border-color: #c19b80;

  /* ── Tooltip Glass ── */
  --tooltip-bg: rgba(255, 253, 250, 0.98);
  --tooltip-backdrop-blur: 16px;

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

  /* ── Drag Target ── */
  --color-drag-target-glow: rgba(179, 138, 111, 0.12);

  /* ── Skeleton ── */
  --skeleton-shimmer-color: #fbf7f2;

  /* ── Bird & Wisps (Sunrise-tuned) ── */
  --flora-petal-color: #e9b8c0;
  --flora-leaf-color: #a7bc8d;
  --bird-color: #5a493b;
  /* Indian Bulbul (Umber) */
  --bird-trail-color-1: #efd9c8;
  /* Saffron Mist */
  --bird-trail-color-2: #e8c3bf;
  /* Lotus Mist */
  --wisp-color: rgba(179, 138, 111, 0.7);
  /* Warm Sandstone Mist */
  --wisp-opacity: 0.06;
  --flora-opacity: 0.64;
  /* Nearly invisible but atmospheric */
  --wisp-count: 1;
  /* Minimalist */
  --flora-count: 3;
  /* Gentle lotus drift */
  --fireflies-enabled: 0;
  --firefly-background: radial-gradient(
    circle,
    rgba(255, 244, 228, 0.98) 0%,
    rgba(255, 176, 108, 0.9) 32%,
    rgba(255, 141, 74, 0.78) 58%,
    rgba(230, 142, 92, 0.32) 78%,
    transparent 100%
  );
  --firefly-box-shadow:
    0 0 10px rgba(255, 233, 197, 0.94), 0 0 22px rgba(255, 168, 88, 0.58),
    0 0 36px rgba(227, 145, 92, 0.3);

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

  /* ── Assistant ── */
  --assistant-orb-color-primary: #efc7ad;
  --assistant-orb-color-secondary: #e8c3bf;
  --assistant-orb-color-core: #fffaf5;
  --assistant-orb-glow-intensity: 0.58;
  --assistant-orb-size: 56px;
  --assistant-orb-size-mobile: 48px;
  --assistant-chat-bg: rgba(255, 253, 250, 0.94);
  --assistant-chat-bg-elevated: rgba(255, 250, 246, 0.96);
  --assistant-chat-border: rgba(193, 177, 160, 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: #ffffff;
  --assistant-bubble-assistant-bg: rgba(255, 249, 243, 0.88);
  --assistant-bubble-assistant-text: var(--color-text-primary);
  --assistant-voice-active-color: var(--color-danger);
}

/* ── Component Styles ── */

.btn-primary {
  background: linear-gradient(135deg, #d7b4a0 0%, #c79c80 42%, #b38a6f 100%);
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.42);
  box-shadow:
    0 10px 22px rgba(74, 63, 53, 0.18),
    0 4px 14px rgba(179, 138, 111, 0.16),
    inset 0 1px 1px rgba(255, 255, 255, 0.4);
  color: #ffffff !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, #dec0af 0%, #cfa589 42%, #bb9277 100%);
  box-shadow:
    0 12px 26px rgba(74, 63, 53, 0.2),
    0 6px 18px rgba(179, 138, 111, 0.22),
    inset 0 1px 1px rgba(255, 255, 255, 0.4);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 252, 248, 0.98);
  color: #5a493b !important;
  border: 1px solid rgba(193, 177, 160, 0.26);
  box-shadow:
    0 8px 18px rgba(74, 63, 53, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.btn-secondary:hover {
  background: #faf5ee;
  border-color: rgba(179, 138, 111, 0.22);
  color: #4a3f35 !important;
}

/* Specific override for ghost buttons in nyas-light to maintain visibility or white text as requested */
/* We target SVGs explicitly too because some components use Tailwind text color utilities on them */
.btn-primary svg,
.btn-secondary svg {
  color: #ffffff !important;
}

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

.btn-ghost {
  color: var(--color-text-primary) !important;
  background: rgba(179, 138, 111, 0.09);
}

.btn-ghost:hover {
  background: rgba(179, 138, 111, 0.16);
  color: var(--color-primary) !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(74, 63, 53, 0.02),
    0 1px 0 rgba(255, 255, 255, 0.72);
  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(74, 63, 53, 0.05);
  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 8px 2px var(--color-primary),
    0 0 20px 4px var(--color-primary-light);
  transition:
    width 0.4s ease,
    box-shadow 0.3s ease;
}

.nyas-logo {
  color: var(--color-logo);
  font-family: var(--font-family-heading);
  font-size: 26px;
  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 7.8s ease-in-out infinite;
  will-change: transform, box-shadow, text-shadow;
}

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

  22% {
    transform: scale(1.012);
    box-shadow:
      0 0 4px 1px color-mix(in srgb, var(--color-logo-shimmer) 14%, transparent),
      0 0 10px 3px color-mix(in srgb, var(--color-logo-shimmer) 8%, transparent);
    text-shadow: 0 0 3px color-mix(in srgb, var(--color-logo-shimmer) 16%, transparent);
  }

  42% {
    transform: scale(1.038);
    box-shadow:
      0 0 10px 3px color-mix(in srgb, var(--color-logo-shimmer) 28%, transparent),
      0 0 20px 7px color-mix(in srgb, var(--color-logo-shimmer) 14%, transparent);
    text-shadow: 0 0 6px color-mix(in srgb, var(--color-logo-shimmer) 28%, transparent);
  }

  54% {
    transform: scale(1.085);
    box-shadow:
      0 0 18px 5px color-mix(in srgb, var(--color-logo-shimmer) 48%, transparent),
      0 0 34px 12px color-mix(in srgb, var(--color-logo-shimmer) 26%, transparent);
    text-shadow: 0 0 10px color-mix(in srgb, var(--color-logo-shimmer) 42%, transparent);
  }

  64% {
    transform: scale(1.034);
    box-shadow:
      0 0 7px 2px color-mix(in srgb, var(--color-logo-shimmer) 20%, transparent),
      0 0 16px 5px color-mix(in srgb, var(--color-logo-shimmer) 10%, transparent);
    text-shadow: 0 0 4px color-mix(in srgb, var(--color-logo-shimmer) 18%, transparent);
  }

  74% {
    transform: scale(1.008);
    box-shadow:
      0 0 3px 1px color-mix(in srgb, var(--color-logo-shimmer) 10%, 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);
  }
}

/* ── Task Completion Sunrise Glow ── */
.task-done-sunrise {
  animation: sunrise-glow-animation 3s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  position: relative;
  z-index: 50;
  /* Ensure it pops over other elements while animating */
}

@keyframes sunrise-glow-animation {
  0% {
    box-shadow: 0 0 0 0 rgba(239, 217, 200, 0);
    border-color: var(--color-card-border);
    transform: scale(1);
  }

  15% {
    box-shadow:
      0 0 40px 15px rgba(245, 199, 141, 0.45),
      0 0 80px 30px rgba(239, 217, 200, 0.32);
    border-color: #f2c692;
    transform: scale(1.03);
  }

  30% {
    box-shadow:
      0 0 60px 20px rgba(215, 180, 160, 0.56),
      0 0 100px 40px rgba(242, 198, 146, 0.26);
    border-color: #d7b4a0;
  }

  50% {
    box-shadow:
      0 0 50px 15px rgba(179, 138, 111, 0.34),
      0 0 90px 35px rgba(239, 217, 200, 0.22);
    border-color: #b38a6f;
    transform: scale(1.01);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(179, 138, 111, 0);
    border-color: var(--color-card-border);
    transform: scale(1);
  }
}

/* Golden Sun Sparkles with White Core for Contrast */
.sparkle {
  position: absolute;
  width: 14px;
  /* Even larger */
  height: 14px;
  background: #ffffff;
  /* White core is critical for visibility on cards */
  border: 3px solid #f2c692;
  /* Soft sunrise gold border */
  border-radius: 50%;
  pointer-events: none;
  z-index: 999;
  /* Top level */
  box-shadow:
    0 0 20px 8px rgba(242, 198, 146, 0.95),
    0 0 40px 15px rgba(255, 255, 255, 1),
    0 0 60px 20px rgba(0, 0, 0, 0.1);
  /* Subtle dark shadow to pop on white */
  animation: golden-sparkle-twinkle 0.8s ease-in-out infinite alternate;
}

@keyframes golden-sparkle-twinkle {
  0% {
    transform: scale(0.5) rotate(0deg);
    opacity: 0.3;
  }

  100% {
    transform: scale(1.2) rotate(45deg);
    opacity: 1;
    box-shadow: 0 0 10px 4px rgba(242, 198, 146, 0.88);
  }
}

/* ── Targeted Scoped Fixes ── */

/* 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(90, 73, 59, 0.04) !important;
}

/* Ensure Board container itself has lighter scrollbar if it overflows horizontally */
.flex-1.flex.overflow-x-auto::-webkit-scrollbar-thumb {
  background: rgba(90, 73, 59, 0.04) !important;
}
