/* ==========================================================================
   MOBILE BOTTOM NAVIGATION & DRAWER SYSTEM (Mobbin Standard)
   Designed for Silat Registration Platform
   ========================================================================== */

/* 1. Sembunyikan Sidebar Lama di Mobile & Tambahkan Bottom Padding */
@media (max-width: 991.98px) {
    /* Sembunyikan sidebar bawaan yang menumpuk di atas konten */
    .user-account-nav.user-account-sidebar,
    .mobile-sidebar-toggle,
    .col-lg-3:has(.user-account-sidebar),
    .col-md-3:has(.user-account-sidebar),
    .col-lg-12:has(.user-account-sidebar),
    .col-md-12:has(.user-account-sidebar) {
        display: none !important;
    }

    /* Pastikan kolom konten utama mengambil lebar penuh tanpa offset */
    .main-section .col-lg-9,
    .main-section .col-md-9 {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
    }

    /* Safety Bottom Spacing agar elemen paling bawah halaman tidak tertutup dock bar */
    body:has(.mobile-bottom-dock) .main-section,
    body:has(.mobile-bottom-dock) .user-dashboard,
    body:has(.mobile-bottom-dock) footer {
        padding-bottom: 85px !important;
    }
}

/* 2. Mobile Bottom Dock Bar */
.mobile-bottom-dock {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 62px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.06);
    z-index: 1060;
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 0 4px;
}

/* Di desktop / tablet lebar (>= 992px), sembunyikan dock sepenuhnya */
@media (min-width: 992px) {
    .mobile-bottom-dock,
    #mobileMenuDrawer {
        display: none !important;
    }
}

/* 3. Dock Items & Action Buttons */
.mobile-bottom-dock .dock-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-decoration: none !important;
    color: #64748b;
    position: relative;
    padding: 4px 2px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    background: transparent;
    border: none;
}

.mobile-bottom-dock .dock-item i {
    font-size: 19px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 3px;
    transition: transform 0.2s ease, color 0.2s ease;
}

.mobile-bottom-dock .dock-item .dock-label {
    font-size: 10.5px;
    font-weight: 500;
    letter-spacing: -0.01em;
    line-height: 1.1;
    color: inherit;
    white-space: nowrap;
}

/* Active State: Elevated Pill & Primary Color */
.mobile-bottom-dock .dock-item.active {
    color: #dc2626; /* Merah Brand Silat */
}

.mobile-bottom-dock .dock-item.active i {
    transform: translateY(-1px);
    color: #dc2626;
}

.mobile-bottom-dock .dock-item.active .dock-label {
    font-weight: 700;
    color: #dc2626;
}

/* Micro Dot Indicator di Bawah Active Item */
.mobile-bottom-dock .dock-item.active::after {
    content: '';
    position: absolute;
    bottom: 4px;
    width: 4px;
    height: 4px;
    background: #dc2626;
    border-radius: 50%;
}

/* Tap Feedback */
.mobile-bottom-dock .dock-item:active {
    transform: scale(0.94);
    opacity: 0.8;
}

/* Badge Notifikasi pada Dock Bar */
.mobile-bottom-dock .dock-item .dock-badge {
    position: absolute;
    top: 5px;
    right: calc(50% - 18px);
    background: #ef4444;
    color: #ffffff;
    font-size: 9.5px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 999px;
    border: 2px solid #ffffff;
    line-height: 1.1;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.mobile-bottom-dock .dock-item .dock-badge-amber {
    background: #f59e0b;
}

/* 4. Offcanvas Mobile Drawer ("Lainnya") */
.mobile-drawer-modal {
    z-index: 1070 !important;
}

.mobile-drawer-modal .modal-dialog {
    margin: 0;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 100%;
}

.mobile-drawer-modal .modal-content {
    border: none;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    box-shadow: 0 -10px 40px rgba(15, 23, 42, 0.2);
    background: #ffffff;
    max-height: 82vh;
    display: flex;
    flex-direction: column;
}

.mobile-drawer-header {
    padding: 14px 20px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-bottom: 1px solid #f1f5f9;
    position: relative;
}

/* Drag Pill Handle */
.mobile-drawer-header .drawer-drag-handle {
    width: 38px;
    height: 4.5px;
    background: #cbd5e1;
    border-radius: 999px;
    margin-bottom: 12px;
}

.mobile-drawer-header .drawer-title-row {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mobile-drawer-header .drawer-title {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mobile-drawer-body {
    padding: 12px 16px 36px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.drawer-nav-container,
.drawer-nav-list {
    display: block !important;
    width: 100% !important;
}

.drawer-nav-list ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.drawer-nav-list ul li {
    margin-bottom: 4px !important;
    border: none !important;
    padding: 0 !important;
    list-style: none !important;
}

.drawer-nav-list ul li a {
    display: flex !important;
    align-items: center !important;
    padding: 11px 14px !important;
    color: #334155 !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    border-radius: 10px !important;
    transition: all 0.2s ease !important;
    text-decoration: none !important;
    line-height: normal !important;
    background: #f8fafc !important;
    border: 1px solid #f1f5f9 !important;
}

.drawer-nav-list ul li a:hover,
.drawer-nav-list ul li a:active {
    background-color: #f1f5f9 !important;
    color: #0f172a !important;
    border-color: #e2e8f0 !important;
}

.drawer-nav-list ul li.active a {
    background-color: #fef2f2 !important;
    color: #dc2626 !important;
    font-weight: 700 !important;
    border-color: #fecaca !important;
}

.drawer-nav-list ul li a i {
    margin-right: 12px !important;
    font-size: 16px !important;
    width: 22px !important;
    text-align: center !important;
    color: #64748b !important;
    transition: all 0.2s ease !important;
}

.drawer-nav-list ul li.active a i {
    color: #dc2626 !important;
}

/* 5. Modern Section Headers & Menu Links di Desktop & Drawer */
.sidebar-section-header {
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.06em !important;
    color: #94a3b8 !important;
    margin: 18px 0 8px 12px !important;
    display: block !important;
    user-select: none;
}

.sidebar-section-header:first-child {
    margin-top: 4px !important;
}

/* Right-aligned pill badge (Stripe / Linear style) */
.nav-badge-pill {
    margin-left: auto !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    padding: 2.5px 8px !important;
    border-radius: 999px !important;
    line-height: 1.2 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.nav-badge-pill-amber {
    background-color: #fef3c7 !important;
    color: #b45309 !important;
    border: 1px solid #fde68a !important;
}

.nav-badge-pill-blue {
    background-color: #e0f2fe !important;
    color: #0369a1 !important;
    border: 1px solid #bae6fd !important;
}

.nav-badge-pill-emerald {
    background-color: #d1fae5 !important;
    color: #047857 !important;
    border: 1px solid #a7f3d0 !important;
}

/* 6. Compact Mobile Welcome Banner (Menghemat Ruang Vertikal di HP) */
@media (max-width: 768px) {
    .dashboard-welcome-clean-banner {
        padding: 12px 14px !important;
        margin-bottom: 16px !important;
        border-radius: 12px !important;
        border-left-width: 4px !important;
        gap: 10px !important;
    }

    .welcome-clean-left {
        gap: 10px !important;
        min-width: 0 !important;
        width: 100% !important;
    }

    .welcome-clean-icon-badge {
        width: 36px !important;
        height: 36px !important;
        font-size: 18px !important;
        border-radius: 9px !important;
    }

    .welcome-clean-title {
        font-size: 14.5px !important;
        margin: 0 !important;
        line-height: 1.25 !important;
    }

    .welcome-user-meta-bar {
        margin: 3px 0 0 0 !important;
        gap: 4px 8px !important;
    }

    .welcome-meta-item {
        font-size: 11px !important;
    }

    .welcome-meta-badge {
        font-size: 10px !important;
        padding: 1.5px 7px !important;
    }

    /* Di mobile, sembunyikan deskripsi panjang agar langsung ke inti dashboard */
    .welcome-clean-subtitle {
        display: none !important;
    }

    /* Tombol aksi dibuat 1 baris split atau ringkas horizontal */
    .welcome-clean-actions {
        width: 100% !important;
        display: flex !important;
        flex-direction: row !important;
        gap: 8px !important;
        margin-top: 4px !important;
    }

    .btn-clean-primary,
    .btn-clean-secondary {
        flex: 1 !important;
        padding: 7px 10px !important;
        font-size: 12px !important;
        border-radius: 7px !important;
        justify-content: center !important;
        white-space: nowrap !important;
    }

    .btn-clean-primary i,
    .btn-clean-secondary i {
        font-size: 12px !important;
        margin-right: 4px !important;
    }

    /* 7. Compact Metric Cards di Mobile (2 Kolom per Baris, Ramping & Bersih) */
    .metric-card-modern {
        padding: 12px 14px !important;
        margin-bottom: 0 !important;
        border-radius: 12px !important;
        min-height: 80px !important;
    }

    .metric-card-title {
        font-size: 10.5px !important;
        margin-bottom: 4px !important;
        letter-spacing: 0.02em !important;
    }

    .metric-card-title span {
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .metric-card-title i {
        font-size: 11px !important;
    }

    .metric-card-value {
        font-size: 20px !important;
        line-height: 1.1 !important;
    }

    .metric-card-icon-bg {
        font-size: 32px !important;
        right: 10px !important;
        bottom: 8px !important;
        opacity: 0.15 !important;
    }
}

