/* assets/css/responsive.css */

/* Base hide for mobile components on desktop */
.mobile-header {
    display: none;
}

.desktop-brand {
    display: block;
}

/* Dashboard header: side-by-side on desktop */
.dashboard-header {
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* Tablet & Mobile Admin Layout */
@media (max-width: 768px) {
    .admin-layout {
        display: flex;
        flex-direction: column;
    }

    .mobile-header {
        display: flex;
        justify-content: flex-start;
        gap: 1rem;
        align-items: center;
        background-color: #1e293b;
        color: white;
        padding: 1.5rem;
    }

    .mobile-header .sidebar-brand {
        margin-bottom: 0;
        font-size: 1.6rem;
    }

    .sidebar {
        display: none;
        /* hidden by default */
        width: 100%;
        padding: 1rem 1.5rem;
        background: #0f172a;
    }

    .sidebar.active {
        display: block;
    }

    .desktop-brand {
        display: none !important;
    }

    .sidebar nav {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    .nav-link {
        margin-bottom: 0;
        text-align: left;
        font-size: 1rem;
        padding: 0.75rem 1rem;
    }

    .main-content {
        padding: 1rem;
        min-width: 0; /* prevent grid blowout */
    }

    /* Table Fixes */
    .card {
        max-width: 100%;
    }

    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        width: 100%;
    }

    table th,
    table td {
        white-space: nowrap;
    }

    /* filter bar on dashboard */
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-bar .form-control {
        width: 100%;
    }

    /* Dashboard header stacks on mobile */
    .dashboard-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .dashboard-header .badge-success {
        align-self: center;
    }
}

/* Mobile Settings Layout */
@media (max-width: 640px) {
    .container {
        margin: 1rem auto;
        padding: 0 0.5rem;
    }

    .card {
        padding: 1.25rem;
    }

    .header h1 {
        font-size: 1.5rem;
    }

    .btn {
        width: 100%;
        display: block;
        margin-top: 1rem;
        text-align: center;
    }

    #sidebarToggle {
        width: auto !important;
        margin: 0 !important;
        display: inline-flex !important;
    }

    /* Make tinyMCE tabs stack nicely on mobile */
    .tox-dialog__tabs {
        flex-direction: column !important;
    }

    .tox-dialog__tabs .tox-tab {
        margin-right: 0 !important;
        margin-bottom: 4px !important;
        width: 100% !important;
        text-align: center !important;
        display: block !important;
    }

    /* Wrap the "Kebijakan Privasi" badges and codes that are inline flex */
    .card code {
        display: inline-block;
        margin-bottom: 0.25rem;
    }
}

/* Base Modal adjustments for mobile */
@media (max-width: 480px) {
    .modal {
        padding: 1.5rem;
    }

    .modal-alert {
        padding: 1.5rem;
    }

    .modal-alert-actions {
        flex-direction: column;
    }

    .modal-alert-actions .btn {
        width: 100%;
    }
}