:root {
    --primary: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.4);
    --secondary: #a855f7;
    --dark-bg: #030014;
    --glass-surface: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-main: #ffffff;
    --text-muted: #94a3b8;
    --accent-red: #f43f5e;
    --accent-green: #10b981;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    margin: 0;
    font-family: 'Outfit', sans-serif;
    background-color: var(--dark-bg);
    color: var(--text-main);
    overflow: hidden;
    height: 100vh;
}

/* Auth Screen */
.screen {
    display: none;
    height: 100vh;
    animation: fadeIn 0.5s ease;
}

.screen.active {
    display: flex;
}

#auth-screen {
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at 50% 50%, #1e1b4b 0%, #000 70%);
}

.glass-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
    transition: 0.3s;
}

.login-card {
    width: 100%;
    max-width: 450px;
    text-align: center;
}

.logo-badge {
    font-size: 3rem;
    margin-bottom: 20px;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-family: 'Space Grotesk', sans-serif;
    background: linear-gradient(to right, #818cf8, #d8b4fe);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

p {
    color: var(--text-muted);
    margin-bottom: 40px;
}

.input-group {
    position: relative;
    margin-bottom: 20px;
}

.input-group i {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.input-group input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 15px 15px 15px 50px;
    color: white;
    font-size: 1rem;
    transition: 0.3s;
}

.input-group input:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.1);
    outline: none;
}

.btn-login {
    width: 100%;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    color: white;
    border: none;
    padding: 16px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    transition: 0.3s;
    margin-top: 10px;
}

.btn-login:hover {
    transform: scale(1.02);
    box-shadow: 0 10px 30px var(--primary-glow);
}

.error-msg {
    color: var(--accent-red);
    margin-top: 15px;
    font-size: 0.9rem;
}

/* Dashboard Layout */
#dashboard-screen {
    display: flex;
}

.side-nav {
    width: 280px;
    background: rgba(0, 0, 0, 0.5);
    border-right: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    padding: 30px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 50px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
}

.nav-menu {
    list-style: none;
    flex: 1;
}

.nav-menu li {
    padding: 16px 20px;
    margin-bottom: 8px;
    border-radius: 12px;
    cursor: pointer;
    color: var(--text-muted);
    font-weight: 600;
    transition: 0.3s;
    display: flex;
    align-items: center;
    gap: 15px;
}

.nav-menu li:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.nav-menu li.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 10px 20px var(--primary-glow);
}

.nav-footer button {
    width: 100%;
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    padding: 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: 0.3s;
}

.nav-footer button:hover {
    background: var(--accent-red);
    color: white;
    border-color: var(--accent-red);
}

.content {
    flex: 1;
    overflow-y: auto;
    padding: 40px;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 40px;
}

#school-name-display {
    font-size: 2.2rem;
    font-family: 'Space Grotesk', sans-serif;
    margin-bottom: 5px;
}

#batch-id-display {
    color: var(--text-muted);
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.btn-refresh {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: white;
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    padding: 30px;
    border-radius: 20px;
    position: relative;
    overflow: hidden;
}

.stat-card .label {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 1.5px;
    display: block;
    margin-bottom: 10px;
}

.stat-card h3 {
    font-size: 2.5rem;
    font-weight: 800;
}

.stat-card .icon {
    position: absolute;
    right: 20px;
    bottom: 20px;
    font-size: 2rem;
    opacity: 0.1;
    color: var(--primary);
}

.progress-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    margin-top: 15px;
}

#score-progress {
    height: 100%;
    background: var(--primary);
    box-shadow: 0 0 10px var(--primary);
}

.main-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}

.chart-container,
.top-list {
    padding: 30px;
}

h3 {
    margin-bottom: 25px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.2rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Majors List */
.list-items {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.major-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
}

.major-rank {
    width: 32px;
    height: 32px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.9rem;
}

.major-info {
    flex: 1;
}

.major-name {
    font-weight: 600;
    display: block;
}

.major-level {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.major-score {
    font-weight: 800;
    color: var(--primary);
}

/* Sections */
.dashboard-view {
    display: none;
    animation: fadeIn 0.3s ease;
}

.dashboard-view.active {
    display: block;
}

.grid-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.class-card {
    padding: 24px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 20px;
    border: 1px solid var(--glass-border);
}

.class-card h4 {
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.class-stat {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.class-stat span:first-child {
    color: var(--text-muted);
}

/* Tables */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 20px;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border-bottom: 1px solid var(--glass-border);
}

td {
    padding: 20px;
    border-bottom: 1px solid var(--glass-border);
}

tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Student Bubbles Grid */
.student-grid-mini {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 15px 0;
}

.student-bubble {
    width: 20px;
    height: 20px;
    background: var(--primary);
    border-radius: 50%;
    opacity: 0.6;
    transition: 0.3s;
}

.stat-footer {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 10px;
    font-weight: 600;
}

/* Chapters List */
.chapters-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.chapter-row {
    margin-bottom: 5px;
}

.chapter-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.chapter-label {
    font-weight: 600;
}

.progress-track {
    height: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 1s ease;
}

.blocage-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(244, 63, 94, 0.1);
    color: var(--accent-red);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    margin-top: 5px;
    border: 1px solid rgba(244, 63, 94, 0.2);
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(10px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    width: 90%;
    max-width: 400px;
}

.modal-btns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 25px;
}

.btn-cancel, .btn-confirm, .btn-secondary {
    padding: 12px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    border: none;
}

.btn-cancel { background: rgba(255,255,255,0.05); color: white; }
.btn-confirm { background: var(--primary); color: white; }
.btn-secondary { background: var(--secondary); color: white; }

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.1);
}

@media print {
    .sidebar, .btn-secondary, .logout-btn, button, .modal-overlay, header .header-actions {
        display: none !important;
    }
    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
    }
    .glass-card {
        border: 1px solid #ccc !important;
        background: white !important;
        color: black !important;
        box-shadow: none !important;
    }
    .stat-card h3, .chapter-label, .chapter-percent {
        color: black !important;
    }
    body {
        background: white !important;
        color: black !important;
    }
}