@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
  :root {
    --background: 224 71% 4%;
    --foreground: 213 31% 91%;
    --card: 222 47% 6%;
    --card-foreground: 213 31% 91%;
    --popover: 222 47% 6%;
    --popover-foreground: 213 31% 91%;
    --primary: 263 70% 50%;
    --primary-foreground: 210 40% 98%;
    --secondary: 222 47% 11%;
    --secondary-foreground: 210 40% 98%;
    --muted: 223 47% 11%;
    --muted-foreground: 215.4 16.3% 56.9%;
    --accent: 216 34% 17%;
    --accent-foreground: 210 40% 98%;
    --destructive: 0 63% 31%;
    --destructive-foreground: 210 40% 98%;
    --border: 216 34% 17%;
    --input: 216 34% 17%;
    --ring: 263 70% 50%;
    --radius: 0.75rem;

    /* ── Gold tokens ───────────────────────── */
    --gold-dim:    rgba(180, 130, 30, 0.18);
    --gold-mid:    rgba(212, 175, 55, 0.55);
    --gold-bright: rgba(240, 192, 60, 0.85);
    --gold-glow:   rgba(212, 175, 55, 0.12);
  }
}

@layer base {
  * {
    @apply border-border;
  }
  body {
    @apply bg-background text-foreground;
    font-feature-settings: "rlig" 1, "calt" 1;
  }
}

/* ────────────────────────────────────────────────────────────
   GOLD SEPARATOR SYSTEM
   Use CSS pseudo-elements / border-image for crisp lines.
   border-image works on straight edges (no border-radius).
   For curved cards use the .gold-card helper below.
──────────────────────────────────────────────────────────── */

/* Horizontal gold divider — apply to any HR or div */
.gold-hr {
  border: none;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--gold-dim) 15%,
    var(--gold-mid) 40%,
    var(--gold-bright) 50%,
    var(--gold-mid) 60%,
    var(--gold-dim) 85%,
    transparent 100%
  );
}

/* Vertical gold right-border (for sidebars) */
.gold-border-r {
  border-right: 1px solid transparent;
  border-image: linear-gradient(
    180deg,
    transparent 0%,
    var(--gold-dim) 10%,
    var(--gold-mid) 30%,
    var(--gold-bright) 50%,
    var(--gold-mid) 70%,
    var(--gold-dim) 90%,
    transparent 100%
  ) 1;
}

/* Horizontal gold bottom-border (for headers) */
.gold-border-b {
  border-bottom: 1px solid transparent;
  border-image: linear-gradient(
    90deg,
    transparent 0%,
    var(--gold-dim) 8%,
    var(--gold-mid) 30%,
    var(--gold-bright) 50%,
    var(--gold-mid) 70%,
    var(--gold-dim) 92%,
    transparent 100%
  ) 1;
}

/* Horizontal gold top-border (for bottom bars) */
.gold-border-t {
  border-top: 1px solid transparent;
  border-image: linear-gradient(
    90deg,
    transparent 0%,
    var(--gold-dim) 8%,
    var(--gold-mid) 30%,
    var(--gold-bright) 50%,
    var(--gold-mid) 70%,
    var(--gold-dim) 92%,
    transparent 100%
  ) 1;
}

/* Subtle inner divider — dimmer for in-card use */
.gold-hr-soft {
  border: none;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--gold-dim) 20%,
    rgba(212, 175, 55, 0.3) 50%,
    var(--gold-dim) 80%,
    transparent 100%
  );
}

/* Card with full gold perimeter border (supports border-radius) */
.gold-card {
  background: linear-gradient(hsl(var(--card)), hsl(var(--card))) padding-box,
    linear-gradient(
      135deg,
      transparent 0%,
      rgba(180, 130, 30, 0.25) 20%,
      rgba(212, 175, 55, 0.6) 50%,
      rgba(180, 130, 30, 0.25) 80%,
      transparent 100%
    ) border-box;
  border: 1px solid transparent;
}

/* Gold glow for interactive elements */
.gold-glow {
  box-shadow: 0 0 18px var(--gold-glow), 0 0 6px rgba(212,175,55,0.08);
}

/* ────────────────────────────────────────────────────────────
   EXISTING UTILITIES (kept + improved)
──────────────────────────────────────────────────────────── */
@layer utilities {
  .gradient-text {
    @apply bg-gradient-to-r from-purple-400 via-cyan-400 to-pink-400 bg-clip-text text-transparent;
  }

  /* Legacy gradient-border — purple theme for generator cards */
  .gradient-border {
    background: linear-gradient(hsl(var(--card)), hsl(var(--card))) padding-box,
      linear-gradient(135deg, #7c3aed, #06b6d4, #ec4899) border-box;
    border: 1px solid transparent;
  }

  /* glass-card — now with gold-tinted border */
  .glass-card {
    @apply bg-white/[0.04] backdrop-blur-sm;
    background-image: linear-gradient(hsl(var(--card) / 0.6), hsl(var(--card) / 0.6));
    border: 1px solid rgba(212, 175, 55, 0.14);
  }

  .glow-purple {
    box-shadow: 0 0 20px rgba(124, 58, 237, 0.3);
  }

  .glow-cyan {
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.3);
  }

  /* Sidebar section label shimmer */
  .gold-label {
    background: linear-gradient(90deg, #a07820, #d4af37, #a07820);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 600;
    letter-spacing: 0.07em;
  }

  .scrollbar-thin {
    scrollbar-width: thin;
    scrollbar-color: rgba(212, 175, 55, 0.15) transparent;
  }

  .scrollbar-thin::-webkit-scrollbar {
    width: 3px;
    height: 3px;
  }

  .scrollbar-thin::-webkit-scrollbar-track {
    background: transparent;
  }

  .scrollbar-thin::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, transparent, rgba(212,175,55,0.35), transparent);
    border-radius: 2px;
  }
}

/* ────────────────────────────────────────────────────────────
   SIDEBAR ACTIVE INDICATOR
   Thin gold left-accent bar for active nav items
──────────────────────────────────────────────────────────── */
.nav-active-indicator {
  position: relative;
}
.nav-active-indicator::before {
  content: "";
  position: absolute;
  left: 0;
  top: 15%;
  height: 70%;
  width: 2px;
  border-radius: 0 2px 2px 0;
  background: linear-gradient(
    180deg,
    transparent,
    var(--gold-bright),
    transparent
  );
}

/* ────────────────────────────────────────────────────────────
   ANIMATIONS
──────────────────────────────────────────────────────────── */
@keyframes gold-shimmer {
  0%   { background-position: -200% center; }
  100% { background-position:  200% center; }
}

.gold-shimmer-text {
  background: linear-gradient(
    90deg,
    #8c6d1f 0%,
    #d4af37 30%,
    #f5e27d 50%,
    #d4af37 70%,
    #8c6d1f 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gold-shimmer 4s linear infinite;
}
