/* ============================== */
/* MOBILE FOOTER NAV FIX          */
/* ============================== */

@media (max-width: 768px) {

    /* Hide default sidebar/nav on mobile */
    .sidebar,
    .nav-menu {
        display: none !important;
    }

    /* Mobile Bottom Navigation Container */
    .mobile-bottom-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 70px;
        background: #3e2723;
        display: flex;
        justify-content: space-around;
        align-items: center;
        z-index: 10000;
        padding-bottom: env(safe-area-inset-bottom);
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
        border-top: 1px solid #5d4037;
    }

    /* Nav Items */
    .mobile-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        color: #a1887f;
        font-size: 10px;
        text-decoration: none;
        width: 20%;
        height: 100%;
        transition: all 0.2s ease;
        cursor: pointer;
    }

    .mobile-nav-item.active,
    .mobile-nav-item.active-all {
        color: #ffb74d;
    }

    .mobile-nav-item .icon-wrapper {
        margin-bottom: 4px;
    }

    .mobile-nav-item i {
        width: 24px;
        height: 24px;
    }

    /* Special Center Button (Enes'e Sor) */
    .mobile-nav-item.special-center {
        position: relative;
        top: -20px;
        background: #ffb74d;
        color: #3e2723;
        width: 60px;
        height: 60px;
        border-radius: 50%;
        box-shadow: 0 4px 15px rgba(255, 183, 77, 0.4);
        border: 4px solid #2d1b18;
        justify-content: center;
    }

    .mobile-nav-item.special-center .icon-wrapper {
        margin-bottom: 0;
    }

    .mobile-nav-item.special-center .label {
        position: absolute;
        bottom: -20px;
        width: 100px;
        text-align: center;
        color: #ffb74d;
        font-weight: bold;
    }

    /* Mobile All Menu Overlay */
    .mobile-all-menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(45, 27, 24, 0.95);
        backdrop-filter: blur(10px);
        z-index: 10001;
        display: flex;
        flex-direction: column;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
        padding: 20px;
        padding-bottom: 100px;
        overflow-y: auto;
    }

    .mobile-all-menu-overlay.show {
        opacity: 1;
        pointer-events: auto;
    }

    .menu-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 30px;
        color: #ffb74d;
        font-size: 1.5rem;
        font-weight: bold;
    }

    .close-btn {
        background: none;
        border: none;
        color: #fff;
        cursor: pointer;
    }

    .menu-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }

    .menu-grid-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        color: #d7ccc8;
        gap: 10px;
        cursor: pointer;
    }

    .menu-grid-item.active {
        color: #ffb74d;
    }

    .menu-icon {
        width: 60px;
        height: 60px;
        border-radius: 16px;
        background: rgba(255, 255, 255, 0.1);
        display: flex;
        align-items: center;
        justify-content: center;
        transition: transform 0.2s;
    }

    .menu-grid-item:active .menu-icon {
        transform: scale(0.95);
    }

    /* Adjust main content padding */
    .main-content {
        padding-bottom: 90px !important;
    }

    /* ============================== */
    /* UI IMPROVEMENTS (Logo & Clock) */
    /* ============================== */

    /* Mobile Dashboard Logo - SHOW on mobile */
    .mobile-dashboard-logo {
        display: block;
        max-height: 40px;
        width: auto;
    }

    .page-title.hidden-on-mobile {
        display: none;
    }

    /* Header Actions & Clock */
    .header-actions {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 4px;
    }

    .action-buttons {
        display: flex;
        gap: 8px;
    }

    .icon-btn {
        background: rgba(255, 255, 255, 0.1);
        border: none;
        color: white;
        padding: 8px;
        border-radius: 8px;
        cursor: pointer;
    }
}

/* ============================== */
/* DESKTOP STYLES                 */
/* ============================== */
@media (min-width: 769px) {

    /* Hide mobile-only dashboard logo on desktop */
    .mobile-dashboard-logo {
        display: none !important;
    }

    .header-clock {
        position: absolute;
        top: 1rem;
        right: 1rem;
        color: rgba(255, 255, 255, 0.5);
        font-family: monospace;
    }
}

/* ============================== */
/* EXAM TABLE STYLES              */
/* ============================== */
.exam-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.9rem;
}

.exam-table th,
.exam-table td {
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.5rem;
    text-align: left;
}

.exam-table th {
    background: rgba(255, 255, 255, 0.1);
    font-weight: bold;
}

/* Math formatting */
sup,
sub {
    font-size: 0.75em;
    line-height: 0;
    position: relative;
    vertical-align: baseline;
}

sup {
    top: -0.5em;
}

sub {
    bottom: -0.25em;
}