:root {
    --primary-emerald: #1b5e20;
    --primary-light: #2e7d32;
    --accent-gold: #d4af37;
    --bg-mint: #f1f8f1;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.2);
    --text-dark: #1a1a1a;
    --text-muted: #6c757d;
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.05);
    --shadow-premium: 0 15px 35px rgba(27, 94, 32, 0.1);
}

/* Premium Navigation Bar */
.premium-nav-container {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--glass-border);
    padding: 10px 15px;
    margin: -10px -15px 20px -15px;
}

.premium-nav-bar {
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: white;
    border-radius: 20px;
    padding: 8px;
    box-shadow: var(--shadow-soft);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 8px 12px;
    border-radius: 15px;
    position: relative;
    flex: 1;
}

.nav-item i {
    font-size: 20px;
    color: var(--text-muted);
    transition: inherit;
}

.nav-item span {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-item.active {
    background: var(--bg-mint);
}

.nav-item.active i {
    color: var(--primary-emerald);
    transform: scale(1.1);
}

.nav-item.active span {
    color: var(--primary-emerald);
}

.nav-item.selected {
    border-bottom: 2px solid var(--accent-gold);
}

/* Options Drawer */
.options-drawer {
    background: white;
    border-radius: 0 0 25px 25px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    max-height: 0;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.options-drawer.open {
    max-height: 400px;
    overflow-y: auto;
    padding: 15px;
    border-top: 1px solid #f0f0f0;
    margin-top: 10px;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-emerald) #f0f0f0;
}

.options-drawer.open::-webkit-scrollbar {
    width: 6px;
}

.options-drawer.open::-webkit-scrollbar-track {
    background: #f0f0f0;
}

.options-drawer.open::-webkit-scrollbar-thumb {
    background-color: var(--primary-emerald);
    border-radius: 10px;
}

.option-pill {
    padding: 10px 15px;
    margin: 5px;
    border-radius: 12px;
    background: #f8faf8;
    display: inline-block;
    font-size: 14px;
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.option-pill:hover {
    background: var(--bg-mint);
    border-color: var(--primary-light);
}

.option-pill.active {
    background: var(--primary-emerald);
    color: white;
}

/* Student Cards */
.student-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 10px;
    padding-bottom: 120px;
    /* Safe Zone for Sticky Footer */
}

.student-card {
    background: white;
    border-radius: 20px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: var(--shadow-soft);
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.student-card:focus-within {
    transform: translateY(-5px);
    box-shadow: var(--shadow-premium);
    border-color: var(--primary-light);
}

.student-avatar {
    width: 50px;
    height: 50px;
    border-radius: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-weight: bold;
    font-size: 18px;
}

.student-info {
    flex: 1;
}

.student-name {
    font-weight: 700;
    font-size: 14px;
    color: var(--text-dark);
}

.student-id {
    font-size: 11px;
    color: var(--text-muted);
}

.score-input-wrapper {
    width: 70px;
}

.score-input {
    width: 100%;
    padding: 10px;
    border-radius: 12px;
    border: 2px solid #f0f0f0;
    text-align: center;
    font-weight: 700;
    font-size: 16px;
    transition: all 0.3s ease;
}

.score-input:focus {
    border-color: var(--primary-emerald);
    background: var(--bg-mint);
    outline: none;
}

/* Sticky Footer */
.premium-footer-bar {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background: var(--primary-emerald);
    color: white;
    border-radius: 20px;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 10px 30px rgba(27, 94, 32, 0.4);
    z-index: 2000;
    transform: translateY(200%);
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.premium-footer-bar.visible {
    transform: translateY(0);
}

.footer-summary {
    display: flex;
    flex-direction: column;
}

.footer-summary .main {
    font-weight: 700;
    font-size: 14px;
}

.footer-summary .sub {
    font-size: 10px;
    opacity: 0.8;
}

.footer-action-btn {
    background: var(--accent-gold);
    color: var(--primary-emerald);
    border: none;
    padding: 10px 18px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
}

/* Results Tab Premium Overhaul */
.insights-carousel {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding: 10px 5px 25px 5px;
    margin: 0 -15px 10px -15px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    white-space: nowrap;
    /* Prevent wrapping */
    cursor: grab;
}

.insights-carousel:active {
    cursor: grabbing;
}

.insights-carousel::-webkit-scrollbar {
    display: none;
}

.insight-card {
    min-width: 140px;
    background: white;
    border-radius: 20px;
    padding: 15px;
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    border: 1px solid var(--glass-border);
}

.insight-card i {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.insight-card .value {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-dark);
}

.insight-card .label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 700;
}

/* Result Tiles */
.results-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding-bottom: 150px;
    /* Safe zone for navigation */
}

.result-tile {
    background: white;
    border-radius: 20px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--glass-border);
}

.result-tile:active {
    transform: scale(0.98);
    background: var(--bg-mint);
}

.grade-bar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 6px;
    border-radius: 0 4px 4px 0;
}

.grade-A {
    background-color: #1b5e20;
}

.grade-B {
    background-color: #2e7d32;
}

.grade-C {
    background-color: #d4af37;
}

.grade-D {
    background-color: #e67e22;
}

.grade-F {
    background-color: #c0392b;
}

.result-main {
    flex: 1;
}

.result-student {
    font-weight: 700;
    font-size: 15px;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.result-sub {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    gap: 10px;
}

.result-score-badges {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.total-score {
    font-size: 20px;
    font-weight: 800;
    color: var(--primary-emerald);
}

.grade-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    color: white;
}

/* Result Detail Drawer */
.result-drawer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-radius: 25px 25px 0 0;
    z-index: 3000;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.15);
    padding: 20px;
}

.result-drawer.open {
    transform: translateY(0);
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.drawer-handle {
    width: 40px;
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    margin: -10px auto 20px auto;
}

.ca-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.ca-item {
    background: var(--bg-mint);
    padding: 15px;
    border-radius: 15px;
    text-align: center;
}

.ca-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 700;
    display: block;
    margin-bottom: 5px;
}

.ca-value {
    font-size: 18px;
    font-weight: 800;
    color: var(--primary-emerald);
}

.exam-section {
    background: #fff8e1;
    padding: 20px;
    border-radius: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

/* E-Note Premium Overhaul */
.enote-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 20px;
    padding-bottom: 150px;
}

.enote-tile {
    background: white;
    border-radius: 20px;
    padding: 20px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.enote-tile:hover {
    transform: translateY(-5px);
    box-shadow: 10px 10px 30px rgba(0, 0, 0, 0.08);
    border-color: var(--primary-emerald);
}

.enote-icon-wrapper {
    width: 60px;
    height: 60px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-bottom: 15px;
    transition: transform 0.3s ease;
}

.enote-tile:hover .enote-icon-wrapper {
    transform: scale(1.1);
}

/* File Type Colors */
.file-pdf {
    background: #fee2e2;
    color: #ef4444;
}

.file-doc {
    background: #e0f2fe;
    color: #0ea5e9;
}

.file-img {
    background: #f0fdf4;
    color: #22c55e;
}

.file-other {
    background: #f3f4f6;
    color: #6b7280;
}

.enote-info {
    width: 100%;
}

.enote-subject {
    font-weight: 700;
    font-size: 14px;
    color: var(--text-dark);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.enote-meta {
    font-size: 10px;
    color: var(--text-muted);
    display: flex;
    justify-content: center;
    gap: 8px;
}

/* Tactile Upload Form */
.premium-upload-form {
    background: white;
    padding: 20px;
    border-radius: 25px;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--glass-border);
    margin-top: 10px;
}

.liquid-dropzone {
    border: 2px dashed #e0e0e0;
    border-radius: 20px;
    padding: 40px 20px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    margin-top: 15px;
    background: #fafafa;
}

.liquid-dropzone.dragover {
    border-color: var(--primary-emerald);
    background: var(--bg-mint);
    transform: scale(0.98);
}

.liquid-dropzone i {
    font-size: 40px;
    color: var(--primary-emerald);
    margin-bottom: 15px;
    display: block;
}

.liquid-dropzone p {
    font-size: 13px;
    color: var(--text-muted);
}

.liquid-dropzone span {
    color: var(--primary-emerald);
    font-weight: 600;
}

/* Selection Drawers Context */
.enote-selection-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.enote-select-item {
    flex: 1;
    background: white;
    padding: 12px;
    border-radius: 15px;
    border: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.enote-select-item.selected {
    background: var(--bg-mint);
    border-color: var(--primary-emerald);
}

.enote-select-item i {
    font-size: 16px;
    color: var(--text-muted);
}

.enote-select-item.selected i {
    color: var(--primary-emerald);
}

.enote-select-item span {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
}

/* Staggered Grid Animation */
@keyframes enoteAppear {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.enote-tile {
    animation: enoteAppear 0.4s ease forwards;
}

/* Video Splash Screen */
.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.8s;
}

.splash-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.splash-screen.fade-out {
    opacity: 0;
    visibility: hidden;
}

/* Hide main content initially to ensure smooth transition */
#mainBody {
    overflow: hidden;
}

/* Allow scrolling once splash is gone */
#mainBody.splash-gone {
    overflow: auto;
}