/* ============================================================
   SIMSTRK - STUDENT MANAGEMENT SYSTEM TRACKER
   GLOBAL CSS DESIGN SYSTEM & THEME CONFIGURATION
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

/* ── Default Variables (Sapphire Theme) ───────────────────── */
:root {
  --brand-primary:      #1e40af;
  --brand-secondary:    #3b82f6;
  --brand-accent:       #0ea5e9;
  --brand-emerald:      #10b981;
  --brand-amber:        #f59e0b;
  --brand-rose:         #f43f5e;

  --grad-primary:       linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
  --grad-accent:        linear-gradient(135deg, #0ea5e9 0%, #1e40af 100%);
  --grad-success:       linear-gradient(135deg, #10b981 0%, #059669 100%);
  --grad-warning:       linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  --grad-danger:        linear-gradient(135deg, #f43f5e 0%, #be123c 100%);

  --surface-bg:         #f8fafc;
  --surface-card:       #ffffff;
  --surface-border:     #e2e8f0;
  
  --sidebar-bg:         #0f172a;
  --sidebar-text:       #f1f5f9;
  --sidebar-hover:      #1e293b;
  --sidebar-active:     #2563eb;
  --sidebar-label:      #64748b;

  --glass-bg:           rgba(255, 255, 255, 0.85);
  --glass-bg-hover:     rgba(255, 255, 255, 0.95);
  --glass-border:       rgba(30, 41, 59, 0.08);
  --glass-border-hover: rgba(30, 41, 59, 0.18);

  --text-primary:       #0f172a;
  --text-secondary:     #475569;
  --text-muted:         #94a3b8;
  --text-light:         #ffffff;

  --radius-sm:          6px;
  --radius-md:          10px;
  --radius-lg:          16px;
  --radius-xl:          24px;
  --radius-full:        9999px;

  --shadow-sm:          0 1px 3px rgba(0,0,0,0.05);
  --shadow-md:          0 4px 20px rgba(30,41,59,0.05);
  --shadow-lg:          0 10px 30px rgba(30,41,59,0.08);
  --shadow-glow:        0 0 20px rgba(37,99,235,0.15);

  --transition-fast:     150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal:   250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow:     400ms cubic-bezier(0.4, 0, 0.2, 1);

  --sidebar-width:       260px;
  --sidebar-collapsed-width: 72px;
  --topbar-height:       64px;

  /* Login custom variables */
  --login-bg:           linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
  --login-orb-1:        rgba(59, 130, 246, 0.25);
  --login-orb-2:        rgba(99, 102, 241, 0.18);
  --login-orb-3:        rgba(14, 165, 233, 0.2);
  --login-grid:         rgba(255, 255, 255, 0.03);
  --bubble-color:       rgba(255, 255, 255, 0.15);
  --bubble-border:      rgba(255, 255, 255, 0.35);
}

/* ── 2. Royal Maroon Theme ───────────────────────────────── */
[data-theme="maroon"] {
  --brand-primary:      #7f1d1d;
  --brand-secondary:    #b91c1c;
  --brand-accent:       #f43f5e;
  --grad-primary:       linear-gradient(135deg, #7f1d1d 0%, #b91c1c 100%);
  --grad-accent:        linear-gradient(135deg, #f43f5e 0%, #7f1d1d 100%);
  --surface-bg:         #fffbfb;
  --sidebar-bg:         #450a0a;
  --sidebar-text:       #fecdd3;
  --sidebar-hover:      #7f1d1d;
  --sidebar-active:     #e11d48;
  --sidebar-label:      #fda4af;
  --glass-bg:           rgba(255, 255, 255, 0.85);
  --glass-border:       rgba(127, 29, 29, 0.08);
  --glass-border-hover: rgba(127, 29, 29, 0.18);
  --text-primary:       #450a0a;
  --text-secondary:     #7f1d1d;
  --text-muted:         #cca3a3;
  --shadow-glow:        0 0 20px rgba(185, 28, 28, 0.15);

  --login-bg:           linear-gradient(135deg, #180202 0%, #5c0606 100%);
  --login-orb-1:        rgba(244, 63, 94, 0.25);
  --login-orb-2:        rgba(251, 113, 133, 0.18);
  --login-orb-3:        rgba(225, 29, 72, 0.2);
  --login-grid:         rgba(255, 255, 255, 0.03);
  --bubble-color:       rgba(255, 255, 255, 0.15);
  --bubble-border:      rgba(255, 255, 255, 0.35);
}

/* ── 3. Forest Emerald Theme ─────────────────────────────── */
[data-theme="emerald"] {
  --brand-primary:      #064e3b;
  --brand-secondary:    #059669;
  --brand-accent:       #10b981;
  --grad-primary:       linear-gradient(135deg, #064e3b 0%, #059669 100%);
  --grad-accent:        linear-gradient(135deg, #10b981 0%, #064e3b 100%);
  --surface-bg:         #f0fdf4;
  --sidebar-bg:         #022c22;
  --sidebar-text:       #a7f3d0;
  --sidebar-hover:      #064e3b;
  --sidebar-active:     #10b981;
  --sidebar-label:      #6ee7b7;
  --glass-bg:           rgba(255, 255, 255, 0.85);
  --glass-border:       rgba(6, 78, 59, 0.08);
  --glass-border-hover: rgba(6, 78, 59, 0.18);
  --text-primary:       #022c22;
  --text-secondary:     #064e3b;
  --text-muted:         #9cc8b7;
  --shadow-glow:        0 0 20px rgba(5, 150, 105, 0.15);

  --login-bg:           linear-gradient(135deg, #021a12 0%, #064e3b 100%);
  --login-orb-1:        rgba(16, 185, 129, 0.25);
  --login-orb-2:        rgba(52, 211, 153, 0.18);
  --login-orb-3:        rgba(5, 150, 105, 0.2);
  --login-grid:         rgba(255, 255, 255, 0.03);
  --bubble-color:       rgba(255, 255, 255, 0.15);
  --bubble-border:      rgba(255, 255, 255, 0.35);
}

/* ── 4. Classic Amethyst Theme ────────────────────────────── */
[data-theme="amethyst"] {
  --brand-primary:      #4c1d95;
  --brand-secondary:    #7c3aed;
  --brand-accent:       #8b5cf6;
  --grad-primary:       linear-gradient(135deg, #4c1d95 0%, #7c3aed 100%);
  --grad-accent:        linear-gradient(135deg, #8b5cf6 0%, #4c1d95 100%);
  --surface-bg:         #faf5ff;
  --sidebar-bg:         #2e1065;
  --sidebar-text:       #ddd6fe;
  --sidebar-hover:      #4c1d95;
  --sidebar-active:     #8b5cf6;
  --sidebar-label:      #c7d2fe;
  --glass-bg:           rgba(255, 255, 255, 0.85);
  --glass-border:       rgba(76, 29, 149, 0.08);
  --glass-border-hover: rgba(76, 29, 149, 0.18);
  --text-primary:       #2e1065;
  --text-secondary:     #4c1d95;
  --text-muted:         #c2b0e2;
  --shadow-glow:        0 0 20px rgba(124, 58, 237, 0.15);

  --login-bg:           linear-gradient(135deg, #0f051d 0%, #3b0764 100%);
  --login-orb-1:        rgba(139, 92, 246, 0.25);
  --login-orb-2:        rgba(167, 139, 250, 0.18);
  --login-orb-3:        rgba(124, 58, 237, 0.2);
  --login-grid:         rgba(255, 255, 255, 0.03);
  --bubble-color:       rgba(255, 255, 255, 0.15);
  --bubble-border:      rgba(255, 255, 255, 0.35);
}

/* ── 5. Sunset Amber Theme ───────────────────────────────── */
[data-theme="amber"] {
  --brand-primary:      #78350f;
  --brand-secondary:    #d97706;
  --brand-accent:       #f59e0b;
  --grad-primary:       linear-gradient(135deg, #78350f 0%, #d97706 100%);
  --grad-accent:        linear-gradient(135deg, #f59e0b 0%, #78350f 100%);
  --surface-bg:         #fffbeb;
  --sidebar-bg:         #451a03;
  --sidebar-text:       #fef3c7;
  --sidebar-hover:      #78350f;
  --sidebar-active:     #f59e0b;
  --sidebar-label:      #fde68a;
  --glass-bg:           rgba(255, 255, 255, 0.85);
  --glass-border:       rgba(120, 53, 15, 0.08);
  --glass-border-hover: rgba(120, 53, 15, 0.18);
  --text-primary:       #451a03;
  --text-secondary:     #78350f;
  --text-muted:         #dcae8c;
  --shadow-glow:        0 0 20px rgba(217, 119, 6, 0.15);

  --login-bg:           linear-gradient(135deg, #200d00 0%, #78350f 100%);
  --login-orb-1:        rgba(245, 158, 11, 0.25);
  --login-orb-2:        rgba(251, 191, 36, 0.18);
  --login-orb-3:        rgba(217, 119, 6, 0.2);
  --login-grid:         rgba(255, 255, 255, 0.03);
  --bubble-color:       rgba(255, 255, 255, 0.15);
  --bubble-border:      rgba(255, 255, 255, 0.35);
}

/* ── 6. Teal Dream Theme ────────────────────────────────── */
[data-theme="teal"] {
  --brand-primary:      #134e5e;
  --brand-secondary:    #0f766e;
  --brand-accent:       #14b8a6;
  --grad-primary:       linear-gradient(135deg, #134e5e 0%, #0f766e 100%);
  --grad-accent:        linear-gradient(135deg, #14b8a6 0%, #134e5e 100%);
  --surface-bg:         #f0fdfa;
  --sidebar-bg:         #042f2e;
  --sidebar-text:       #ccfbf1;
  --sidebar-hover:      #0f766e;
  --sidebar-active:     #14b8a6;
  --sidebar-label:      #5eead4;
  --glass-bg:           rgba(255, 255, 255, 0.85);
  --glass-border:       rgba(19, 78, 94, 0.08);
  --glass-border-hover: rgba(19, 78, 94, 0.18);
  --text-primary:       #042f2e;
  --text-secondary:     #0f766e;
  --text-muted:         #8caeab;
  --shadow-glow:        0 0 20px rgba(15, 118, 110, 0.15);

  --login-bg:           linear-gradient(135deg, #02181f 0%, #0f766e 100%);
  --login-orb-1:        rgba(20, 184, 166, 0.25);
  --login-orb-2:        rgba(45, 212, 191, 0.18);
  --login-orb-3:        rgba(13, 148, 136, 0.2);
  --login-grid:         rgba(255, 255, 255, 0.03);
  --bubble-color:       rgba(255, 255, 255, 0.15);
  --bubble-border:      rgba(255, 255, 255, 0.35);
}

/* ── Resets & Global Styles ───────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
  background-color: var(--surface-bg);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* ── Scrollbars ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--brand-primary); }

/* ── Glassmorphism Card Style ────────────────────────────── */
.glass-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-md);
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}
.glass-card::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.06) 0%, transparent 60%);
  pointer-events: none;
}
.glass-card:hover {
  border-color: var(--glass-border-hover);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  transform: translateY(-2px);
}

/* ── Button Styles ───────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: var(--radius-md);
  font-size: 13.5px; font-weight: 600; font-family: inherit;
  cursor: pointer; border: none; text-decoration: none;
  transition: all var(--transition-fast); white-space: nowrap;
  position: relative; overflow: hidden;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--grad-primary); color: var(--text-light); box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0,0,0,0.12); opacity: 0.95; }
.btn-secondary { background: var(--grad-accent); color: var(--text-light); }
.btn-ghost { background: transparent; color: var(--text-secondary); border: 1px solid var(--glass-border); }
.btn-ghost:hover { background: var(--glass-bg-hover); color: var(--text-primary); border-color: var(--glass-border-hover); }
.btn-danger { background: var(--grad-danger); color: var(--text-light); }
.btn-success { background: var(--grad-success); color: var(--text-light); }
.btn-warning { background: var(--grad-warning); color: var(--text-light); }
.btn-sm { padding: 6px 12px; font-size: 11.5px; border-radius: var(--radius-sm); }
.btn-lg { padding: 14px 24px; font-size: 15px; border-radius: var(--radius-lg); }
.btn-icon { padding: 0; width: 34px; height: 34px; border-radius: var(--radius-md); }

/* ── Badges ──────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: var(--radius-full);
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
}
.badge-primary { background: rgba(30, 64, 175, 0.1); color: var(--brand-primary); }
.badge-success { background: rgba(16, 185, 129, 0.1); color: var(--brand-emerald); }
.badge-warning { background: rgba(245, 158, 11, 0.1); color: var(--brand-amber); }
.badge-danger { background: rgba(244, 63, 94, 0.1); color: var(--brand-rose); }

/* ── Forms and Inputs ────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 12.5px; font-weight: 600; color: var(--text-secondary); }
.form-input, .form-select, .form-textarea {
  background: var(--surface-card); border: 1.5px solid #000000;
  border-radius: var(--radius-md); color: var(--text-primary);
  font-family: inherit; font-size: 13.5px; padding: 10px 14px;
  transition: all var(--transition-fast); outline: none; width: 100%;
}
.form-input::placeholder { color: var(--text-muted); }
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}
.form-select { appearance: none; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23475569'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E"); background-size: 16px; background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
.form-textarea { resize: vertical; min-height: 80px; }

/* ── Data Tables ─────────────────────────────────────────── */
.data-table-wrap { overflow-x: auto; width: 100%; border-radius: var(--radius-md); }
.data-table { width: 100%; border-collapse: collapse; border-spacing: 0; text-align: left; }
.data-table th {
  padding: 12px 16px; font-size: 11px; font-weight: 700;
  color: var(--sidebar-text); text-transform: uppercase;
  letter-spacing: 0.05em; background: var(--sidebar-bg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  transition: background var(--transition-normal), color var(--transition-normal);
}
.data-table td {
  padding: 14px 16px; font-size: 13px; color: var(--text-secondary);
  border-bottom: 1px solid var(--surface-border); vertical-align: middle;
}
.data-table tr:hover td { background: rgba(30, 41, 59, 0.01); }
.data-table tr:last-child td { border-bottom: none; }

/* ── Modals ──────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(8px); z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity var(--transition-normal);
}
.modal-backdrop.open { opacity: 1; pointer-events: all; }
.modal-box {
  background: var(--surface-card); border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg); padding: 0; max-width: 500px; width: 90%;
  box-shadow: var(--shadow-lg); transform: scale(0.95) translateY(10px);
  transition: transform var(--transition-normal), opacity var(--transition-normal); opacity: 0;
  overflow: hidden;
}
.modal-backdrop.open .modal-box { transform: scale(1) translateY(0); opacity: 1; }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px; border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--sidebar-bg); color: var(--sidebar-text);
  transition: background var(--transition-normal), color var(--transition-normal);
}
.modal-title { font-size: 15.5px; font-weight: 700; }
.modal-header .btn-close {
  background: transparent; color: var(--sidebar-text); border: none; font-size: 18px; cursor: pointer;
  opacity: 0.8; transition: opacity var(--transition-fast);
}
.modal-header .btn-close:hover { opacity: 1; }
.modal-body { padding: 24px; }
.modal-footer {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  padding: 16px 24px; border-top: 1px solid var(--surface-border);
  background: rgba(30, 41, 59, 0.01);
}

/* ── Custom Switcher Grid (Color Dot UI) ───────────────────── */
.theme-selector-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 8px;
}
.theme-dot-btn {
  background: var(--surface-card); border: 1px solid var(--surface-border);
  border-radius: var(--radius-md); padding: 10px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  transition: all var(--transition-fast); text-align: center;
}
.theme-dot-btn:hover { border-color: var(--brand-secondary); transform: translateY(-1px); }
.theme-dot-btn.active { border-color: var(--brand-primary); box-shadow: var(--shadow-glow); background: rgba(30, 64, 175, 0.03); }
.theme-dot-color {
  width: 24px; height: 24px; border-radius: var(--radius-full); border: 1px solid rgba(0,0,0,0.1);
}
.theme-dot-label { font-size: 10.5px; font-weight: 600; color: var(--text-primary); }

/* ── Toast Container & Notifications ──────────────────────── */
#toast-container {
  position: fixed; bottom: 24px; right: 24px; z-index: 1100;
  display: flex; flex-direction: column; gap: 10px; pointer-events: none;
}
.toast {
  background: var(--surface-card); border-left: 4px solid var(--brand-primary);
  border-radius: var(--radius-md); padding: 14px 20px; min-width: 280px;
  box-shadow: var(--shadow-lg); pointer-events: auto; display: flex; align-items: center; gap: 12px;
  transform: translateX(120%); transition: all var(--transition-normal);
}
.toast.show { transform: translateX(0); }
.toast.success { border-left-color: var(--brand-emerald); }
.toast.error { border-left-color: var(--brand-rose); }
.toast.warning { border-left-color: var(--brand-amber); }
.toast-icon { font-size: 16px; }
.toast-msg { font-size: 12.5px; font-weight: 600; color: var(--text-primary); }

/* Helper classes */
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-align { display: flex; align-items: center; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.text-center { text-align: center; }
