/* ============================================================
   SYNAPSE — EduMentor Design System
   Dark Neural Theme · Glassmorphism · Premium Aesthetics
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── CSS VARIABLES ────────────────────────────────────────── */
:root {
  /* Colors */
  --clr-bg:          #080b14;
  --clr-bg-2:        #0d1120;
  --clr-bg-3:        #111827;
  --clr-surface:     rgba(255,255,255,0.04);
  --clr-surface-2:   rgba(255,255,255,0.07);
  --clr-border:      rgba(255,255,255,0.08);
  --clr-border-2:    rgba(255,255,255,0.14);

  --clr-primary:     #6c63ff;
  --clr-primary-l:   #8b85ff;
  --clr-primary-d:   #4f48c4;
  --clr-accent:      #00d9b1;
  --clr-accent-l:    #30efcc;
  --clr-warn:        #ff6b6b;
  --clr-gold:        #ffd166;

  --clr-text:        #f0f2ff;
  --clr-text-2:      #a0a8c8;
  --clr-text-3:      #5c6485;

  /* Gradients */
  --grad-primary:    linear-gradient(135deg, #6c63ff 0%, #00d9b1 100%);
  --grad-card:       linear-gradient(145deg, rgba(108,99,255,0.12) 0%, rgba(0,217,177,0.05) 100%);
  --grad-hero:       radial-gradient(ellipse 80% 60% at 50% -10%, rgba(108,99,255,0.35) 0%, transparent 70%);
  --grad-glow-p:     radial-gradient(ellipse 40% 40% at 50% 50%, rgba(108,99,255,0.2) 0%, transparent 70%);

  /* Shadows */
  --shadow-sm:       0 2px 8px rgba(0,0,0,0.4);
  --shadow-md:       0 8px 32px rgba(0,0,0,0.5);
  --shadow-lg:       0 16px 48px rgba(0,0,0,0.6);
  --shadow-glow:     0 0 30px rgba(108,99,255,0.25);
  --shadow-accent:   0 0 20px rgba(0,217,177,0.2);

  /* Spacing */
  --sp-xs: 4px;  --sp-sm: 8px;  --sp-md: 16px;
  --sp-lg: 24px; --sp-xl: 32px; --sp-2xl: 48px; --sp-3xl: 64px;

  /* Border Radius */
  --r-sm: 8px;  --r-md: 14px; --r-lg: 20px;
  --r-xl: 28px; --r-full: 9999px;

  /* Transitions */
  --t-fast: 0.15s ease;
  --t-mid:  0.25s ease;
  --t-slow: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── RESET ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Outfit', system-ui, sans-serif;
  background-color: var(--clr-bg);
  color: var(--clr-text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── SCROLLBAR ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--clr-bg-2); }
::-webkit-scrollbar-thumb { background: var(--clr-primary-d); border-radius: var(--r-full); }
::-webkit-scrollbar-thumb:hover { background: var(--clr-primary); }

/* ── TYPOGRAPHY ───────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.mono { font-family: 'JetBrains Mono', monospace; }

/* ── UTILITY ──────────────────────────────────────────────── */
.sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0); }
.flex    { display: flex; }
.flex-col{ display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm  { gap: var(--sp-sm); }
.gap-md  { gap: var(--sp-md); }
.gap-lg  { gap: var(--sp-lg); }
.text-center { text-align: center; }
.text-gradient {
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hidden { display: none !important; }

/* ── GLASS CARD ───────────────────────────────────────────── */
.glass {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.glass-2 {
  background: var(--clr-surface-2);
  border: 1px solid var(--clr-border-2);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

/* ── BUTTONS ──────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-sm);
  padding: var(--sp-sm) var(--sp-lg);
  font-family: inherit; font-size: 0.9rem; font-weight: 600;
  border: none; border-radius: var(--r-full); cursor: pointer;
  text-decoration: none; white-space: nowrap;
  transition: transform var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
  position: relative; overflow: hidden;
}
.btn::after {
  content: '';
  position: absolute; inset: 0;
  background: rgba(255,255,255,0.08);
  opacity: 0; transition: opacity var(--t-fast);
}
.btn:hover::after { opacity: 1; }
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--grad-primary);
  color: #fff;
  box-shadow: 0 4px 20px rgba(108,99,255,0.4);
}
.btn-primary:hover { box-shadow: 0 8px 28px rgba(108,99,255,0.55); transform: translateY(-1px); }

.btn-ghost {
  background: var(--clr-surface);
  color: var(--clr-text);
  border: 1px solid var(--clr-border-2);
}
.btn-ghost:hover { background: var(--clr-surface-2); border-color: var(--clr-primary); }

.btn-accent {
  background: linear-gradient(135deg, #00d9b1, #00a886);
  color: #fff;
  box-shadow: 0 4px 20px rgba(0,217,177,0.3);
}
.btn-danger {
  background: linear-gradient(135deg, #ff6b6b, #c94040);
  color: #fff;
}
.btn-sm { padding: 6px 16px; font-size: 0.8rem; }
.btn-lg { padding: 14px 32px; font-size: 1rem; }
.btn-icon { padding: var(--sp-sm); border-radius: var(--r-md); width:40px; height:40px; }

/* ── INPUTS ───────────────────────────────────────────────── */
.input-group { display: flex; flex-direction: column; gap: var(--sp-xs); }
.input-label { font-size: 0.8rem; font-weight: 600; color: var(--clr-text-2); text-transform: uppercase; letter-spacing: 0.05em; }
.input, .textarea, .select {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--clr-border-2);
  border-radius: var(--r-md);
  color: var(--clr-text);
  font-family: inherit; font-size: 0.95rem;
  padding: 10px 16px;
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
  outline: none; width: 100%;
}
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--clr-primary);
  background: rgba(108,99,255,0.08);
  box-shadow: 0 0 0 3px rgba(108,99,255,0.15);
}
.input::placeholder, .textarea::placeholder { color: var(--clr-text-3); }
.textarea { resize: vertical; min-height: 100px; }
.select { cursor: pointer; }
.select option { background: var(--clr-bg-2); }

/* ── BADGE ────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 10px; border-radius: var(--r-full);
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
}
.badge-primary { background: rgba(108,99,255,0.2); color: var(--clr-primary-l); border: 1px solid rgba(108,99,255,0.3); }
.badge-accent  { background: rgba(0,217,177,0.15); color: var(--clr-accent-l);  border: 1px solid rgba(0,217,177,0.3); }
.badge-gold    { background: rgba(255,209,102,0.15); color: var(--clr-gold);    border: 1px solid rgba(255,209,102,0.3); }
.badge-warn    { background: rgba(255,107,107,0.15); color: var(--clr-warn);    border: 1px solid rgba(255,107,107,0.3); }

/* ── PROGRESS BAR ─────────────────────────────────────────── */
.progress-track {
  background: rgba(255,255,255,0.06);
  border-radius: var(--r-full); height: 8px; overflow: hidden; width: 100%;
}
.progress-fill {
  height: 100%; border-radius: var(--r-full);
  background: var(--grad-primary);
  transition: width 0.8s cubic-bezier(0.34,1.56,0.64,1);
  position: relative; overflow: hidden;
}
.progress-fill::after {
  content:''; position:absolute; inset:0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shimmer 2s infinite;
}
@keyframes shimmer { 0%{transform:translateX(-100%)} 100%{transform:translateX(100%)} }

/* ── TOAST NOTIFICATIONS ──────────────────────────────────── */
#toast-container {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 9999; display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px; border-radius: var(--r-lg);
  backdrop-filter: blur(20px); border: 1px solid var(--clr-border-2);
  font-size: 0.88rem; font-weight: 500; pointer-events: auto;
  animation: toastIn 0.4s var(--t-slow);
  box-shadow: var(--shadow-md);
  max-width: 340px;
}
.toast-success { background: rgba(0,217,177,0.15); border-color: rgba(0,217,177,0.3); color: var(--clr-accent-l); }
.toast-error   { background: rgba(255,107,107,0.15); border-color: rgba(255,107,107,0.3); color: var(--clr-warn); }
.toast-info    { background: rgba(108,99,255,0.15); border-color: rgba(108,99,255,0.3); color: var(--clr-primary-l); }
@keyframes toastIn { from { opacity:0; transform:translateX(20px); } to { opacity:1; transform:none; } }
@keyframes toastOut { to { opacity:0; transform:translateX(20px); } }

/* ── LOADING SPINNER ──────────────────────────────────────── */
.spinner {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid rgba(108,99,255,0.2);
  border-top-color: var(--clr-primary);
  animation: spin 0.8s linear infinite;
  display: inline-block;
}
.spinner-sm { width: 14px; height: 14px; }
.spinner-lg { width: 36px; height: 36px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── AVATAR ───────────────────────────────────────────────── */
.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.95rem;
  background: var(--grad-primary);
  flex-shrink: 0;
}
.avatar-sm { width: 32px; height: 32px; font-size: 0.8rem; }
.avatar-lg { width: 52px; height: 52px; font-size: 1.1rem; }

/* ── SKELETON LOADER ──────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 75%);
  background-size: 200% 100%;
  animation: skel 1.5s infinite; border-radius: var(--r-sm);
}
@keyframes skel { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* ── MODAL ────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(8,11,20,0.85);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: var(--sp-md);
  opacity: 0; pointer-events: none; transition: opacity var(--t-mid);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--clr-bg-2);
  border: 1px solid var(--clr-border-2);
  border-radius: var(--r-xl);
  padding: var(--sp-xl);
  width: 100%; max-width: 520px;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95) translateY(10px);
  transition: transform var(--t-slow);
}
.modal-overlay.open .modal { transform: scale(1) translateY(0); }
.modal-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:var(--sp-lg); }
.modal-title  { font-size: 1.2rem; font-weight: 700; }
.modal-close  { background:none; border:none; color:var(--clr-text-2); cursor:pointer; font-size:1.4rem; line-height:1; padding:4px; border-radius:var(--r-sm); transition:color var(--t-fast); }
.modal-close:hover { color:var(--clr-text); }

/* ── RESPONSIVE HELPERS ───────────────────────────────────── */
@media (max-width: 768px) {
  :root { --sp-lg: 16px; --sp-xl: 24px; --sp-2xl: 32px; }
}

/* ── AMBIENT GLOW ORBS (background decoration) ────────────── */
.orb {
  position: fixed; border-radius: 50%;
  filter: blur(80px); pointer-events: none; z-index: 0;
}
.orb-1 { width:400px; height:400px; background:rgba(108,99,255,0.12); top:-100px; left:-100px; }
.orb-2 { width:350px; height:350px; background:rgba(0,217,177,0.08); bottom:-80px; right:-80px; }

/* ── ANIMATIONS ───────────────────────────────────────────── */
@keyframes fadeIn   { from { opacity:0; } to { opacity:1; } }
@keyframes slideUp  { from { opacity:0; transform:translateY(20px); } to { opacity:1; transform:none; } }
@keyframes slideDown{ from { opacity:0; transform:translateY(-20px); } to { opacity:1; transform:none; } }
@keyframes pulse    { 0%,100%{opacity:1} 50%{opacity:.5} }
@keyframes float    { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-8px)} }

.anim-fade    { animation: fadeIn  0.5s ease both; }
.anim-up      { animation: slideUp 0.5s ease both; }
.anim-up-d1   { animation: slideUp 0.5s 0.1s ease both; }
.anim-up-d2   { animation: slideUp 0.5s 0.2s ease both; }
.anim-up-d3   { animation: slideUp 0.5s 0.3s ease both; }
.anim-float   { animation: float 4s ease-in-out infinite; }
