/* ====================================
   ZangaPro Dashboard Header Styles
   ==================================== */

/* Container Flex Layout */
.dashboard-header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--zp-space-4);
    flex-wrap: wrap;
}

.dashboard-welcome {
    flex: 0 0 auto;
}

/* Filters */
.dashboard-filters {
    display: flex;
    align-items: center;
    gap: var(--zp-space-3);
    flex: 1 1 auto;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.dashboard-location-container {
    flex: 0 1 auto;
    min-width: 200px;
}

.dashboard-date-container {
    flex: 0 1 auto;
}

/* Select2 Customization */
.dashboard-location-select {
    width: 100%;
}

.select2-container--default .select2-selection--single {
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    height: 38px;
    display: flex;
    align-items: center;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 38px;
    padding-left: 12px;
    color: #374151;
    font-size: 0.875rem;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 36px;
    right: 8px;
}

/* DatePicker Customization */
.dashboard-date-range {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    height: 38px;
}

.dashboard-date-range:hover {
    border-color: var(--zp-primary-500);
}

/* ====================================
   MOBILE RESPONSIVE
   ==================================== */

@media (max-width: 768px) {

    /* Header Stack */
    .dashboard-header-container {
        flex-direction: column;
        align-items: stretch;
        gap: var(--zp-space-3);
    }

    .dashboard-welcome {
        text-align: center;
    }

    .dashboard-filters {
        justify-content: center;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .dashboard-location-container,
    .dashboard-date-container {
        width: 100%;
        min-width: 100%;
    }

    .dashboard-location-select {
        width: 100%;
        max-width: 100%;
    }

    /* FORCE SELECT2 FULL WIDTH ON MOBILE (BOTTOM SHEET STYLE) */
    .select2-container {
        width: 100% !important;
        min-width: 100% !important;
    }

    /* Target BODY children to escape stacking contexts */
    body .select2-container .select2-dropdown {
        width: 100vw !important;
        max-width: 100vw !important;
        min-width: 100vw !important;
        left: 0 !important;
        right: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        position: fixed !important;
        top: auto !important;
        bottom: 0 !important;
        transform: translate3d(0, 0, 0) !important;
        border-radius: 20px 20px 0 0 !important;
        box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.25) !important;
        z-index: 2147483647 !important;
        /* Max safe integer */
        border: none !important;
        background: white !important;
    }

    body .select2-container .select2-results__options {
        max-height: 50vh !important;
        padding: 10px !important;
        overscroll-behavior: contain;
    }

    /* Bigger tap targets in dropdown */
    body .select2-container .select2-results__option {
        padding: 12px 16px !important;
        font-size: 16px !important;
        border-bottom: 1px solid #f3f4f6;
    }
}