/* dashboard.css — shared across all dashboard pages Student Dashboard */



*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg-primary);
  color: var(--white);
  min-height: 100vh;
  overflow-x: hidden;
}

/* LAYOUT — sidebar + main area*/


.dash-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--topbar-h) 1fr;
  min-height: 100vh;
}

/* TOPBAR */
.dash-topbar {
  grid-column: 1 / -1;           /* spans full width */
  background: #080625;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Hamburger — visible on mobile only */
.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--gray);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
}

.sidebar-toggle:hover { 
  color: var(--accent); 
  background: var(--accent-dim); 
}

 .logo-group { 
  display: flex; 
  align-items: center; 
  gap: 12px; 
  text-decoration: none; 
}
.logo-icon-svg { 
  width: 40px; 
  height: 40px; 
  background: var(--log-icon); 
  border-radius: 50%; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  position: relative;
  border: 2px solid var(--cyber-cyan); 
  box-shadow: 0 0 15px rgba(0, 242, 255, 0.3);
}
.logo-icon-svg i { 
  color: var(--cyber-cyan); 
  font-size: 1.1rem; 
  z-index: 2; 
}

.logo-text span { color: var(--craft-amber); }
.topbar-logo {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--white);
  text-decoration: none;
}

.topbar-logo span { color: var(--craft-amber); }



/* Page title shown in topbar */
.topbar-title {
  font-size: 0.85rem;
  color: var(--gray);
  padding-left: 16px;
  border-left: 1px solid var(--border);
  display: none;               /* shown on mobile when sidebar hidden */
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Notification bell */
.topbar-notif {
  position: relative;
  width: 38px; height: 38px;
  background: var(--accent-dim);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--gray);
  font-size: 0.95rem;
  transition: all 0.2s;
}

.topbar-notif:hover { color: var(--accent); border-color: var(--accent); }

.notif-dot {
  position: absolute;
  top: 7px; right: 7px;
  width: 7px; height: 7px;
  background: var(--accent);
  border-radius: 50%;
  border: 2px solid var(--bg-sidebar);
}

/* Avatar */
.topbar-avatar {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #0080ff);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--bg-primary);
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.2s;
  font-family: 'Space Grotesk', sans-serif;
}

.topbar-avatar:hover { border-color: var(--accent); }

/* ═══════════════════════════════════════════════════
   SIDEBAR
═══════════════════════════════════════════════════ */
.dash-sidebar {
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  padding: 24px 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  transition: transform 0.3s ease;
}

/* Student info block at top of sidebar */
.sidebar-student {
  padding: 0 20px 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}

.student-avatar {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), #0080ff);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--bg-primary);
  margin-bottom: 10px;
  font-family: 'Space Grotesk', sans-serif;
}

.student-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 2px;
}

.student-role {
  font-size: 0.72rem;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(0,242,255,0.2);
  padding: 2px 8px;
  border-radius: 999px;
  display: inline-block;
  font-weight: 600;
  letter-spacing: 0.05em;
}

/* Nav section label */
.sidebar-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--gray-dim);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 12px 20px 6px;
}

/* Nav link */
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 20px;
  color: var(--gray);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: all 0.2s ease;
  position: relative;
}

.sidebar-link i {
  width: 18px;
  text-align: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.sidebar-link:hover {
  color: var(--white);
  background: var(--accent-dim);
  border-left-color: rgba(0,242,255,0.3);
}

/* Active state */
.sidebar-link.active {
  color: var(--accent);
  background: var(--accent-dim);
  border-left-color: var(--accent);
  font-weight: 600;
}

/* Badge on sidebar link (e.g. new quiz count) */
.sidebar-badge {
  margin-left: auto;
  background: var(--accent);
  color: var(--bg-primary);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
}

/* Logout at bottom of sidebar */
.sidebar-logout {
  margin-top: auto;
  padding: 16px 20px 0;
  border-top: 1px solid var(--border);
}

.sidebar-logout a {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--gray);
  text-decoration: none;
  font-size: 0.88rem;
  padding: 10px 0;
  transition: color 0.2s;
}

.sidebar-logout a:hover { color: var(--danger); }

/* ═══════════════════════════════════════════════════
   MAIN CONTENT AREA
═══════════════════════════════════════════════════ */
.dash-main {
  padding: clamp(20px, 4vw, 36px);
  overflow-y: auto;
  background: var(--bg-primary);
}

/* Page header inside main */
.dash-page-header {
  margin-bottom: 28px;
}

.dash-page-header h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.3rem, 3vw, 1.7rem);
  font-weight: 700;
  color: var(--white);
  margin-bottom: 4px;
}

.dash-page-header p {
  font-size: 0.88rem;
  color: var(--gray);
}

/* ── Stat cards row ── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s;
  animation: cardFadeIn 0.5s ease both;
}

.stat-card:hover {
  border-color: rgba(0,242,255,0.3);
  transform: translateY(-2px);
}

@keyframes cardFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.stat-card:nth-child(1) { animation-delay: 0.05s; }
.stat-card:nth-child(2) { animation-delay: 0.10s; }
.stat-card:nth-child(3) { animation-delay: 0.15s; }
.stat-card:nth-child(4) { animation-delay: 0.20s; }

.stat-icon {
  width: 38px; height: 38px;
  background: var(--accent-dim);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
  font-size: 1rem;
}

.stat-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--white);
  line-height: 1;
}

.stat-label {
  font-size: 0.78rem;
  color: var(--gray);
}

/* Glow dot on stat card */
.stat-card::after {
  content: '';
  position: absolute;
  top: -20px; right: -20px;
  width: 80px; height: 80px;
  background: radial-gradient(circle, rgba(0,242,255,0.07), transparent 70%);
  pointer-events: none;
}

/* ── Generic section card ── */
.dash-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
  animation: cardFadeIn 0.5s ease 0.1s both;
}

.dash-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 10px;
}

.dash-card-header h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--white);
}

.dash-card-header a {
  font-size: 0.8rem;
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.2s;
}

.dash-card-header a:hover { opacity: 0.75; }

/* ── Progress bar ── */
.progress-bar {
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 8px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #0080ff);
  border-radius: 999px;
  transition: width 0.8s cubic-bezier(0.22,1,0.36,1);
}

/* ── Course card ── */
.course-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.course-item:last-child { border-bottom: none; padding-bottom: 0; }

.course-thumb {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.course-info { flex: 1; min-width: 0; }

.course-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.course-meta {
  font-size: 0.75rem;
  color: var(--gray);
  margin-bottom: 6px;
}

.course-pct {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}

.btn-continue {
  padding: 7px 14px;
  background: var(--accent-dim);
  border: 1px solid rgba(0,242,255,0.2);
  border-radius: 8px;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.2s;
  flex-shrink: 0;
}

.btn-continue:hover {
  background: var(--accent);
  color: var(--bg-primary);
}

/* ── Quiz result row ── */
.quiz-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.quiz-row:last-child { border-bottom: none; }

.quiz-score-badge {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
  font-family: 'Space Grotesk', sans-serif;
}

.score-pass  { background: rgba(74,222,128,0.12); color: var(--success); border: 1px solid rgba(74,222,128,0.2); }
.score-fail  { background: rgba(248,113,113,0.12); color: var(--danger);  border: 1px solid rgba(248,113,113,0.2); }
.score-avg   { background: rgba(245,158,11,0.12);  color: var(--warning); border: 1px solid rgba(245,158,11,0.2); }

.quiz-info { flex: 1; min-width: 0; }

.quiz-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 3px;
}

.quiz-date { font-size: 0.75rem; color: var(--gray); }

.quiz-status {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.status-pass { background: rgba(74,222,128,0.12); color: var(--success); }
.status-fail { background: rgba(248,113,113,0.12); color: var(--danger); }
.status-avg  { background: rgba(245,158,11,0.12);  color: var(--warning); }

/* ── Form elements for profile page ── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group.full { grid-column: 1 / -1; }

.form-group label {
  font-size: 0.78rem;
  color: var(--gray);
  font-weight: 500;
  letter-spacing: 0.03em;
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 11px 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  color: var(--white);
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,242,255,0.1);
}

.form-group textarea { resize: vertical; min-height: 90px; }
.form-group select option { background: var(--bg-card); }

.btn-save {
  padding: 11px 28px;
  background: var(--accent);
  color: var(--bg-primary);
  border: none;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Space Grotesk', sans-serif;
  transition: opacity 0.2s, transform 0.2s, box-shadow 0.2s;
}

.btn-save:hover {
  opacity: 0.88;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0,242,255,0.3);
}

.btn-danger {
  padding: 11px 28px;
  background: rgba(248,113,113,0.1);
  color: var(--danger);
  border: 1px solid rgba(248,113,113,0.2);
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Space Grotesk', sans-serif;
  transition: all 0.2s;
}

.btn-danger:hover { background: rgba(248,113,113,0.2); }

/* ── Avatar upload (profile page) ── */
.avatar-upload {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 24px;
}

.avatar-big {
  width: 72px; height: 72px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--accent), #0080ff);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--bg-primary);
  font-family: 'Space Grotesk', sans-serif;
  flex-shrink: 0;
}

.avatar-upload-info p {
  font-size: 0.82rem;
  color: var(--gray);
  margin-bottom: 8px;
}

.btn-upload {
  padding: 7px 16px;
  background: var(--accent-dim);
  border: 1px solid rgba(0,242,255,0.2);
  border-radius: 8px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Space Grotesk', sans-serif;
}

.btn-upload:hover { background: var(--accent-mid); }

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--gray);
}

.empty-state i { font-size: 2.5rem; color: var(--gray-dim); margin-bottom: 12px; display: block; }
.empty-state p { font-size: 0.88rem; }

/* ═══════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .dash-layout {
    grid-template-columns: 1fr;
  }

  .dash-sidebar {
    position: fixed;
    top: var(--topbar-h);
    left: 0;
    height: calc(100vh - var(--topbar-h));
    z-index: 200;
    transform: translateX(-100%);   /* hidden by default on mobile */
    width: var(--sidebar-w);
  }

  /* JS adds this class to show sidebar on mobile */
  .dash-sidebar.open { transform: translateX(0); }

  /* Overlay behind sidebar on mobile */
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 199;
    top: var(--topbar-h);
  }

  .sidebar-overlay.show { display: block; }

  .sidebar-toggle { display: flex; }
  .topbar-title   { display: block; }

  .dash-main { padding: 20px 16px; }
}

@media (max-width: 480px) {
  .stats-row { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-group.full { grid-column: 1; }
  .course-item { flex-wrap: wrap; }
  .quiz-row { flex-wrap: wrap; }
}