/* Mobile hamburger menu shared by inner pages */
.menu-toggle {
    display: none;
    background: rgba(255,255,255,0.15);
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    width: 45px;
    height: 45px;
    border-radius: 12px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    z-index: 1001;
}

.menu-toggle:hover {
    background: rgba(255,255,255,0.25);
    transform: scale(1.05);
}

.menu-toggle .close-icon {
    display: none;
}

.menu-toggle.active .menu-icon {
    display: none;
}

.menu-toggle.active .close-icon {
    display: inline;
}

.menu-toggle {
    position: relative;
    overflow: hidden;
}

.menu-toggle::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    transform: translate(-50%, -50%);
    transition: width 0.5s, height 0.5s;
}

.menu-toggle:active::before {
    width: 100%;
    height: 100%;
}

@media (max-width: 768px) {
    @keyframes menuPhotoFloat {
        0%, 100% {
            background-position: center, center 52%;
        }

        50% {
            background-position: center, center 49%;
        }
    }

    .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    nav ul {
        position: fixed;
        top: 0;
        left: -100%;
        width: min(74vw, 292px);
        height: 100vh;
        padding: 92px 16px 22px;
        margin: 0;
        z-index: 1000;
        display: flex !important;
        flex-direction: column;
        list-style: none;
        border-radius: 0 28px 28px 0;
        background:
            radial-gradient(circle at 28px 88px, rgba(0,200,83,0.24), transparent 95px),
            radial-gradient(circle at 92% 22%, rgba(0,188,212,0.32), transparent 130px),
            linear-gradient(145deg, rgba(9,18,72,0.97), rgba(26,35,126,0.95) 54%, rgba(0,139,139,0.9));
        border-right: 0;
        box-shadow: 18px 0 45px rgba(0,0,0,0.35);
        backdrop-filter: blur(18px);
        isolation: isolate;
        overflow-x: hidden;
        overflow-y: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
        transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }

    nav ul::-webkit-scrollbar {
        width: 0;
        height: 0;
    }

    nav ul::before {
        content: "";
        position: absolute;
        inset: 0;
        z-index: 1;
        border-radius: 0 28px 28px 0;
        background: linear-gradient(135deg, rgba(8,15,60,0.78), rgba(26,35,126,0.52) 55%, rgba(0,139,139,0.38));
        background-size: auto;
        mask-image: linear-gradient(to bottom, rgba(0,0,0,0.9), rgba(0,0,0,0.35));
        opacity: 0.95;
        pointer-events: none;
    }

    nav ul::after {
        content: "";
        position: absolute;
        inset: 0;
        width: auto;
        height: auto;
        border-radius: 0 28px 28px 0;
        background:
            radial-gradient(circle at 72% 12%, rgba(56,189,248,0.30), transparent 90px),
            var(--mobile-menu-image, url("images/siswa.1.jpg"));
        background-size: auto, auto 124%;
        background-position: center, center 52%;
        background-repeat: no-repeat;
        animation: menuPhotoFloat 5s ease-in-out infinite;
        z-index: 0;
        pointer-events: none;
    }

    nav ul.active {
        left: 0;
    }

    nav ul li {
        position: relative;
        z-index: 2;
        width: 100%;
        margin: 0 0 8px;
        border-bottom: 0;
        opacity: 0;
        transform: translateX(-20px);
        transition: all 0.3s ease;
        transition-delay: calc(0.05s * var(--i, 0));
    }

    nav ul li:first-child::before {
        content: "Menu Halaman";
        display: block;
        margin: 0 0 10px;
        color: rgba(255,255,255,0.92);
        font-size: 0.86rem;
        font-weight: 800;
        letter-spacing: 0;
        text-transform: uppercase;
        text-shadow: 0 2px 10px rgba(0,0,0,0.28);
    }

    nav ul.active li {
        opacity: 1;
        transform: translateX(0);
    }

    nav ul li a {
        display: flex;
        align-items: center;
        gap: 12px;
        min-height: 48px;
        padding: 11px 12px;
        color: white;
        text-decoration: none;
        white-space: normal;
        border: 1px solid rgba(148,163,184,0.32);
        border-radius: 14px;
        background: linear-gradient(135deg, rgba(15,23,42,0.78), rgba(30,41,59,0.62));
        box-shadow: 0 10px 22px rgba(2,6,23,0.20), inset 0 0 0 1px rgba(255,255,255,0.04);
        font-size: 1rem;
        font-weight: 650;
        transition: all 0.25s ease;
    }

    nav ul li a::before {
        width: 30px;
        height: 30px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 30px;
        border-radius: 10px;
        background: rgba(15,23,42,0.48);
        color: #7dd3fc;
        font-family: "Font Awesome 6 Free";
        font-weight: 900;
        font-size: 0.9rem;
        box-shadow: inset 0 0 0 1px rgba(125,211,252,0.24);
    }

    nav ul li:nth-child(1) a::before { content: "\f015"; }
    nav ul li:nth-child(2) a::before { content: "\f19d"; }
    nav ul li:nth-child(3) a::before { content: "\f073"; }
    nav ul li:nth-child(4) a::before { content: "\f03e"; }
    nav ul li:nth-child(5) a::before { content: "\f0b1"; }
    nav ul li:nth-child(6) a::before { content: "\f3c5"; }

    nav ul li a:hover,
    nav ul li a.active {
        background: linear-gradient(135deg, rgba(14,165,233,0.34), rgba(15,23,42,0.70));
        border-color: rgba(125,211,252,0.48);
        transform: translateX(8px);
        box-shadow: 0 12px 24px rgba(2,6,23,0.28), inset 0 0 20px rgba(125,211,252,0.12);
    }

    .menu-overlay {
        position: fixed;
        inset: 0;
        z-index: 999;
        background: rgba(4,8,24,0.68);
        backdrop-filter: blur(6px);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    .menu-overlay.active {
        opacity: 1;
        visibility: visible;
    }
}

@media (max-width: 768px) and (max-height: 640px) {
    nav ul {
        padding-top: 82px;
        padding-bottom: 18px;
    }

    nav ul li {
        margin-bottom: 6px;
    }

    nav ul li a {
        min-height: 44px;
        padding-top: 9px;
        padding-bottom: 9px;
    }
}

@media (max-width: 480px) {
    nav ul {
        width: min(78vw, 278px);
        padding-left: 14px;
        padding-right: 14px;
    }
}
