/* Modern CSS with Light & Dark Mode Architecture */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

/* Light Theme Variables */
html:not(.dark) {
  --bg-app: #f8fafc;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-card-subtle: rgba(241, 245, 249, 0.7);
  --border-card: rgba(226, 232, 240, 0.8);
  --border-subtle: rgba(203, 213, 225, 0.5);
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;
  --shadow-card: 0 10px 30px -5px rgba(15, 23, 42, 0.06), 0 4px 6px -2px rgba(15, 23, 42, 0.03);
  --shadow-hover: 0 20px 40px -10px rgba(99, 102, 241, 0.15), 0 8px 16px -4px rgba(15, 23, 42, 0.04);
  --glass-nav: rgba(255, 255, 255, 0.85);
  --input-bg: #ffffff;
  --input-border: #cbd5e1;
  --pill-bg: #f1f5f9;
}

/* Dark Theme Variables */
html.dark {
  --bg-app: #080c14;
  --bg-card: rgba(15, 23, 42, 0.75);
  --bg-card-subtle: rgba(30, 41, 59, 0.5);
  --border-card: rgba(255, 255, 255, 0.08);
  --border-subtle: rgba(255, 255, 255, 0.05);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;
  --shadow-card: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 1px 1px rgba(255, 255, 255, 0.05);
  --shadow-hover: 0 25px 50px -10px rgba(99, 102, 241, 0.3), 0 0 1px 1px rgba(99, 102, 241, 0.4);
  --glass-nav: rgba(15, 23, 42, 0.8);
  --input-bg: rgba(15, 23, 42, 0.9);
  --input-border: rgba(255, 255, 255, 0.12);
  --pill-bg: rgba(30, 41, 59, 0.6);
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-main);
  min-height: 100vh;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
  position: relative;
}

/* Ambient dynamic background glowing meshes */
.bg-ambient-light {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

html:not(.dark) .bg-ambient-light::before {
  content: '';
  position: absolute;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 600px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.12) 0%, rgba(236, 72, 153, 0.08) 40%, transparent 70%);
  filter: blur(80px);
}

html.dark .bg-ambient-light::before {
  content: '';
  position: absolute;
  top: -15%;
  left: 50%;
  transform: translateX(-50%);
  width: 1000px;
  height: 700px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.18) 0%, rgba(168, 85, 247, 0.12) 35%, rgba(236, 72, 153, 0.06) 60%, transparent 80%);
  filter: blur(100px);
}

/* Glassmorphic Components */
.glass-nav {
  background: var(--glass-nav);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-card);
}

.glass-box {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-card);
  box-shadow: var(--shadow-card);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-interactive:hover {
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

/* Gradient accents */
.text-gradient {
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.bg-gradient-primary {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #db2777 100%);
  background-size: 200% 200%;
  transition: all 0.3s ease;
}

.bg-gradient-primary:hover {
  background-position: right center;
  box-shadow: 0 10px 30px -5px rgba(124, 58, 237, 0.4);
}

/* Skeleton Loading Shimmer */
@keyframes shimmerAnim {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton-shimmer {
  background: linear-gradient(90deg, var(--bg-card-subtle) 25%, var(--border-card) 50%, var(--bg-card-subtle) 75%);
  background-size: 200% 100%;
  animation: shimmerAnim 1.6s infinite;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--text-subtle);
  border-radius: 9999px;
  opacity: 0.5;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.app-toast {
  pointer-events: auto;
  animation: toastSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  transition: all 0.25s ease;
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
