/* ═══════════════════════════════════════════════════════════════
   AGENTIC OS — DESIGN TOKENS & GLOBAL STYLES
   Futuristic • Glassmorphism • Neon Glow
   ═══════════════════════════════════════════════════════════════ */

/* ─── GOOGLE FONTS IMPORT ─── */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=Inter:wght@300;400;500;600;700;800&family=Fira+Code:wght@400;500;600;700&display=swap');

/* ─── DESIGN TOKENS ─── */
:root {
  /* Core Palette */
  --bg-void: #030712;
  --bg-surface: rgba(15, 23, 42, 0.6);
  --bg-elevated: rgba(30, 41, 59, 0.4);
  --bg-glass: rgba(15, 23, 42, 0.5);
  
  /* Neon Spectrum */
  --neon-cyan: #06d6a0;
  --neon-blue: #3b82f6;
  --neon-violet: #8b5cf6;
  --neon-fuchsia: #d946ef;
  --neon-rose: #f43f5e;
  --neon-amber: #f59e0b;
  --neon-emerald: #10b981;
  
  /* Glow Effects */
  --glow-cyan: 0 0 20px rgba(6, 214, 160, 0.3), 0 0 60px rgba(6, 214, 160, 0.1);
  --glow-blue: 0 0 20px rgba(59, 130, 246, 0.3), 0 0 60px rgba(59, 130, 246, 0.1);
  --glow-violet: 0 0 20px rgba(139, 92, 246, 0.3), 0 0 60px rgba(139, 92, 246, 0.1);
  --glow-fuchsia: 0 0 20px rgba(217, 70, 239, 0.3), 0 0 60px rgba(217, 70, 239, 0.1);
  
  /* Borders */
  --border-subtle: rgba(148, 163, 184, 0.08);
  --border-glow: rgba(6, 214, 160, 0.2);
  --border-active: rgba(59, 130, 246, 0.4);
  
  /* Typography */
  --font-display: 'Outfit', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'Fira Code', 'JetBrains Mono', monospace;
  
  /* Text Colors */
  --text-main: #f8fafc;
  --text-muted: rgba(148, 163, 184, 0.7);
  --text-dim: rgba(148, 163, 184, 0.4);
  
  /* Spacing */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  
  /* Transitions */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ─── GLOBAL RESETS ─── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-body);
  color: var(--text-main);
  background-color: var(--bg-void);
  user-select: none;
}

/* ─── ANIMATED BACKGROUND ─── */
.bg-mesh {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.bg-mesh::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: 
    radial-gradient(ellipse 600px 600px at 20% 30%, rgba(6, 214, 160, 0.08) 0%, transparent 70%),
    radial-gradient(ellipse 500px 500px at 80% 70%, rgba(139, 92, 246, 0.08) 0%, transparent 70%),
    radial-gradient(ellipse 400px 400px at 60% 20%, rgba(59, 130, 246, 0.06) 0%, transparent 70%);
  animation: meshFloat 20s ease-in-out infinite;
}

.bg-mesh::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
  opacity: 0.5;
}

@keyframes meshFloat {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(2%, -2%) rotate(1deg); }
  66% { transform: translate(-1%, 1%) rotate(-0.5deg); }
}

/* ─── GRID OVERLAY ─── */
.grid-overlay {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: 
    linear-gradient(rgba(148, 163, 184, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 50%, black, transparent);
}

/* ─── GLASS PANELS ─── */
.glass-panel {
  background: var(--bg-glass);
  backdrop-filter: blur(20px) saturate(1.3);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
}

.glass-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

.glass-panel-glow {
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3), var(--glow-cyan);
}

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

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

::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.15);
  border-radius: 100px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.25);
}

/* ─── BUTTONS & INPUTS ─── */
button {
  background: none;
  border: none;
  color: inherit;
  font-family: inherit;
  cursor: pointer;
  outline: none;
}

input, select, textarea {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: inherit;
  padding: 8px 12px;
  outline: none;
  transition: all 0.2s ease;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--neon-blue);
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.25);
  background: rgba(255, 255, 255, 0.06);
}

/* ─── UTILITY CLASSES ─── */
.text-gradient {
  background: linear-gradient(135deg, #f8fafc, rgba(148, 163, 184, 0.6));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-gradient-neon {
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.neon-border {
  border: 1px solid var(--border-glow);
  box-shadow: var(--glow-cyan);
}

.neon-border-violet {
  border: 1px solid rgba(139, 92, 246, 0.3);
  box-shadow: var(--glow-violet);
}

/* ─── ANIMATIONS ─── */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

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

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

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

.animate-fade-in { animation: fadeIn 0.5s var(--ease-out-expo); }
.animate-slide-up { animation: slideUp 0.5s var(--ease-out-expo); }
.animate-scale-in { animation: scaleIn 0.5s var(--ease-out-expo); }

/* ─── WELCOME WIDGET ─── */
#welcome-widget {
  position: absolute;
  top: 80px;
  right: 24px;
  width: 340px;
  padding: 20px;
  z-index: 10;
  animation: slideUp 0.5s var(--ease-out-expo);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

#welcome-widget.fade-out {
  opacity: 0;
  transform: translateY(-20px);
  pointer-events: none;
}

.widget-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.widget-header h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  background: linear-gradient(90deg, var(--neon-cyan), var(--neon-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.btn-close-widget {
  font-size: 1.25rem;
  color: var(--text-muted);
  transition: color 0.2s;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
}

.btn-close-widget:hover {
  color: var(--neon-rose);
  background: rgba(244, 63, 94, 0.1);
}

#welcome-widget p {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.quick-stats {
  display: flex;
  gap: 12px;
}

.stat-item {
  flex: 1;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px;
  text-align: center;
  transition: all 0.2s ease;
}

.stat-item:hover {
  border-color: var(--border-glow);
  background: rgba(6, 214, 160, 0.03);
}

.stat-value {
  display: block;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--neon-cyan);
}

.stat-label {
  display: block;
  font-size: 0.65rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
  font-weight: 600;
}
