/*
 | ============================================================================
 |  Portal Wali Murid — Navigasi Mobile (drawer)
 |
 |  CSS ini sengaja diletakkan di public/ (bukan hasil build Vite) supaya
 |  navigasi mobile tetap tampil benar walau `public/build` belum di-rebuild
 |  di server. Dimuat oleh komponen mobile-nav.blade.php.
 |
 |  Hanya berdampak di layar < 1024px — desktop memakai top navigation Filament.
 | ============================================================================
 */

/* Kunci scroll halaman saat drawer terbuka */
body.wali-nav-locked {
    overflow: hidden !important;
}

/* Hilangkan hamburger & sidebar bawaan Filament (kita pakai drawer sendiri) */
.fi-topbar-open-sidebar-btn,
.fi-topbar-close-sidebar-btn,
.fi-sidebar {
    display: none !important;
}

/* Sembunyikan drawer di desktop */
@media (min-width: 1024px) {
    .wali-mobile-nav {
        display: none !important;
    }
}

/* ── Tombol hamburger ── */
.wali-hamburger-btn {
    position: fixed !important;
    top: calc(env(safe-area-inset-top, 0px) + 0.375rem) !important;
    left: 0.5rem !important;
    z-index: 40 !important;
    /* display TANPA !important — biar x-show Alpine bisa menyembunyikan */
    display: inline-flex;
    align-items: center !important;
    justify-content: center !important;
    width: 2.75rem !important;
    height: 2.75rem !important;
    border-radius: 0.75rem !important;
    background-color: transparent !important;
    color: #041c39 !important;
    border: 0 !important;
    transition: background-color 150ms ease, transform 150ms ease !important;
    -webkit-tap-highlight-color: transparent !important;
}

.wali-hamburger-btn svg {
    width: 1.5rem !important;
    height: 1.5rem !important;
}

.wali-hamburger-btn:hover {
    background-color: rgba(4, 28, 57, 0.06) !important;
}

.wali-hamburger-btn:active {
    transform: scale(0.94) !important;
}

/* ── Overlay ── */
.wali-drawer-overlay {
    position: fixed !important;
    inset: 0 !important;
    z-index: 60 !important;
    background-color: rgba(4, 20, 40, 0.55) !important;
    -webkit-backdrop-filter: blur(3px) !important;
    backdrop-filter: blur(3px) !important;
}

/* ── Panel drawer ── */
.wali-drawer {
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    z-index: 70 !important;
    /* display TANPA !important — biar x-show Alpine bisa menyembunyikan */
    display: flex;
    flex-direction: column !important;
    width: min(86vw, 21rem) !important;
    background-color: #041c39 !important;
    background-image: linear-gradient(168deg, #06264d 0%, #041c39 58%, #041c39 100%) !important;
    color: #ffffff !important;
    border-top-right-radius: 1.5rem !important;
    border-bottom-right-radius: 1.5rem !important;
    box-shadow: 0 24px 60px -12px rgba(2, 12, 27, 0.65) !important;
    padding-top: calc(env(safe-area-inset-top, 0px) + 0.5rem) !important;
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 0.5rem) !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
}

/* Catatan: x-show Alpine menetapkan display:none inline. Untuk itu kita
   tidak memakai !important pada properti display elemen yang di-x-show. */

/* ── Header ── */
.wali-drawer-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 0.75rem !important;
    padding: 0.5rem 0.875rem 1rem !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.09) !important;
}

.wali-drawer-brand {
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
    min-width: 0 !important;
}

.wali-drawer-brand-logo {
    width: 2.5rem !important;
    height: 2.5rem !important;
    flex-shrink: 0 !important;
    object-fit: contain !important;
    border-radius: 0.75rem !important;
    background-color: rgba(255, 255, 255, 0.08) !important;
    padding: 0.25rem !important;
}

.wali-drawer-brand-text {
    display: flex !important;
    flex-direction: column !important;
    min-width: 0 !important;
    line-height: 1.15 !important;
}

.wali-drawer-brand-overline {
    font-size: 0.625rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.16em !important;
    text-transform: uppercase !important;
    color: rgba(255, 255, 255, 0.4) !important;
}

.wali-drawer-brand-title {
    font-size: 0.9375rem !important;
    font-weight: 800 !important;
    color: #ffffff !important;
}

.wali-drawer-close {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 2.25rem !important;
    height: 2.25rem !important;
    flex-shrink: 0 !important;
    border-radius: 0.7rem !important;
    background-color: rgba(255, 255, 255, 0.06) !important;
    color: rgba(255, 255, 255, 0.6) !important;
    transition: background-color 150ms ease, color 150ms ease !important;
}

.wali-drawer-close:hover {
    background-color: rgba(255, 255, 255, 0.14) !important;
    color: #ffffff !important;
}

/* ── Label seksi ── */
.wali-drawer-section {
    margin: 0 !important;
    padding: 1.25rem 1.25rem 0.5rem !important;
    font-size: 0.625rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.16em !important;
    text-transform: uppercase !important;
    color: rgba(255, 255, 255, 0.35) !important;
}

/* ── Menu ── */
.wali-drawer-nav {
    display: flex !important;
    flex: 1 !important;
    flex-direction: column !important;
    gap: 0.375rem !important;
    padding: 0 0.75rem 0.75rem !important;
}

.wali-drawer-item {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
    padding: 0.625rem 0.75rem !important;
    border-radius: 1rem !important;
    color: rgba(255, 255, 255, 0.78) !important;
    text-decoration: none !important;
    transition: background-color 150ms ease, color 150ms ease !important;
    -webkit-tap-highlight-color: transparent !important;
}

.wali-drawer-item:hover {
    background-color: rgba(255, 255, 255, 0.07) !important;
    color: #ffffff !important;
}

.wali-drawer-item-icon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 2.5rem !important;
    height: 2.5rem !important;
    flex-shrink: 0 !important;
    border-radius: 0.75rem !important;
    background-color: rgba(255, 255, 255, 0.08) !important;
    color: rgba(255, 255, 255, 0.85) !important;
    transition: background-color 150ms ease, color 150ms ease !important;
}

.wali-drawer-item-icon svg,
.wali-drawer-item-chevron {
    width: 1.25rem !important;
    height: 1.25rem !important;
    flex-shrink: 0 !important;
}

.wali-drawer-item-text {
    display: flex !important;
    flex: 1 !important;
    flex-direction: column !important;
    min-width: 0 !important;
    line-height: 1.2 !important;
}

.wali-drawer-item-label {
    font-size: 0.875rem !important;
    font-weight: 700 !important;
    color: inherit !important;
}

.wali-drawer-item-desc {
    margin-top: 0.1rem !important;
    font-size: 0.6875rem !important;
    font-weight: 500 !important;
    color: rgba(255, 255, 255, 0.45) !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.wali-drawer-item-chevron {
    width: 1rem !important;
    height: 1rem !important;
    opacity: 0.35 !important;
    transition: transform 150ms ease, opacity 150ms ease !important;
}

.wali-drawer-item:hover .wali-drawer-item-chevron {
    opacity: 0.8 !important;
    transform: translateX(2px) !important;
}

/* Item aktif */
.wali-drawer-item-active,
.wali-drawer-item-active:hover {
    background-color: rgba(109, 164, 68, 0.16) !important;
    color: #ffffff !important;
    box-shadow: inset 0 0 0 1px rgba(109, 164, 68, 0.45) !important;
}

.wali-drawer-item-active .wali-drawer-item-icon {
    background-color: #6da444 !important;
    background-image: linear-gradient(140deg, #84be59, #5b8d37) !important;
    color: #ffffff !important;
}

.wali-drawer-item-active .wali-drawer-item-desc {
    color: rgba(255, 255, 255, 0.6) !important;
}

/* ── Footer ── */
.wali-drawer-footer {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.625rem !important;
    padding: 0.875rem !important;
    border-top: 1px solid rgba(255, 255, 255, 0.09) !important;
    background-color: rgba(0, 0, 0, 0.14) !important;
}

.wali-drawer-user {
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
    padding: 0.625rem 0.75rem !important;
    border-radius: 0.875rem !important;
    background-color: rgba(255, 255, 255, 0.05) !important;
}

.wali-drawer-user-avatar {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 2.25rem !important;
    height: 2.25rem !important;
    flex-shrink: 0 !important;
    border-radius: 9999px !important;
    background-image: linear-gradient(140deg, #84be59, #5b8d37) !important;
    font-size: 0.875rem !important;
    font-weight: 800 !important;
    color: #ffffff !important;
}

.wali-drawer-user-text {
    display: flex !important;
    flex-direction: column !important;
    min-width: 0 !important;
}

.wali-drawer-user-caption {
    font-size: 0.625rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.1em !important;
    text-transform: uppercase !important;
    color: rgba(255, 255, 255, 0.4) !important;
}

.wali-drawer-user-name {
    font-size: 0.875rem !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.wali-drawer-logout {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem !important;
    width: 100% !important;
    min-height: 2.75rem !important;
    padding: 0.75rem !important;
    border-radius: 0.875rem !important;
    background-color: rgba(239, 68, 68, 0.12) !important;
    color: #fca5a5 !important;
    font-size: 0.875rem !important;
    font-weight: 700 !important;
    transition: background-color 150ms ease, color 150ms ease !important;
    -webkit-tap-highlight-color: transparent !important;
}

.wali-drawer-logout:hover {
    background-color: rgba(239, 68, 68, 0.22) !important;
    color: #fecaca !important;
}

/* ── Penyesuaian app bar di mobile (ruang untuk hamburger) ── */
@media (max-width: 1023px) {
    .fi-topbar {
        padding-left: 3.5rem !important;
        padding-right: 0.875rem !important;
        height: 3.5rem !important;
        min-height: 3.5rem !important;
        max-height: 3.5rem !important;
        flex-wrap: nowrap !important;
        gap: 0.5rem !important;
    }

    .fi-topbar .fi-logo {
        height: 2.25rem !important;
        width: auto !important;
    }

    .fi-topbar-nav-groups {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .fi-topbar .fi-logo {
        height: 2rem !important;
    }
}
