/* ========================================================================
   ADMIN DASHBOARD COLLAPSIBLE FILTER
   Exclusive to app/templates/admin_dashboard.html — moved out of
   index-filter.css (which is exclusive to the public index page) so the
   two pages' filter panels never share a file. Restructured from three
   paired min+max-width bands into a mobile-first, ascending min-width-
   only cascade per CLAUDE.md 6.3, eliminating the dead zone that
   occurred at fractional viewport widths near 767/768px and 1023/1024px.
   ======================================================================== */


/* ========== WRAPPER ========== */
.admin-dash-filter-wrapper {
    position: relative;
    margin-bottom: .5rem;
}


/* ========== TOGGLE BUTTON ========== */
.admin-dash-filter-toggle-btn {
    display: block;
    position: fixed;
    top: 5rem;
    left: 0.75rem;
    z-index: 1001;
    background-color: #C1CBCC;
    color: white;
    border: none;
    border-radius: 50%;
    width: 2.4rem;
    height: 2.4rem;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.admin-dash-filter-toggle-btn:hover {
    background-color: #B5C0C1;
    transform: scale(1.1);
}

.admin-dash-filter-toggle-btn.active {
    background-color: #c3e6cb;
}

@media (min-width: 48rem) {
    .admin-dash-filter-toggle-btn {
        top: 5.5rem;
        left: 1rem;
    }
}

@media (min-width: 64rem) {
    .admin-dash-filter-toggle-btn {
        top: 5.75rem;
        left: calc(max(0px, calc(50% - 37.5rem)) + 1rem);
    }
}


/* ========== FILTER FORM ========== */
.admin-dash-filter-form {
    position: fixed;
    top: 3.795rem;
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: white;
    padding: 0.75rem;
    padding-bottom: 1rem;
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.2);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
    margin: 0;
    max-width: none;
    border-radius: 0;
}

.admin-dash-filter-form.expanded {
    /* Mobile: viewport-relative height, panel scrolls internally so the
       Close button stays reachable on short viewports. Matches the
       top: 3.795rem offset above. */
    max-height: calc(100vh - 3.795rem - 1rem);
    overflow-y: auto;
}

.admin-dash-filter-form.collapsed {
    max-height: 4rem;
}

@media (min-width: 48rem) {
    .admin-dash-filter-form {
        top: 4.75rem;
        padding: 1rem;
        border-radius: 0.5rem;
    }

    .admin-dash-filter-form.expanded {
        /* Tablet/desktop panels never grow tall enough to need internal
           scrolling — fixed max-height, no overflow-y override. */
        max-height: 40rem;
        overflow-y: hidden;
    }
}

@media (min-width: 64rem) {
    .admin-dash-filter-form {
        left: max(0px, calc(50% - 37.5rem));
        right: auto;
        width: min(75rem, 100vw);
    }
}


/* ========== COLLAPSED OVERLAY ========== */
.admin-dash-filter-overlay {
    display: none;
    position: fixed;
    top: 4rem;
    left: 0;
    right: 0;
    height: 4rem;
    background-color: white;
    border-bottom: 0.0625rem solid #ddd;
    z-index: 1002;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0.125rem 0.375rem rgba(0, 0, 0, 0.1);
}

.admin-dash-filter-overlay.show {
    display: flex;
}

.admin-dash-overlay-text {
    color: #0047AB;
    font-size: 1rem;
    font-weight: 600;
}

.admin-dash-overlay-highlight {
    color: #e74c3c;
}

@media (min-width: 48rem) {
    .admin-dash-filter-overlay {
        top: 4.75rem;
    }

    .admin-dash-overlay-text {
        font-size: 1.2rem;
    }
}

@media (min-width: 64rem) {
    .admin-dash-filter-overlay {
        left: max(0px, calc(50% - 37.5rem));
        right: auto;
        width: min(75rem, 100vw);
    }
}


/* ========== PAGE TITLE OFFSET — pushes h1 below fixed filter ========== */

h1.admin-dash-page-title {
    margin-top: 15.4rem;
    padding-top: 1rem;
    font-size: 2rem;
}

@media (min-width: 48rem) {
    h1.admin-dash-page-title {
        margin-top: 14rem;
        font-size: 2.5rem;
    }
}


/* ========== TOGGLE BUTTON VISIBILITY ========== */
/* Hide the floating toggle button when filter is expanded —
   Close Filter Panel button handles collapsing in that state */
.admin-dash-filter-wrapper.filter-open .admin-dash-filter-toggle-btn {
    display: none;
}


/* ========== CLOSE FILTER PANEL BUTTON ========== */
.admin-dash-close-btn {
    background-color: #0047AB;
    color: white;
    border: none;
    cursor: pointer;
}

.admin-dash-close-btn:hover {
    background-color: #2980b9;
}


/* ========== FILTER GRID & BUTTON LAYOUT OVERRIDES ========== */

/* Mobile-first ascending cascade, scoped to this page's filter form only
   — independent of the general .admin-filter-grid rules in
   components.css (shared by other admin pages), so this page's columns
   can never fall into an unscoped fallback at any viewport width. */
.admin-dash-filter-form .admin-filter-grid {
    grid-template-columns: 1fr;
}

@media (min-width: 48rem) {
    .admin-dash-filter-form .admin-filter-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 64rem) {
    .admin-dash-filter-form .admin-filter-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* All breakpoints: buttons row layout */
.admin-dash-filter-form .form-actions {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 0.625rem;
    justify-content: space-between;
}

.admin-dash-filter-form .filter-btn-wrapper {
    flex: 1;
}

.admin-dash-filter-form .filter-btn-wrapper .btn {
    width: 100%;
    white-space: nowrap;
}


/* ========================================================================
   ADMIN DASHBOARD — MEDIA LINKS SECTION HEADER
   "Media Links" h2 + Approve All button row. Grid, not flexbox
   space-between, per CLAUDE.md 12.2 — the button must never be
   squeezed by the heading's length.
   ======================================================================== */

.admin-dash-section-header {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 0.9375rem;
}

.admin-dash-section-header h2 {
    margin: 0;
}

@media (min-width: 48rem) {
    .admin-dash-section-header {
        grid-template-columns: 1fr auto;
    }
}
