/* ============================================================
   style.css — Shared Design System
   Course Advisor Agent · Dark Glassmorphism Theme
   ============================================================ */

@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 Custom Properties ─────────────────────────────────── */
:root {
  /* Base palette */
  --bg-deep:        #060912;
  --bg-surface:     #0d1220;
  --bg-elevated:    #141926;

  /* Glass */
  --glass-bg:       rgba(255, 255, 255, 0.04);
  --glass-border:   rgba(255, 255, 255, 0.08);
  --glass-hover:    rgba(255, 255, 255, 0.07);

  /* Brand colors */
  --primary:        #6c63ff;
  --primary-light:  #8b84ff;
  --primary-glow:   rgba(108, 99, 255, 0.35);
  --secondary:      #a78bfa;
  --accent:         #06b6d4;
  --accent-glow:    rgba(6, 182, 212, 0.3);

  /* Semantic */
  --success:        #10b981;
  --success-glow:   rgba(16, 185, 129, 0.25);
  --warning:        #f59e0b;
  --warning-glow:   rgba(245, 158, 11, 0.25);
  --error:          #ef4444;
  --error-glow:     rgba(239, 68, 68, 0.25);

  /* Text */
  --text-primary:   #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted:     #475569;

  /* Borders */
  --border:         rgba(255, 255, 255, 0.07);
  --border-bright:  rgba(255, 255, 255, 0.14);

  /* Radii */
  --radius-sm:   8px;
  --radius-md:   14px;
  --radius-lg:   20px;
  --radius-xl:   28px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm:  0 2px 8px rgba(0,0,0,0.4);
  --shadow-md:  0 8px 24px rgba(0,0,0,0.5);
  --shadow-lg:  0 20px 60px rgba(0,0,0,0.6);

  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --dur:  180ms;

  /* Layout */
  --nav-h: 64px;
  --sidebar-w: 260px;
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; scroll-behavior: smooth; }

body {
  font-family: 'Outfit', system-ui, sans-serif;
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100%;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ── Background mesh ─────────────────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 10% 10%, rgba(108,99,255,0.12) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 90% 85%, rgba(6,182,212,0.08) 0%, transparent 55%),
    radial-gradient(ellipse 50% 40% at 50% 50%, rgba(167,139,250,0.05) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* ── Top Navigation ──────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 100;
  background: rgba(6, 9, 18, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 32px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.nav-logo {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  box-shadow: 0 0 16px var(--primary-glow);
}

.nav-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.nav-subtitle {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 400;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--dur) var(--ease);
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--glass-hover);
}

.nav-link.active {
  color: var(--primary-light);
  background: rgba(108, 99, 255, 0.12);
}

.nav-pill {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: #fff;
  letter-spacing: 0.05em;
}

/* ── Glass Card ──────────────────────────────────────────────── */
.card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: border-color var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease);
}

.card:hover {
  border-color: var(--border-bright);
  box-shadow: var(--shadow-md);
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-family: 'Outfit', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--dur) var(--ease);
  white-space: nowrap;
  user-select: none;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  box-shadow: 0 4px 16px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px var(--primary-glow);
}

.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--glass-bg);
  border-color: var(--glass-border);
  color: var(--text-secondary);
}

.btn-secondary:hover {
  border-color: var(--border-bright);
  color: var(--text-primary);
  background: var(--glass-hover);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--error);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.2);
  box-shadow: 0 4px 16px var(--error-glow);
}

.btn-sm { padding: 6px 12px; font-size: 0.78rem; }
.btn-lg { padding: 14px 28px; font-size: 0.95rem; }
.btn-icon { padding: 8px; border-radius: var(--radius-sm); }

/* ── Badge / Tag ─────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.badge-primary { background: rgba(108,99,255,0.15); color: var(--primary-light); border: 1px solid rgba(108,99,255,0.25); }
.badge-success { background: rgba(16,185,129,0.12); color: var(--success); border: 1px solid rgba(16,185,129,0.2); }
.badge-warning { background: rgba(245,158,11,0.12); color: var(--warning); border: 1px solid rgba(245,158,11,0.2); }
.badge-error   { background: rgba(239,68,68,0.12);  color: var(--error);   border: 1px solid rgba(239,68,68,0.2); }
.badge-muted   { background: var(--glass-bg); color: var(--text-muted); border: 1px solid var(--border); }

/* ── Status dot ──────────────────────────────────────────────── */
.dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
}
.dot-success { background: var(--success); box-shadow: 0 0 6px var(--success-glow); }
.dot-error   { background: var(--error);   box-shadow: 0 0 6px var(--error-glow); }
.dot-warning { background: var(--warning); box-shadow: 0 0 6px var(--warning-glow); }
.dot-pulse {
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.85); }
}

/* ── Inputs ──────────────────────────────────────────────────── */
.input {
  width: 100%;
  padding: 10px 14px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease);
}

.input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(108,99,255,0.15);
}

.input::placeholder { color: var(--text-muted); }

/* ── KPI Card ────────────────────────────────────────────────── */
.kpi-card {
  padding: 20px 24px;
  border-radius: var(--radius-lg);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  position: relative;
  overflow: hidden;
  transition: all var(--dur) var(--ease);
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 80px; height: 80px;
  border-radius: 50%;
  background: var(--kpi-glow, var(--primary-glow));
  filter: blur(30px);
  opacity: 0.6;
}

.kpi-card:hover {
  border-color: var(--border-bright);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.kpi-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.kpi-value {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.kpi-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── Scroll ──────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ── Utility ─────────────────────────────────────────────────── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.w-full { width: 100%; }
.mt-auto { margin-top: auto; }
.text-sm { font-size: 0.85rem; }
.text-xs { font-size: 0.75rem; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.font-mono { font-family: 'JetBrains Mono', monospace; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Loading spinner ─────────────────────────────────────────── */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid rgba(255,255,255,0.1);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Divider ─────────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

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

.toast {
  padding: 12px 20px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  font-size: 0.875rem;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-md);
  animation: toast-in 0.25s var(--ease);
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 340px;
}

.toast-success { border-color: rgba(16,185,129,0.4); }
.toast-error   { border-color: rgba(239,68,68,0.4); }
.toast-info    { border-color: rgba(108,99,255,0.4); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Page wrapper ────────────────────────────────────────────── */
.page {
  position: relative;
  z-index: 1;
  padding-top: var(--nav-h);
  min-height: 100vh;
}

/* ── Section heading ─────────────────────────────────────────── */
.section-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
}

/* ── Table ───────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

thead th {
  padding: 10px 14px;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  background: rgba(255,255,255,0.02);
  border-bottom: 1px solid var(--border);
}

tbody tr {
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background var(--dur) var(--ease);
}

tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--glass-hover); }

tbody td {
  padding: 10px 14px;
  color: var(--text-secondary);
  vertical-align: middle;
}
