@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Exo+2:ital,wght@0,300;0,400;0,600;0,700;1,400&family=JetBrains+Mono:wght@400;600&display=swap');

/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
  /* Backgrounds */
  --bg:        #080c14;
  --bg2:       #0c1220;
  --panel:     #0f1724;
  --panel2:    #141e2e;
  --panel3:    #1a2535;

  /* Borders */
  --border:    #1c2d42;
  --border2:   #243447;
  --border3:   #2d3f55;

  /* Brand colors */
  --cyan:      #00d4ff;
  --cyan-dim:  rgba(0,212,255,0.15);
  --teal:      #00e5c8;
  --green:     #00e676;
  --green-dim: rgba(0,230,118,0.12);
  --gold:      #ffc107;
  --gold-dim:  rgba(255,193,7,0.12);
  --orange:    #ff6d00;
  --red:       #ff4560;
  --red-dim:   rgba(255,69,96,0.12);
  --purple:    #a78bfa;
  --purple-dim:rgba(167,139,250,0.12);
  --blue:      #3b82f6;

  /* Text */
  --text:      #ddeeff;
  --text2:     #a8c4d8;
  --muted:     #6b8fa8;
  --muted2:    #4a6a85;

  /* Typography */
  --font-display: 'Orbitron', monospace;
  --font-body:    'Exo 2', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;

  /* Layout */
  --sidebar-w: 220px;
  --header-h:  48px;
  --radius:    2px;

  /* Transitions */
  --trans:     0.2s ease;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 14px; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
}

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

h1,h2,h3,h4,h5,h6 { font-weight: 700; line-height: 1.2; }

img { max-width: 100%; display: block; }

input, textarea, select, button { font-family: var(--font-body); }

/* ============================================================
   GRID BACKGROUND
   ============================================================ */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,212,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,212,255,0.025) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

/* ============================================================
   APP SHELL — SIDEBAR LAYOUT
   ============================================================ */
.app-shell {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  background: var(--panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform var(--trans);
}

.sidebar-brand {
  padding: 0 16px;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-brand .brand-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.sidebar-brand .brand-text {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  color: var(--cyan);
  letter-spacing: 1px;
  line-height: 1.3;
}

.sidebar-role-badge {
  margin: 12px 12px 4px;
  padding: 5px 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-family: var(--font-display);
  text-align: center;
  border: 1px solid;
}

.sidebar-role-badge.student { border-color: var(--cyan); color: var(--cyan); background: var(--cyan-dim); }
.sidebar-role-badge.teacher { border-color: var(--gold); color: var(--gold); background: var(--gold-dim); }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 8px 0; }

.nav-section-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted2);
  padding: 12px 16px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: background var(--trans), color var(--trans);
  border-left: 3px solid transparent;
  text-decoration: none;
  user-select: none;
}

.nav-item:hover {
  background: rgba(0,212,255,0.05);
  color: var(--text);
  text-decoration: none;
}

.nav-item.active {
  background: rgba(0,212,255,0.08);
  color: var(--cyan);
  border-left-color: var(--cyan);
}

.nav-item.active.teacher-nav {
  background: var(--gold-dim);
  color: var(--gold);
  border-left-color: var(--gold);
}

.nav-item .nav-icon { font-size: 16px; min-width: 20px; text-align: center; }

.nav-item .nav-badge {
  margin-left: auto;
  background: var(--red);
  color: white;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 8px;
  min-width: 16px;
  text-align: center;
}

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
}

.user-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

/* Main content area */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Top header bar */
.top-bar {
  height: var(--header-h);
  background: rgba(8,12,20,0.9);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(8px);
  flex-shrink: 0;
}

.top-bar-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 1px;
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot { 0%,100%{opacity:1}50%{opacity:0.4} }

/* Page body */
.page-body {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--panel); }
::-webkit-scrollbar-thumb { background: var(--border3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted2); }
