/* ============================================================
   THE CLOSING CODE AI — Design System
   Stark-Blue Glassmorphism | v1.0
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700&display=swap');

/* ── CSS Custom Properties ─────────────────────────────── */
:root {
  /* Colors — Dark Mode (default) */
  --color-void: #060610;
  --color-deep: #0A0A1F;
  --color-primary: #0066FF;
  --color-primary-dark: #0040CC;
  --color-primary-light: #3388FF;
  --color-accent: #00D4FF;
  --color-gold: #FFB800;
  --color-gold-dark: #CC9200;
  --color-white: #FFFFFF;
  --color-mist: #B0C4D8;
  --color-fog: #6B8299;
  --color-ghost: #2A3A4A;
  --color-success: #00D084;
  --color-warning: #FFB800;
  --color-error: #FF3860;
  --color-info: #00D4FF;

  /* Typography */
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Spacing */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-xl: 32px;
  --radius-full: 100px;

  /* Shadows */
  --shadow-glass: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-elevated: 0 16px 64px rgba(0, 0, 0, 0.5);
  --glow-blue: 0 0 30px rgba(0, 102, 255, 0.40);
  --glow-cyan: 0 0 20px rgba(0, 212, 255, 0.30);
  --glow-gold: 0 0 20px rgba(255, 184, 0, 0.25);

  /* Layout */
  --sidebar-width: 260px;
  --navbar-height: 64px;
  --content-max-width: 1400px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset & Base ──────────────────────────────────────── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  color: var(--color-white);
  background: var(--color-void);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Hero gradient bg */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(0,102,255,0.12) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(0,212,255,0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 100%, rgba(0,64,204,0.08) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* Grid texture overlay */
body::after {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image:
    linear-gradient(rgba(0,212,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,212,255,0.025) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}

a { color: var(--color-primary-light); text-decoration: none; }
a:hover { color: var(--color-accent); }

img { max-width: 100%; display: block; }

::selection {
  background: rgba(0, 102, 255, 0.40);
  color: var(--color-white);
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--color-void); }
::-webkit-scrollbar-thumb {
  background: rgba(0, 212, 255, 0.20);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(0, 212, 255, 0.35); }

/* ── Typography ────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-white);
}

.text-display { font-size: clamp(40px, 6vw, 80px); font-weight: 700; }
h1, .text-h1 { font-size: clamp(32px, 4vw, 48px); }
h2, .text-h2 { font-size: clamp(24px, 3vw, 36px); font-weight: 600; }
h3, .text-h3 { font-size: clamp(18px, 2vw, 24px); font-weight: 600; }
.text-body-lg { font-size: 18px; }
.text-body { font-size: 16px; }
.text-sm { font-size: 14px; }
.text-xs { font-size: 12px; }
.text-metric {
  font-family: var(--font-mono);
  font-size: clamp(36px, 5vw, 72px);
  font-weight: 700;
}
.text-code {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
}

.text-mist { color: var(--color-mist); }
.text-fog { color: var(--color-fog); }
.text-accent { color: var(--color-accent); }
.text-gold { color: var(--color-gold); }
.text-success { color: var(--color-success); }
.text-error { color: var(--color-error); }

.gradient-text {
  background: linear-gradient(135deg, #FFFFFF 0%, #00D4FF 50%, #0066FF 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.font-mono { font-family: var(--font-mono); }

/* ── Glassmorphism Classes ─────────────────────────────── */
.glass-card {
  background: rgba(0, 102, 255, 0.06);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(0, 212, 255, 0.12);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-glass), inset 0 1px 0 rgba(255,255,255,0.05);
  position: relative;
  z-index: 1;
  transition: border-color var(--transition-base), box-shadow var(--transition-base), transform var(--transition-base);
}

.glass-card:hover {
  border-color: rgba(0, 212, 255, 0.25);
  box-shadow: var(--shadow-glass), var(--glow-cyan), inset 0 1px 0 rgba(255,255,255,0.08);
  transform: translateY(-2px);
}

.glass-card-premium {
  background: rgba(0, 102, 255, 0.10);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid rgba(0, 212, 255, 0.25);
  border-radius: var(--radius-lg);
  box-shadow: 0 0 40px rgba(0,102,255,0.15), var(--shadow-elevated), inset 0 1px 0 rgba(255,255,255,0.08);
  position: relative;
  z-index: 1;
}

.glass-card-featured {
  background: rgba(0, 102, 255, 0.12);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid rgba(255, 184, 0, 0.40);
  border-radius: var(--radius-lg);
  box-shadow: 0 0 60px rgba(255,184,0,0.10), 0 0 30px rgba(0,102,255,0.20), var(--shadow-elevated);
  position: relative;
  z-index: 1;
}

.glass-nav {
  background: rgba(6, 6, 16, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0, 212, 255, 0.08);
}

.glass-sidebar {
  background: rgba(6, 6, 16, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid rgba(0, 212, 255, 0.06);
}

.glass-input {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(0, 212, 255, 0.15);
  border-radius: 10px;
  color: var(--color-white);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 10px 16px;
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  width: 100%;
}

.glass-input:focus {
  border-color: rgba(0, 102, 255, 0.60);
  box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.15);
}

.glass-input::placeholder { color: var(--color-fog); }

/* ── Buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  border: none;
  transition: all var(--transition-base);
  position: relative;
  z-index: 1;
  letter-spacing: 0.01em;
}

.btn-primary {
  background: linear-gradient(135deg, #0066FF 0%, #0040CC 100%);
  color: var(--color-white);
  border: 1px solid rgba(0, 212, 255, 0.30);
  box-shadow: 0 0 20px rgba(0,102,255,0.30), 0 4px 15px rgba(0,0,0,0.30);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #3388FF 0%, #0066FF 100%);
  box-shadow: 0 0 30px rgba(0,102,255,0.50), 0 6px 20px rgba(0,0,0,0.30);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(0, 102, 255, 0.08);
  color: var(--color-primary-light);
  border: 1px solid rgba(0, 102, 255, 0.25);
}

.btn-secondary:hover {
  background: rgba(0, 102, 255, 0.15);
  border-color: rgba(0, 212, 255, 0.40);
}

.btn-ghost {
  background: transparent;
  color: var(--color-mist);
  border: 1px solid transparent;
}

.btn-ghost:hover {
  background: rgba(255,255,255,0.04);
  color: var(--color-white);
}

.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-lg { padding: 16px 32px; font-size: 16px; }

/* ── Badges ────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.badge-primary {
  background: rgba(0, 102, 255, 0.10);
  border: 1px solid rgba(0, 212, 255, 0.20);
  color: var(--color-accent);
}

.badge-success {
  background: rgba(0, 208, 132, 0.10);
  border: 1px solid rgba(0, 208, 132, 0.25);
  color: var(--color-success);
}

.badge-warning {
  background: rgba(255, 184, 0, 0.10);
  border: 1px solid rgba(255, 184, 0, 0.25);
  color: var(--color-gold);
}

.badge-error {
  background: rgba(255, 56, 96, 0.10);
  border: 1px solid rgba(255, 56, 96, 0.25);
  color: var(--color-error);
}

.badge-gold {
  background: rgba(255, 184, 0, 0.12);
  border: 1px solid rgba(255, 184, 0, 0.35);
  color: var(--color-gold);
}

/* ── Section Divider ───────────────────────────────────── */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,212,255,0.20), transparent);
  border: none;
  margin: 32px 0;
}

/* ── Layout Utilities ──────────────────────────────────── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.gap-32 { gap: 32px; }

.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.w-full { width: 100%; }
.relative { position: relative; }

.p-16 { padding: 16px; }
.p-20 { padding: 20px; }
.p-24 { padding: 24px; }
.p-32 { padding: 32px; }

.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.mb-48 { margin-bottom: 48px; }

.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }

.text-center { text-align: center; }
.text-right { text-align: right; }

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Glow Effects ──────────────────────────────────────── */
.glow-blue { box-shadow: 0 0 30px rgba(0,102,255,0.40), 0 0 60px rgba(0,102,255,0.15); }
.glow-cyan { box-shadow: 0 0 20px rgba(0,212,255,0.30), 0 0 40px rgba(0,212,255,0.10); }
.glow-gold { box-shadow: 0 0 20px rgba(255,184,0,0.25), 0 0 40px rgba(255,184,0,0.10); }

/* ── Animations ────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 20px rgba(0,102,255,0.30); }
  50% { box-shadow: 0 0 40px rgba(0,102,255,0.50); }
}

@keyframes countUp {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.animate-in { animation: fadeIn 0.4s ease forwards; }
.animate-up { animation: fadeInUp 0.5s ease forwards; }
.animate-slide { animation: slideInLeft 0.4s ease forwards; }
.animate-float { animation: float 4s ease-in-out infinite; }

/* Stagger children */
.stagger > * { opacity: 0; animation: fadeInUp 0.4s ease forwards; }
.stagger > *:nth-child(1) { animation-delay: 0.05s; }
.stagger > *:nth-child(2) { animation-delay: 0.10s; }
.stagger > *:nth-child(3) { animation-delay: 0.15s; }
.stagger > *:nth-child(4) { animation-delay: 0.20s; }
.stagger > *:nth-child(5) { animation-delay: 0.25s; }
.stagger > *:nth-child(6) { animation-delay: 0.30s; }
.stagger > *:nth-child(7) { animation-delay: 0.35s; }
.stagger > *:nth-child(8) { animation-delay: 0.40s; }
.stagger > *:nth-child(9) { animation-delay: 0.45s; }
.stagger > *:nth-child(10) { animation-delay: 0.50s; }

/* Loading skeleton */
.skeleton {
  background: linear-gradient(90deg, rgba(0,212,255,0.05) 25%, rgba(0,212,255,0.10) 50%, rgba(0,212,255,0.05) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 1200px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  :root { --sidebar-width: 0px; }
}
