/* Mobile Responsive & PWA Enhancements */

/* Touch Friendly Targets */
.btn, .nav-link, .form-control, .form-select {
    min-height: 42px;
}

/* Mobile Bottom Navigation Bar for Wali Santri */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #ffffff;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1040;
    display: none;
}

.mobile-bottom-nav .nav-item {
    flex: 1;
    text-align: center;
}

.mobile-bottom-nav .nav-link {
    color: #6c757d;
    font-size: 0.75rem;
    padding: 8px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-top: 3px solid transparent;
}

.mobile-bottom-nav .nav-link i {
    font-size: 1.2rem;
    margin-bottom: 2px;
}

.mobile-bottom-nav .nav-link.active {
    color: #198754;
    font-weight: bold;
    border-top-color: #198754;
    background-color: #f8f9fa;
}

/* Sidebar Backdrop for Mobile */
#sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1045;
    opacity: 0;
    transition: opacity 0.25s ease-out;
}

/* Screen Size Specific Adjustments */
@media (max-width: 768px) {
    /* Show mobile bottom nav */
    .mobile-bottom-nav {
        display: flex !important;
    }

    /* Add bottom padding to body so content isn't covered by bottom nav */
    body.has-bottom-nav {
        padding-bottom: 70px !important;
    }

    /* Backend Sidebar Drawer on Mobile */
    #sidebar-wrapper {
        margin-left: calc(-1 * var(--sidebar-width)) !important;
        position: fixed !important;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 1050 !important;
        box-shadow: 2px 0 12px rgba(0, 0, 0, 0.3);
        transition: margin-left 0.25s ease-out;
    }

    #wrapper.toggled #sidebar-wrapper {
        margin-left: 0 !important;
        min-width: var(--sidebar-width) !important;
        width: var(--sidebar-width) !important;
    }

    #wrapper.toggled #sidebar-backdrop {
        display: block !important;
        opacity: 1 !important;
    }

    .hero-welcome {
        padding: 1.25rem !important;
    }

    .table-responsive {
        border-radius: 0.5rem;
    }
}

@media (min-width: 769px) {
    .mobile-bottom-nav {
        display: none !important;
    }
}
