@import url('https://fonts.googleapis.com/css2?family=Inter:opsz,wght@14..32,300;14..32,400;14..32,500;14..32,600;14..32,700&family=JetBrains+Mono:wght@400;500&display=swap');
@import "tailwindcss";

/* ── Tailwind 4 Theme ── */
@theme {
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --radius-xl: 16px;
  --radius-lg: 12px;
  --radius-md: 8px;

  /* ── Semantic colors — static dark-mode defaults (overridden in .light) ── */
  --color-background: hsl(225 30% 5%);
  --color-foreground: hsl(210 40% 96%);
  --color-card: hsl(225 25% 8%);
  --color-card-foreground: hsl(210 40% 96%);
  --color-primary: hsl(234 85% 65%);
  --color-primary-foreground: hsl(0 0% 100%);
  --color-secondary: hsl(225 20% 12%);
  --color-secondary-foreground: hsl(210 40% 96%);
  --color-muted: hsl(225 18% 11%);
  --color-muted-foreground: hsl(220 10% 50%);
  --color-accent: hsl(225 18% 14%);
  --color-accent-foreground: hsl(210 40% 96%);
  --color-destructive: hsl(0 84% 62%);
  --color-destructive-foreground: hsl(0 0% 100%);
  --color-success: hsl(160 84% 44%);
  --color-success-foreground: hsl(0 0% 100%);
  --color-warning: hsl(36 100% 55%);
  --color-warning-foreground: hsl(0 0% 0%);
  --color-violet: hsl(262 83% 65%);
  --color-violet-foreground: hsl(0 0% 100%);
  --color-border: hsl(225 16% 14%);
  --color-input: hsl(225 16% 14%);
  --color-ring: hsl(234 85% 65%);
  --color-sidebar-background: hsl(225 35% 4%);
  --color-sidebar-foreground: hsl(220 10% 48%);
  --color-sidebar-primary: hsl(234 85% 65%);
  --color-sidebar-accent: hsl(225 22% 9%);
}

/* ── CSS Variables (dark default, light override) ── */
:root {
  --background: 225 30% 5%;
  --foreground: 210 40% 96%;
  --card: 225 25% 8%;
  --card-foreground: 210 40% 96%;
  --popover: 225 25% 8%;
  --popover-foreground: 210 40% 96%;
  --primary: 234 85% 65%;
  --primary-foreground: 0 0% 100%;
  --secondary: 225 20% 12%;
  --secondary-foreground: 210 40% 96%;
  --muted: 225 18% 11%;
  --muted-foreground: 220 10% 50%;
  --accent: 225 18% 14%;
  --accent-foreground: 210 40% 96%;
  --destructive: 0 84% 62%;
  --destructive-foreground: 0 0% 100%;
  --success: 160 84% 44%;
  --success-foreground: 0 0% 100%;
  --warning: 36 100% 55%;
  --warning-foreground: 0 0% 0%;
  --violet: 262 83% 65%;
  --violet-foreground: 0 0% 100%;
  --border: 225 16% 14%;
  --input: 225 16% 14%;
  --ring: 234 85% 65%;
  --chart-1: 234 85% 65%;
  --chart-2: 160 84% 44%;
  --chart-3: 0 84% 62%;
  --chart-4: 36 100% 55%;
  --chart-5: 262 83% 65%;
  --sidebar-background: 225 35% 4%;
  --sidebar-foreground: 220 10% 48%;
  --sidebar-primary: 234 85% 65%;
  --sidebar-primary-foreground: 0 0% 100%;
  --sidebar-accent: 225 22% 9%;
  --sidebar-accent-foreground: 210 40% 96%;
  --sidebar-border: 225 18% 10%;
  color-scheme: dark;
}

.light {
  --background: 220 16% 96%;
  --foreground: 220 20% 10%;
  --card: 0 0% 100%;
  --card-foreground: 220 20% 10%;
  --popover: 0 0% 100%;
  --popover-foreground: 220 20% 10%;
  --primary: 234 85% 60%;
  --primary-foreground: 0 0% 100%;
  --secondary: 220 14% 92%;
  --secondary-foreground: 220 20% 10%;
  --muted: 220 12% 93%;
  --muted-foreground: 220 8% 46%;
  --accent: 220 14% 90%;
  --accent-foreground: 220 20% 10%;
  --destructive: 0 84% 60%;
  --destructive-foreground: 0 0% 100%;
  --success: 160 84% 39%;
  --success-foreground: 0 0% 100%;
  --warning: 36 100% 50%;
  --warning-foreground: 0 0% 0%;
  --violet: 262 83% 58%;
  --violet-foreground: 0 0% 100%;
  --border: 220 13% 90%;
  --input: 220 13% 90%;
  --ring: 234 85% 60%;
  --chart-1: 234 85% 60%;
  --chart-2: 160 84% 39%;
  --chart-3: 0 84% 60%;
  --chart-4: 36 100% 50%;
  --chart-5: 262 83% 58%;
  --sidebar-background: 225 25% 10%;
  --sidebar-foreground: 220 10% 55%;
  --sidebar-primary: 234 85% 60%;
  --sidebar-primary-foreground: 0 0% 100%;
  --sidebar-accent: 225 18% 16%;
  --sidebar-accent-foreground: 0 0% 95%;
  --sidebar-border: 225 14% 18%;
  color-scheme: light;

  /* Override Tailwind color tokens for light mode */
  --color-background: hsl(220 16% 96%);
  --color-foreground: hsl(220 20% 10%);
  --color-card: hsl(0 0% 100%);
  --color-card-foreground: hsl(220 20% 10%);
  --color-primary: hsl(234 85% 60%);
  --color-primary-foreground: hsl(0 0% 100%);
  --color-secondary: hsl(220 14% 92%);
  --color-secondary-foreground: hsl(220 20% 10%);
  --color-muted: hsl(220 12% 93%);
  --color-muted-foreground: hsl(220 8% 46%);
  --color-accent: hsl(220 14% 90%);
  --color-accent-foreground: hsl(220 20% 10%);
  --color-destructive: hsl(0 84% 60%);
  --color-destructive-foreground: hsl(0 0% 100%);
  --color-success: hsl(160 84% 39%);
  --color-success-foreground: hsl(0 0% 100%);
  --color-warning: hsl(36 100% 50%);
  --color-warning-foreground: hsl(0 0% 0%);
  --color-violet: hsl(262 83% 58%);
  --color-violet-foreground: hsl(0 0% 100%);
  --color-border: hsl(220 13% 90%);
  --color-input: hsl(220 13% 90%);
  --color-ring: hsl(234 85% 60%);
  --color-sidebar-background: hsl(225 25% 10%);
  --color-sidebar-foreground: hsl(220 10% 55%);
  --color-sidebar-primary: hsl(234 85% 60%);
  --color-sidebar-accent: hsl(225 18% 16%);
}

/* ── Base ── */
* {
  border-color: hsl(var(--border));
}
body {
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Apple-style Glass Surfaces ── */
.glass {
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(40px) saturate(1.8);
  -webkit-backdrop-filter: blur(40px) saturate(1.8);
  border: 0.5px solid rgba(255, 255, 255, 0.06);
  box-shadow:
    0 0 0 0.5px rgba(255, 255, 255, 0.03),
    0 2px 8px -2px rgba(0, 0, 0, 0.3),
    0 8px 32px -8px rgba(0, 0, 0, 0.25);
}
.light .glass {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow:
    0 0 0 0.5px rgba(0, 0, 0, 0.03),
    0 2px 8px -2px rgba(0, 0, 0, 0.06),
    0 8px 32px -8px rgba(0, 0, 0, 0.04);
}

.glass-card {
  padding: 1.25rem;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(40px) saturate(1.8);
  -webkit-backdrop-filter: blur(40px) saturate(1.8);
  border: 0.5px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  box-shadow:
    0 0 0 0.5px rgba(255, 255, 255, 0.02),
    0 1px 2px rgba(0, 0, 0, 0.2),
    0 4px 16px -2px rgba(0, 0, 0, 0.3);
  transition: box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              border-color 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.light .glass-card {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(255, 255, 255, 0.6);
  box-shadow:
    0 0 0 0.5px rgba(0, 0, 0, 0.04),
    0 1px 2px rgba(0, 0, 0, 0.03),
    0 4px 16px -2px rgba(0, 0, 0, 0.05);
}
.glass-card:hover {
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow:
    0 0 0 0.5px rgba(255, 255, 255, 0.04),
    0 4px 12px -2px rgba(0, 0, 0, 0.4),
    0 12px 40px -8px rgba(0, 0, 0, 0.35);
}
.light .glass-card:hover {
  box-shadow:
    0 0 0 0.5px rgba(0, 0, 0, 0.06),
    0 4px 12px -2px rgba(0, 0, 0, 0.08),
    0 12px 40px -8px rgba(0, 0, 0, 0.06);
}
@media (min-width: 640px) {
  .glass-card { padding: 1.5rem; }
}

/* Custom select arrow */
.form-select {
  appearance: none;
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
}

.glass-sidebar {
  background: linear-gradient(180deg, hsl(225 35% 4%), hsl(225 35% 2.5%));
  border-right: 0.5px solid rgba(255, 255, 255, 0.03);
}
.light .glass-sidebar {
  background: linear-gradient(180deg, hsl(225 25% 10%), hsl(225 30% 7%));
  border-right-color: rgba(255, 255, 255, 0.05);
}

.glass-topbar {
  background: rgba(10, 12, 22, 0.72);
  backdrop-filter: blur(40px) saturate(1.8);
  -webkit-backdrop-filter: blur(40px) saturate(1.8);
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.04);
}
.light .glass-topbar {
  background: rgba(255, 255, 255, 0.72);
  border-bottom-color: rgba(0, 0, 0, 0.06);
}

.glass-inset {
  background: rgba(255, 255, 255, 0.015);
  border-radius: 12px;
  border: 0.5px solid rgba(255, 255, 255, 0.03);
}
.light .glass-inset {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.04);
}

/* ── Mesh background ── */
.mesh-gradient {
  background:
    radial-gradient(ellipse 80% 50% at 20% 30%, hsla(234, 85%, 60%, 0.06), transparent),
    radial-gradient(ellipse 60% 40% at 75% 65%, hsla(262, 83%, 58%, 0.04), transparent),
    radial-gradient(ellipse 50% 50% at 50% 100%, hsla(160, 84%, 39%, 0.03), transparent);
}
.light .mesh-gradient {
  background:
    radial-gradient(ellipse 80% 50% at 20% 30%, hsla(234, 85%, 60%, 0.04), transparent),
    radial-gradient(ellipse 60% 40% at 75% 65%, hsla(262, 83%, 58%, 0.03), transparent),
    radial-gradient(ellipse 50% 50% at 50% 100%, hsla(160, 84%, 39%, 0.02), transparent);
}

/* ── Status glow ── */
.glow-success { box-shadow: 0 0 24px -6px hsla(160, 84%, 39%, 0.2); }
.glow-destructive { box-shadow: 0 0 24px -6px hsla(0, 84%, 60%, 0.2); }
.glow-primary { box-shadow: 0 0 24px -6px hsla(234, 85%, 60%, 0.2); }
.glow-warning { box-shadow: 0 0 24px -6px hsla(36, 100%, 50%, 0.2); }

/* ── Live pulse dot ── */
.pulse-dot {
  position: relative;
}
.pulse-dot::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: inherit;
  opacity: 0;
  animation: pulse-ring 2.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
@keyframes pulse-ring {
  0% { transform: scale(1); opacity: 0.35; }
  100% { transform: scale(2.8); opacity: 0; }
}

.tabular-nums {
  font-variant-numeric: tabular-nums;
}

/* ── Aurora CTA ── */
.aurora-gradient {
  background: linear-gradient(135deg, hsl(234, 85%, 60%), hsl(262, 83%, 58%), hsl(234, 85%, 60%));
  background-size: 200% 200%;
}
.aurora-animate {
  animation: aurora-shift 5s ease infinite;
}
@keyframes aurora-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
.shimmer {
  position: relative;
  overflow: hidden;
}
.shimmer::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 30%, rgba(255,255,255,0.12) 50%, transparent 70%);
  transform: translateX(-100%);
  animation: shimmer-slide 4s ease infinite;
}
@keyframes shimmer-slide {
  100% { transform: translateX(100%); }
}

/* ── Gradient border badge ── */
.gradient-border-badge {
  position: relative;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
}
.gradient-border-badge::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 14px;
  padding: 0.5px;
  background: linear-gradient(135deg, hsl(234, 85%, 60%), hsl(262, 83%, 58%));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

/* ── Form inputs ── */
.form-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.015);
  border: 0.5px solid rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: hsl(var(--foreground));
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-input::placeholder {
  color: hsl(var(--muted-foreground) / 0.5);
}
.form-input:focus {
  border-color: hsl(var(--primary) / 0.5);
  box-shadow: 0 0 0 2px hsl(var(--primary) / 0.1);
}
.light .form-input {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.08);
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.05); border-radius: 99px; }
.light ::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.06); }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.1); }
.light ::-webkit-scrollbar-thumb:hover { background: rgba(0, 0, 0, 0.12); }

/* ── Fade-in animation ── */
@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-fade-in-up {
  animation: fade-in-up 0.4s ease-out both;
}
