/*
 * Sanjivani Exam Platform — Premium Stylesheet
 * Department of Cybersecurity, Sanjivani University
 * Color Scheme: White · Red · Black · Gold
 * ──────────────────────────────────────────────────
 */

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

/* ═══════════════════════════════════════════════════
   CSS VARIABLES — White / Red / Black / Gold
   ═══════════════════════════════════════════════════ */
:root {
    /* Primary — Deep Black */
    --black-50: #f5f5f5;
    --black-100: #e8e8e8;
    --black-200: #d1d1d1;
    --black-300: #a3a3a3;
    --black-400: #737373;
    --black-500: #404040;
    --black-600: #2a2a2a;
    --black-700: #1a1a1a;
    --black-800: #0f0f0f;
    --black-900: #000000;

    /* Accent — Royal Red */
    --red-50: #fff1f1;
    --red-100: #ffe0e0;
    --red-200: #ffc7c7;
    --red-300: #ff9b9b;
    --red-400: #ff5c5c;
    --red-500: #dc2626;
    --red-600: #b91c1c;
    --red-700: #991b1b;
    --red-800: #7f1d1d;
    --red-900: #450a0a;

    /* Gold / Amber */
    --gold-50: #fffbeb;
    --gold-100: #fef3c7;
    --gold-200: #fde68a;
    --gold-300: #fcd34d;
    --gold-400: #fbbf24;
    --gold-500: #d4a017;
    --gold-600: #b8860b;
    --gold-700: #92400e;
    --gold-800: #78350f;
    --gold-900: #451a03;

    /* Functional Colors */
    --accent-blue: #3b82f6;
    --accent-green: #10b981;
    --accent-purple: #8b5cf6;
    --accent-cyan: #06b6d4;
    --accent-pink: #ec4899;

    /* Gradients — Red & Gold & Black */
    --gradient-brand: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 40%, #991b1b 100%);
    --gradient-accent: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    --gradient-gold: linear-gradient(135deg, #d4a017 0%, #fbbf24 50%, #d4a017 100%);
    --gradient-dark: linear-gradient(135deg, #0f0f0f 0%, #1a1a1a 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --gradient-danger: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
    --gradient-warm: linear-gradient(135deg, #d4a017 0%, #dc2626 100%);
    --gradient-royal: linear-gradient(135deg, #1a1a1a 0%, #dc2626 50%, #d4a017 100%);
    --gradient-mesh: radial-gradient(ellipse at 20% 50%, rgba(220,38,38,0.08) 0%, transparent 50%),
                     radial-gradient(ellipse at 80% 20%, rgba(212,160,23,0.06) 0%, transparent 50%),
                     radial-gradient(ellipse at 50% 100%, rgba(0,0,0,0.05) 0%, transparent 50%);

    /* Light Theme — White Base */
    --bg-primary: #f9f9f9;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f3f3f3;
    --bg-sidebar: #0f0f0f;
    --bg-sidebar-hover: rgba(255,255,255,0.06);
    --bg-sidebar-active: rgba(220,38,38,0.2);
    --text-primary: #0f0f0f;
    --text-secondary: #525252;
    --text-tertiary: #a3a3a3;
    --text-sidebar: #d4d4d4;
    --text-sidebar-active: #ffffff;
    --border-color: #e5e5e5;
    --border-light: #f0f0f0;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 50px rgba(0,0,0,0.12);
    --shadow-glow-red: 0 0 40px rgba(220,38,38,0.12);
    --shadow-glow-gold: 0 0 40px rgba(212,160,23,0.12);

    /* Glass */
    --glass-bg: rgba(255,255,255,0.8);
    --glass-border: rgba(255,255,255,0.3);
    --glass-shadow: 0 8px 32px rgba(0,0,0,0.1);

    /* Sizing */
    --sidebar-width: 280px;
    --topbar-height: 64px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Dark Theme */
[data-theme="dark"] {
    --bg-primary: #0a0a0a;
    --bg-secondary: #141414;
    --bg-tertiary: #1a1a1a;
    --bg-sidebar: #050505;
    --text-primary: #f5f5f5;
    --text-secondary: #a3a3a3;
    --text-tertiary: #525252;
    --border-color: #262626;
    --border-light: #1a1a1a;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.5);
    --shadow-xl: 0 20px 50px rgba(0,0,0,0.6);
    --glass-bg: rgba(20,20,20,0.8);
    --glass-border: rgba(255,255,255,0.06);
}

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

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

a { color: var(--red-500); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--red-700); }
img { max-width: 100%; height: auto; }

/* ═══════════════════════════════════════════════════
   AUTH PAGES — Login / Register
   ═══════════════════════════════════════════════════ */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--gradient-brand);
    position: relative;
    overflow: hidden;
}

.auth-container::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-mesh);
    animation: meshFloat 20s ease-in-out infinite;
}

@keyframes meshFloat {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-20px) scale(1.05); }
}

.auth-container::after {
    content: '';
    position: absolute;
    top: -40%;
    right: -20%;
    width: 700px;
    height: 700px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(220,38,38,0.12) 0%, transparent 70%);
    animation: orbFloat 15s ease-in-out infinite;
}

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0); }
    33% { transform: translate(30px, -50px); }
    66% { transform: translate(-20px, 20px); }
}

.auth-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 480px;
    background: var(--glass-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 3rem;
    box-shadow: var(--shadow-xl), var(--shadow-glow-red);
    animation: cardSlideUp 0.6s var(--transition-bounce);
}

@keyframes cardSlideUp {
    from { opacity: 0; transform: translateY(40px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-logo { text-align: center; margin-bottom: 2rem; }

.auth-logo img {
    width: 80px; height: 80px; object-fit: contain;
    margin-bottom: 1rem;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.15));
    animation: logoBreath 3s ease-in-out infinite;
}

@keyframes logoBreath {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.auth-logo h1 {
    font-size: 1.5rem; font-weight: 800;
    color: var(--black-800);
    letter-spacing: -0.5px; line-height: 1.3;
}

[data-theme="dark"] .auth-logo h1 { color: #ffffff; }

.auth-logo p {
    font-size: 0.85rem; color: var(--text-secondary); margin-top: 0.25rem;
}

/* ═══════════════════════════════════════════════════
   FORM ELEMENTS
   ═══════════════════════════════════════════════════ */
.form-group { margin-bottom: 1.25rem; }

.form-label {
    display: block; font-size: 0.8rem; font-weight: 600;
    color: var(--text-secondary); margin-bottom: 0.5rem;
    text-transform: uppercase; letter-spacing: 0.5px;
}

.form-input {
    width: 100%; padding: 0.75rem 1rem;
    font-family: 'Inter', sans-serif; font-size: 0.95rem;
    color: var(--text-primary); background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md); outline: none;
    transition: all var(--transition-base);
}

.form-input:focus {
    border-color: var(--red-500);
    box-shadow: 0 0 0 4px rgba(220,38,38,0.1);
}

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

.form-input-icon { position: relative; }
.form-input-icon .form-input { padding-left: 2.75rem; }
.form-input-icon .icon {
    position: absolute; left: 0.85rem; top: 50%;
    transform: translateY(-50%); color: var(--text-tertiary);
    font-size: 1.1rem; transition: color var(--transition-fast);
}
.form-input-icon:focus-within .icon { color: var(--red-500); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.form-select {
    width: 100%; padding: 0.75rem 1rem;
    font-family: 'Inter', sans-serif; font-size: 0.95rem;
    color: var(--text-primary); background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md); outline: none;
    transition: all var(--transition-base);
    cursor: pointer;
}
.form-select:focus { border-color: var(--red-500); box-shadow: 0 0 0 4px rgba(220,38,38,0.1); }

.form-textarea {
    width: 100%; padding: 0.75rem 1rem;
    font-family: 'Inter', sans-serif; font-size: 0.95rem;
    color: var(--text-primary); background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md); outline: none;
    transition: all var(--transition-base);
    resize: vertical; min-height: 80px;
}
.form-textarea:focus { border-color: var(--red-500); box-shadow: 0 0 0 4px rgba(220,38,38,0.1); }

/* ═══════════════════════════════════════════════════
   BUTTONS — Red & Gold Theme
   ═══════════════════════════════════════════════════ */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 0.5rem; padding: 0.75rem 1.5rem;
    font-family: 'Inter', sans-serif; font-size: 0.9rem; font-weight: 600;
    border: none; border-radius: var(--radius-md); cursor: pointer;
    transition: all var(--transition-base); text-decoration: none;
    white-space: nowrap; position: relative; overflow: hidden;
}

.btn::before {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.2), transparent);
    opacity: 0; transition: opacity var(--transition-fast);
}
.btn:hover::before { opacity: 1; }

.btn-primary {
    background: var(--gradient-accent); color: #ffffff;
    box-shadow: 0 4px 15px rgba(220,38,38,0.3);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(220,38,38,0.4);
    color: #ffffff;
}

.btn-gold {
    background: var(--gradient-gold); color: #1a1a1a;
    box-shadow: 0 4px 15px rgba(212,160,23,0.3);
    font-weight: 700;
}
.btn-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(212,160,23,0.4);
    color: #1a1a1a;
}

.btn-dark {
    background: var(--gradient-dark); color: #ffffff;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}
.btn-dark:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.4);
    color: #ffffff;
}

.btn-secondary {
    background: var(--bg-tertiary); color: var(--text-primary);
    border: 1px solid var(--border-color);
}
.btn-secondary:hover { background: var(--border-color); transform: translateY(-1px); }

.btn-success {
    background: var(--gradient-success); color: #ffffff;
    box-shadow: 0 4px 15px rgba(16,185,129,0.3);
}

.btn-danger {
    background: var(--gradient-danger); color: #ffffff;
    box-shadow: 0 4px 15px rgba(220,38,38,0.3);
}

.btn-outline-red {
    background: transparent; color: var(--red-500);
    border: 2px solid var(--red-500);
}
.btn-outline-red:hover { background: var(--red-500); color: #fff; }

.btn-block { width: 100%; }
.btn-lg { padding: 1rem 2rem; font-size: 1rem; }
.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.8rem; border-radius: var(--radius-sm); }
.btn:active { transform: translateY(0) scale(0.98); }

.btn-loading { pointer-events: none; opacity: 0.7; }
.btn-loading::after {
    content: ''; width: 18px; height: 18px;
    border: 2px solid transparent; border-top-color: currentColor;
    border-radius: 50%; animation: spin 0.6s linear infinite; margin-left: 0.5rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════════
   ADMIN LAYOUT — Sidebar + Content
   ═══════════════════════════════════════════════════ */
.admin-layout { display: flex; min-height: 100vh; }

.sidebar {
    position: fixed; top: 0; left: 0;
    width: var(--sidebar-width); height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid rgba(255,255,255,0.04);
    display: flex; flex-direction: column; z-index: 50;
    transition: transform var(--transition-base);
    overflow-y: auto; overflow-x: hidden;
}

.sidebar-header {
    padding: 1.5rem; display: flex; align-items: center; gap: 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.sidebar-logo {
    width: 42px; height: 42px; object-fit: contain;
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.08); padding: 4px;
}

.sidebar-brand h2 {
    font-size: 0.9rem; font-weight: 700; color: #ffffff;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.3;
}
.sidebar-brand span { font-size: 0.7rem; color: var(--gold-400); }

.sidebar-nav { flex: 1; padding: 1rem 0.75rem; }

.nav-section { margin-bottom: 1.5rem; }
.nav-section-title {
    font-size: 0.65rem; font-weight: 700; color: var(--gold-500);
    text-transform: uppercase; letter-spacing: 1.5px;
    padding: 0 0.75rem; margin-bottom: 0.5rem;
}

.nav-link {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.65rem 0.75rem; margin: 2px 0;
    color: var(--text-sidebar); font-size: 0.85rem; font-weight: 500;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast); text-decoration: none; position: relative;
}
.nav-link:hover { background: var(--bg-sidebar-hover); color: #ffffff; }
.nav-link.active { background: var(--bg-sidebar-active); color: var(--text-sidebar-active); }
.nav-link.active::before {
    content: ''; position: absolute; left: -0.75rem; top: 50%;
    transform: translateY(-50%); width: 3px; height: 24px;
    background: var(--red-500); border-radius: 0 3px 3px 0;
}
.nav-link .icon { width: 20px; text-align: center; font-size: 1.1rem; flex-shrink: 0; }

.nav-badge {
    margin-left: auto; padding: 0.1rem 0.5rem;
    background: var(--red-500); color: #ffffff;
    font-size: 0.65rem; font-weight: 700;
    border-radius: var(--radius-full); min-width: 20px; text-align: center;
}

.sidebar-footer {
    padding: 1rem 1.5rem; border-top: 1px solid rgba(255,255,255,0.06);
}
.sidebar-user { display: flex; align-items: center; gap: 0.75rem; }
.sidebar-avatar {
    width: 36px; height: 36px; border-radius: var(--radius-full);
    background: var(--gradient-accent);
    display: flex; align-items: center; justify-content: center;
    color: #ffffff; font-weight: 700; font-size: 0.85rem; flex-shrink: 0;
}
.sidebar-user-name {
    font-size: 0.8rem; font-weight: 600; color: #ffffff;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-user-role { font-size: 0.7rem; color: var(--gold-400); text-transform: capitalize; }

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width); flex: 1; min-height: 100vh;
    transition: margin-left var(--transition-base);
}

.topbar {
    position: sticky; top: 0; height: var(--topbar-height);
    background: var(--glass-bg); backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 2rem; z-index: 40;
}

.topbar-left { display: flex; align-items: center; gap: 1rem; }
.topbar-title { font-size: 1.1rem; font-weight: 700; color: var(--text-primary); }

.topbar-right { display: flex; align-items: center; gap: 0.75rem; }
.topbar-btn {
    width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-md); border: none; background: transparent;
    color: var(--text-secondary); cursor: pointer;
    transition: all var(--transition-fast); font-size: 1.15rem; position: relative;
}
.topbar-btn:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.topbar-btn .badge-dot {
    position: absolute; top: 6px; right: 6px; width: 8px; height: 8px;
    background: var(--red-500); border-radius: 50%; border: 2px solid var(--bg-secondary);
}

.hamburger {
    display: none; background: none; border: none;
    font-size: 1.3rem; color: var(--text-primary); cursor: pointer; padding: 0.5rem;
}

.page-content { padding: 2rem; }

/* ═══════════════════════════════════════════════════
   STUDENT LAYOUT — Clean Navbar
   ═══════════════════════════════════════════════════ */
.student-layout { min-height: 100vh; background: var(--bg-primary); }

.student-navbar {
    position: sticky; top: 0; height: var(--topbar-height);
    background: var(--glass-bg); backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 2rem; z-index: 40;
}

.student-navbar-brand {
    display: flex; align-items: center; gap: 0.75rem; text-decoration: none;
}
.student-navbar-brand img { width: 36px; height: 36px; object-fit: contain; }
.student-navbar-brand h1 { font-size: 1rem; font-weight: 700; color: var(--text-primary); }

.student-nav-links { display: flex; align-items: center; gap: 0.25rem; list-style: none; }
.student-nav-links a {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.5rem 1rem; color: var(--text-secondary);
    font-size: 0.85rem; font-weight: 500;
    border-radius: var(--radius-md); transition: all var(--transition-fast);
}
.student-nav-links a:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.student-nav-links a.active { background: rgba(220,38,38,0.08); color: var(--red-500); }

.student-content { padding: 2rem; max-width: 1400px; margin: 0 auto; }

/* ═══════════════════════════════════════════════════
   DASHBOARD STATS — Red/Gold/Black Accents
   ═══════════════════════════════════════════════════ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem; margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg); padding: 1.5rem;
    position: relative; overflow: hidden;
    transition: all var(--transition-base);
}

.stat-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0;
    height: 4px; border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.stat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

.stat-card.red::before { background: var(--gradient-accent); }
.stat-card.gold::before { background: var(--gradient-gold); }
.stat-card.black::before { background: var(--gradient-dark); }
.stat-card.green::before { background: var(--gradient-success); }
.stat-card.blue::before { background: linear-gradient(135deg, #3b82f6, #60a5fa); }
.stat-card.purple::before { background: linear-gradient(135deg, #8b5cf6, #a78bfa); }
.stat-card.cyan::before { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.stat-card.pink::before { background: linear-gradient(135deg, #ec4899, #f472b6); }

.stat-card-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 0.5rem;
}

.stat-card-icon {
    width: 48px; height: 48px; border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem;
}

.stat-card.red .stat-card-icon { background: rgba(220,38,38,0.08); color: var(--red-500); }
.stat-card.gold .stat-card-icon { background: rgba(212,160,23,0.08); color: var(--gold-500); }
.stat-card.black .stat-card-icon { background: rgba(0,0,0,0.06); color: var(--black-700); }
.stat-card.green .stat-card-icon { background: rgba(16,185,129,0.08); color: var(--accent-green); }
.stat-card.blue .stat-card-icon { background: rgba(59,130,246,0.08); color: var(--accent-blue); }
.stat-card.purple .stat-card-icon { background: rgba(139,92,246,0.08); color: var(--accent-purple); }
.stat-card.cyan .stat-card-icon { background: rgba(6,182,212,0.08); color: var(--accent-cyan); }
.stat-card.pink .stat-card-icon { background: rgba(236,72,153,0.08); color: var(--accent-pink); }

[data-theme="dark"] .stat-card.black .stat-card-icon { background: rgba(255,255,255,0.08); color: #d4d4d4; }

.stat-card-value {
    font-size: 2rem; font-weight: 800; color: var(--text-primary);
    line-height: 1; margin-bottom: 0.25rem;
}
.stat-card-label {
    font-size: 0.8rem; font-weight: 500; color: var(--text-tertiary);
    text-transform: uppercase; letter-spacing: 0.5px;
}

/* ═══════════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════════ */
.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg); overflow: hidden;
    transition: box-shadow var(--transition-base);
}
.card:hover { box-shadow: var(--shadow-md); }

.card-header {
    padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border-color);
    display: flex; align-items: center; justify-content: space-between;
}
.card-title {
    font-size: 1rem; font-weight: 700; color: var(--text-primary);
    display: flex; align-items: center; gap: 0.5rem;
}
.card-body { padding: 1.5rem; }
.card-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--border-color); background: var(--bg-tertiary); }

/* ═══════════════════════════════════════════════════
   DATA TABLES
   ═══════════════════════════════════════════════════ */
.data-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.data-table thead th {
    padding: 0.75rem 1rem; font-size: 0.75rem; font-weight: 700;
    color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border-color); text-align: left; white-space: nowrap;
}
.data-table tbody tr { transition: background var(--transition-fast); }
.data-table tbody tr:hover { background: var(--bg-tertiary); }
.data-table tbody td {
    padding: 0.85rem 1rem; font-size: 0.85rem; color: var(--text-secondary);
    border-bottom: 1px solid var(--border-light); vertical-align: middle;
}
.data-table tbody td:first-child { font-weight: 500; color: var(--text-primary); }

/* ═══════════════════════════════════════════════════
   BADGES
   ═══════════════════════════════════════════════════ */
.badge {
    display: inline-flex; align-items: center; gap: 0.25rem;
    padding: 0.25rem 0.65rem; font-size: 0.7rem; font-weight: 600;
    border-radius: var(--radius-full); text-transform: uppercase;
    letter-spacing: 0.3px; white-space: nowrap;
}

.badge-red { background: rgba(220,38,38,0.08); color: var(--red-500); }
.badge-gold { background: rgba(212,160,23,0.08); color: var(--gold-600); }
.badge-black { background: rgba(0,0,0,0.06); color: var(--black-600); }
.badge-green { background: rgba(16,185,129,0.08); color: var(--accent-green); }
.badge-blue { background: rgba(59,130,246,0.08); color: var(--accent-blue); }
.badge-purple { background: rgba(139,92,246,0.08); color: var(--accent-purple); }
.badge-gray { background: rgba(100,116,139,0.08); color: var(--text-secondary); }
.badge-amber { background: rgba(245,158,11,0.08); color: #d97706; }
.badge-cyan { background: rgba(6,182,212,0.08); color: var(--accent-cyan); }

/* ═══════════════════════════════════════════════════
   ALERTS
   ═══════════════════════════════════════════════════ */
.alert {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 1rem 1.25rem; border-radius: var(--radius-md);
    font-size: 0.85rem; font-weight: 500; margin-bottom: 1rem;
    animation: alertSlideIn 0.3s ease-out;
}
@keyframes alertSlideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.alert-success { background: rgba(16,185,129,0.08); border: 1px solid rgba(16,185,129,0.15); color: #065f46; }
.alert-error { background: rgba(220,38,38,0.08); border: 1px solid rgba(220,38,38,0.15); color: #991b1b; }
.alert-warning { background: rgba(212,160,23,0.08); border: 1px solid rgba(212,160,23,0.15); color: #92400e; }
.alert-info { background: rgba(59,130,246,0.08); border: 1px solid rgba(59,130,246,0.15); color: #1e40af; }

[data-theme="dark"] .alert-success { color: #6ee7b7; }
[data-theme="dark"] .alert-error { color: #fca5a5; }
[data-theme="dark"] .alert-warning { color: #fcd34d; }
[data-theme="dark"] .alert-info { color: #93c5fd; }

.toast-container {
    position: fixed; top: 1rem; right: 1rem; z-index: 9999;
    display: flex; flex-direction: column; gap: 0.5rem;
}
.toast {
    padding: 1rem 1.5rem; border-radius: var(--radius-md);
    background: var(--bg-secondary); border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg); font-size: 0.85rem;
    animation: toastSlide 0.4s var(--transition-bounce); max-width: 400px;
}
@keyframes toastSlide {
    from { opacity: 0; transform: translateX(100%); }
    to { opacity: 1; transform: translateX(0); }
}

/* ═══════════════════════════════════════════════════
   CONTENT GRIDS
   ═══════════════════════════════════════════════════ */
.content-grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2-1 { grid-template-columns: 2fr 1fr; }
.grid-1-2 { grid-template-columns: 1fr 2fr; }

/* ═══════════════════════════════════════════════════
   EXAM CARDS
   ═══════════════════════════════════════════════════ */
.exam-card {
    background: var(--bg-secondary); border: 1px solid var(--border-color);
    border-radius: var(--radius-lg); padding: 1.5rem;
    transition: all var(--transition-base); position: relative; overflow: hidden;
}
.exam-card:hover {
    transform: translateY(-4px); box-shadow: var(--shadow-lg);
    border-color: var(--red-300);
}
.exam-card-subject {
    display: inline-block; padding: 0.2rem 0.6rem;
    border-radius: var(--radius-full); font-size: 0.7rem; font-weight: 600; margin-bottom: 0.75rem;
}
.exam-card-title {
    font-size: 1.05rem; font-weight: 700; color: var(--text-primary);
    margin-bottom: 0.5rem; line-height: 1.4;
}
.exam-card-meta {
    display: flex; flex-wrap: wrap; gap: 1rem;
    font-size: 0.8rem; color: var(--text-tertiary); margin-bottom: 1rem;
}
.exam-card-meta span { display: flex; align-items: center; gap: 0.3rem; }

/* ═══════════════════════════════════════════════════
   WELCOME BANNER — Red/Gold/Black
   ═══════════════════════════════════════════════════ */
.welcome-banner {
    background: var(--gradient-brand);
    border-radius: var(--radius-xl); padding: 2.5rem;
    color: #ffffff; margin-bottom: 2rem;
    position: relative; overflow: hidden;
    border: 1px solid rgba(220,38,38,0.2);
}
.welcome-banner::before {
    content: ''; position: absolute; top: -50%; right: -10%;
    width: 400px; height: 400px; border-radius: 50%;
    background: rgba(220,38,38,0.1);
}
.welcome-banner::after {
    content: ''; position: absolute; bottom: -30%; right: 10%;
    width: 200px; height: 200px; border-radius: 50%;
    background: rgba(212,160,23,0.08);
}
.welcome-banner h2 {
    font-size: 1.6rem; font-weight: 800; margin-bottom: 0.5rem;
    position: relative; z-index: 1;
}
.welcome-banner p {
    font-size: 0.95rem; opacity: 0.85; max-width: 500px;
    position: relative; z-index: 1;
}
.welcome-banner .gold-accent {
    color: var(--gold-300);
}

/* ═══════════════════════════════════════════════════
   EXAM TAKING INTERFACE
   ═══════════════════════════════════════════════════ */
.exam-container {
    max-width: 1000px; margin: 0 auto;
}

.exam-header {
    background: var(--bg-secondary); border: 1px solid var(--border-color);
    border-radius: var(--radius-lg); padding: 1.25rem 1.5rem;
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 1.5rem; position: sticky; top: 0; z-index: 30;
    backdrop-filter: blur(16px);
}

.exam-timer {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.5rem 1rem; background: var(--black-800); color: var(--gold-300);
    border-radius: var(--radius-md); font-family: 'JetBrains Mono', monospace;
    font-size: 1.1rem; font-weight: 600;
}
.exam-timer.warning { background: var(--red-600); color: #fff; animation: pulse 1s infinite; }
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.exam-progress {
    width: 100%; height: 6px; background: var(--bg-tertiary);
    border-radius: 3px; margin-bottom: 1.5rem; overflow: hidden;
}
.exam-progress-bar {
    height: 100%; background: var(--gradient-accent);
    border-radius: 3px; transition: width var(--transition-base);
}

.question-card {
    background: var(--bg-secondary); border: 1px solid var(--border-color);
    border-radius: var(--radius-lg); padding: 2rem;
    margin-bottom: 1.5rem;
}

.question-number {
    font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 1px; color: var(--red-500); margin-bottom: 0.75rem;
}

.question-text {
    font-size: 1.1rem; font-weight: 600; color: var(--text-primary);
    line-height: 1.6; margin-bottom: 1.5rem;
}

.option-list { display: grid; gap: 0.75rem; }

.option-item {
    display: flex; align-items: center; gap: 1rem;
    padding: 1rem 1.25rem; background: var(--bg-tertiary);
    border: 2px solid transparent; border-radius: var(--radius-md);
    cursor: pointer; transition: all var(--transition-fast);
    font-size: 0.95rem;
}
.option-item:hover {
    border-color: var(--red-300); background: rgba(220,38,38,0.03);
}
.option-item.selected {
    border-color: var(--red-500); background: rgba(220,38,38,0.06);
}
.option-item input[type="radio"],
.option-item input[type="checkbox"] { display: none; }

.option-marker {
    width: 32px; height: 32px; flex-shrink: 0;
    border-radius: var(--radius-full); border: 2px solid var(--border-color);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.8rem; color: var(--text-tertiary);
    transition: all var(--transition-fast);
}
.option-item.selected .option-marker {
    border-color: var(--red-500); background: var(--red-500); color: #fff;
}

.question-nav {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1.5rem 0;
}

.question-dots {
    display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.5rem;
}
.question-dot {
    width: 36px; height: 36px; border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem; font-weight: 600; cursor: pointer;
    border: 1px solid var(--border-color); background: var(--bg-secondary);
    color: var(--text-secondary); transition: all var(--transition-fast);
}
.question-dot:hover { border-color: var(--red-300); }
.question-dot.current { background: var(--red-500); color: #fff; border-color: var(--red-500); }
.question-dot.answered { background: var(--accent-green); color: #fff; border-color: var(--accent-green); }
.question-dot.bookmarked { border-color: var(--gold-500); box-shadow: 0 0 0 2px rgba(212,160,23,0.2); }

/* ═══════════════════════════════════════════════════
   EXAM COMPLETION PAGE
   ═══════════════════════════════════════════════════ */
.completion-container {
    display: flex; align-items: center; justify-content: center;
    min-height: 80vh;
}

.completion-card {
    text-align: center; max-width: 600px; width: 100%;
    background: var(--bg-secondary); border: 1px solid var(--border-color);
    border-radius: var(--radius-xl); padding: 4rem 3rem;
    box-shadow: var(--shadow-xl);
    animation: completionPop 0.8s var(--transition-bounce);
}
@keyframes completionPop {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

.completion-emoji {
    font-size: 5rem; margin-bottom: 1.5rem;
    animation: emojiFloat 2s ease-in-out infinite;
}
@keyframes emojiFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.completion-title {
    font-size: 2rem; font-weight: 800; color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.completion-message {
    font-size: 1.1rem; color: var(--text-secondary);
    margin-bottom: 2rem; line-height: 1.6;
}

.completion-score {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 1rem 2rem; background: var(--bg-tertiary);
    border-radius: var(--radius-lg); margin-bottom: 2rem;
    border: 2px solid var(--gold-400);
}
.completion-score-value {
    font-size: 2.5rem; font-weight: 900; color: var(--gold-600);
}
.completion-score-label {
    font-size: 0.85rem; color: var(--text-tertiary); text-align: left;
}

/* ═══════════════════════════════════════════════════
   EMPTY STATE
   ═══════════════════════════════════════════════════ */
.empty-state { text-align: center; padding: 3rem 2rem; }
.empty-state .icon { font-size: 3rem; margin-bottom: 1rem; opacity: 0.3; }
.empty-state h3 { font-size: 1.1rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 0.5rem; }
.empty-state p { font-size: 0.85rem; color: var(--text-tertiary); }

/* ═══════════════════════════════════════════════════
   ACTIVITY FEED
   ═══════════════════════════════════════════════════ */
.activity-list { list-style: none; }
.activity-item {
    display: flex; align-items: flex-start; gap: 0.75rem;
    padding: 0.85rem 0; border-bottom: 1px solid var(--border-light);
}
.activity-item:last-child { border-bottom: none; }
.activity-dot {
    width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex-shrink: 0;
}
.activity-dot.login { background: var(--accent-green); }
.activity-dot.logout { background: var(--red-500); }
.activity-dot.exam { background: var(--gold-500); }
.activity-dot.register { background: var(--accent-purple); }
.activity-dot.default { background: var(--text-tertiary); }

.activity-text { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.4; }
.activity-text strong { color: var(--text-primary); font-weight: 600; }
.activity-time { font-size: 0.7rem; color: var(--text-tertiary); margin-top: 0.2rem; }

/* ═══════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════ */
.page-footer {
    padding: 1.5rem 2rem; text-align: center;
    font-size: 0.75rem; color: var(--text-tertiary);
    border-top: 1px solid var(--border-color); margin-top: 2rem;
}
.page-footer a { color: var(--red-500); font-weight: 500; }

/* ═══════════════════════════════════════════════════
   MODAL
   ═══════════════════════════════════════════════════ */
.modal-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.5); z-index: 100;
    align-items: center; justify-content: center;
    backdrop-filter: blur(4px);
}
.modal-overlay.active { display: flex; }
.modal {
    background: var(--bg-secondary); border-radius: var(--radius-xl);
    padding: 2rem; max-width: 600px; width: 90%;
    box-shadow: var(--shadow-xl); animation: cardSlideUp 0.3s ease;
}
.modal-title {
    font-size: 1.2rem; font-weight: 700; margin-bottom: 1rem;
    color: var(--text-primary);
}

/* ═══════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .grid-2, .grid-3, .grid-2-1, .grid-1-2 { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .hamburger { display: block; }
    .page-content { padding: 1rem; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .auth-card { padding: 2rem; margin: 1rem; }
    .form-row { grid-template-columns: 1fr; }
    .topbar, .student-navbar { padding: 0 1rem; }
    .student-navbar { flex-wrap: wrap; height: auto; padding: 0.75rem 1rem; gap: 0.5rem; }
    .welcome-banner { padding: 1.5rem; }
    .welcome-banner h2 { font-size: 1.2rem; }
    .completion-card { padding: 2rem 1.5rem; }
}
@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════
   SCROLLBAR
   ═══════════════════════════════════════════════════ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-tertiary); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* ═══════════════════════════════════════════════════
   UTILITIES
   ═══════════════════════════════════════════════════ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-tertiary); }
.text-small { font-size: 0.8rem; }
.text-red { color: var(--red-500); }
.text-gold { color: var(--gold-500); }
.font-mono { font-family: 'JetBrains Mono', monospace; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.hidden { display: none !important; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sidebar-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.5); z-index: 45; backdrop-filter: blur(4px);
}
.sidebar-overlay.active { display: block; }

/* Gold divider */
.gold-divider {
    height: 2px; background: var(--gradient-gold);
    border: none; margin: 1.5rem 0; border-radius: 1px;
}

/* Profile section */
.profile-card {
    background: var(--bg-secondary); border: 1px solid var(--border-color);
    border-radius: var(--radius-lg); padding: 2rem; text-align: center;
}
.profile-avatar {
    width: 100px; height: 100px; border-radius: var(--radius-full);
    background: var(--gradient-accent);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 2.5rem; font-weight: 800;
    margin: 0 auto 1rem;
    border: 4px solid var(--gold-400);
}

/* ═══════════════════════════════════════════════════
   PROCTORING UI — Anti-Cheat Overlays
   ═══════════════════════════════════════════════════ */

/* Violation warning overlay */
#warning-overlay {
    display: none;
    position: fixed; inset: 0; z-index: 99999;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    justify-content: center; align-items: center;
    flex-direction: column; font-family: 'Inter', sans-serif;
    text-align: center; padding: 2rem;
}
#warning-overlay.show { display: flex; }

/* Red pulsing animation for critical violations */
@keyframes violationPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220,38,38,0.6); }
    50% { box-shadow: 0 0 0 20px rgba(220,38,38,0); }
}

/* Camera preview box */
#camera-preview {
    position: fixed;
    bottom: 16px; right: 16px;
    z-index: 9999;
    width: 160px; height: 120px;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 2px solid var(--red-500);
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
    background: #000;
}
#camera-preview video {
    width: 100%; height: 100%;
    object-fit: cover;
    transform: scaleX(-1); /* Mirror effect */
}
#camera-preview .rec-badge {
    position: absolute; top: 4px; left: 6px;
    font-size: 9px; color: var(--red-500); font-weight: 700;
    background: rgba(0,0,0,0.65); padding: 2px 6px;
    border-radius: 4px; letter-spacing: 0.5px;
}

/* Violation counter badge */
#violation-counter {
    position: fixed; top: 80px; right: 16px; z-index: 9999;
}

/* Proctoring status panel */
#proctoring-status {
    position: fixed; top: 80px; left: 16px; z-index: 9999;
}

/* Status indicator dots */
.proctor-indicator {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #525252;
    transition: background 0.3s ease;
}
.proctor-indicator.active { background: var(--accent-green); }
.proctor-indicator.inactive { background: var(--red-500); }
.proctor-indicator.warning {
    background: var(--gold-400);
    animation: blinkDot 1s infinite;
}
@keyframes blinkDot {
    0%, 100% { opacity: 1; } 50% { opacity: 0.3; }
}

/* Consent screen */
.proctor-consent {
    display: flex;
    position: fixed; inset: 0; z-index: 100000;
    background: rgba(0,0,0,0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    justify-content: center; align-items: center;
    padding: 1rem;
    overflow-y: auto;
}
.proctor-consent-card {
    background: #141414;
    border: 1px solid rgba(220,38,38,0.3);
    border-radius: 20px;
    padding: 3rem;
    max-width: 600px; width: 100%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.7), 0 0 40px rgba(220,38,38,0.08);
}

/* Exam locked overlay (when tab switch detected) */
.exam-locked-overlay {
    display: none;
    position: fixed; inset: 0; z-index: 99998;
    background: rgba(0,0,0,0.97);
    justify-content: center; align-items: center;
    flex-direction: column;
}
.exam-locked-overlay.show { display: flex; }

/* Violation flash effect on page */
@keyframes violationFlash {
    0% { box-shadow: inset 0 0 0 4px rgba(220,38,38,0); }
    25% { box-shadow: inset 0 0 0 4px rgba(220,38,38,0.8); }
    50% { box-shadow: inset 0 0 0 4px rgba(220,38,38,0); }
    75% { box-shadow: inset 0 0 0 4px rgba(220,38,38,0.5); }
    100% { box-shadow: inset 0 0 0 4px rgba(220,38,38,0); }
}
.violation-flash { animation: violationFlash 0.6s ease; }

/* Admin exam results — rank medals */
.rank-medal { font-size: 1.2rem; }

/* Declare results button — pulsing green when active */
.badge-declare-active {
    background: rgba(16,185,129,0.1);
    color: var(--accent-green);
    animation: declarePulse 2s infinite;
}
@keyframes declarePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(16,185,129,0.4); }
    50% { box-shadow: 0 0 0 6px rgba(16,185,129,0); }
}

/* btn-blue for proctored yes/no */
.btn-blue {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(59,130,246,0.3);
}
.btn-blue:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59,130,246,0.4);
    color: #ffffff;
}

/* Pending results notice */
.results-pending-card {
    background: var(--bg-tertiary);
    border: 2px dashed var(--gold-400);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    margin: 1.5rem 0;
}

/* Proctoring log table */
.proctor-log-type {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    background: rgba(220,38,38,0.08);
    color: var(--red-500);
    border-radius: 4px;
}

