/* ========================================================================
   INDEX PAGE COLLAPSIBLE FILTER
   Modeled on admin_statistics.html collapsible filter (statistics.css)
   All classes prefixed with index- to isolate from all other pages
   ======================================================================== */


/* ========== WRAPPER ========== */
.index-filter-wrapper {
    position: relative;
    margin-bottom: .1rem;
}


/* ========== TOGGLE BUTTON — MOBILE ========== */
@media (max-width: 47.9375rem) {
    .index-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;
    }

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

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


/* ========== TOGGLE BUTTON — TABLET ========== */
@media (min-width: 48rem) and (max-width: 63.9375rem) {
    .index-filter-toggle-btn {
        display: block;
        position: fixed;
        top: 5.5rem;
        left: 1rem;
        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;
    }

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

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


/* ========== TOGGLE BUTTON — DESKTOP ========== */
@media (min-width: 64rem) {
    .index-filter-toggle-btn {
        display: block;
        position: fixed;
        top: 5.75rem;
        left: calc(max(0px, calc(50% - 37.5rem)) + 1rem);
        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;
    }

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

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


/* ========== FILTER FORM — MOBILE ========== */
@media (max-width: 47.9375rem) {
    .index-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;
    }

    .index-filter-form.expanded {
        max-height: 35rem;
    }

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


/* ========== FILTER FORM — TABLET ========== */
@media (min-width: 48rem) and (max-width: 63.9375rem) {
    .index-filter-form {
        position: fixed;
        top: 4.75rem;
        left: 0;
        right: 0;
        z-index: 1000;
        background-color: white;
        padding: 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;
        border-radius: 0.5rem;
        margin: 0;
        max-width: none;
    }

    .index-filter-form.expanded {
        max-height: 35rem;
    }

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


/* ========== FILTER FORM — DESKTOP ========== */
@media (min-width: 64rem) {
    .index-filter-form {
        position: fixed;
        top: 4.75rem;
        z-index: 1000;
        background-color: white;
        padding: 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;
        border-radius: 0.5rem;
		width: min(75rem, 100vw);
		left: max(0px, calc(50% - 37.5rem));
        margin: 0;
		max-width: none;
    }

    .index-filter-form.expanded {
        max-height: 35rem;
    }

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


/* ========== COLLAPSED OVERLAY — MOBILE ========== */
@media (max-width: 47.9375rem) {
    .index-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);
    }

    .index-filter-overlay.show {
        display: flex;
    }

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

    .index-overlay-highlight {
        color: #e74c3c;
    }
}


/* ========== COLLAPSED OVERLAY — TABLET ========== */
@media (min-width: 48rem) and (max-width: 63.9375rem) {
    .index-filter-overlay {
        display: none;
        position: fixed;
        top: 4.75rem;
        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);
    }

    .index-filter-overlay.show {
        display: flex;
    }

    .index-overlay-text {
        color: #0047AB;
        font-size: 1.2rem;
        font-weight: 600;
    }

    .index-overlay-highlight {
        color: #e74c3c;
    }
}


/* ========== COLLAPSED OVERLAY — DESKTOP ========== */
@media (min-width: 64rem) {
    .index-filter-overlay {
        display: none;
        position: fixed;
        top: 4.75rem;
        height: 4rem;
		width: min(75rem, 100vw);
		left: max(0px, calc(50% - 37.5rem));
        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);
    }

    .index-filter-overlay.show {
        display: flex;
    }

    .index-overlay-text {
        color: #0047AB;
        font-size: 1.2rem;
        font-weight: 600;
    }

    .index-overlay-highlight {
        color: #e74c3c;
    }
}


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

/* Mobile: filter is tall when stacked */
@media (max-width: 47.9375rem) {
    h1.index-page-title {
        margin-top: 28rem;
        padding-top: 1rem;
		margin-bottom: .25rem;
    }
	h1.index-page-title {
    font-size: 2.5rem;
	}
}

/* Tablet: filter is 3-row grid, more compact */
@media (min-width: 48rem) and (max-width: 63.9375rem) {
    h1.index-page-title {
        margin-top: 12rem;
        padding-top: 1rem;
		margin-bottom: .25rem;
    }
}

/* Desktop: same grid height as tablet */
@media (min-width: 64rem) {
    h1.index-page-title {
        margin-top: 12rem;
        padding-top: 1rem;
		margin-bottom: .25rem;
    }
}


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


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

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

/* ========================================================================
   ADMIN DASHBOARD COLLAPSIBLE FILTER
   Modeled on index-filter.css collapsible filter
   All classes prefixed with admin-dash- to isolate from all other pages
   ======================================================================== */


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


/* ========== TOGGLE BUTTON — MOBILE ========== */
@media (max-width: 47.9375rem) {
    .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;
    }
}


/* ========== TOGGLE BUTTON — TABLET ========== */
@media (min-width: 48rem) and (max-width: 63.9375rem) {
    .admin-dash-filter-toggle-btn {
        display: block;
        position: fixed;
        top: 5.5rem;
        left: 1rem;
        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;
    }
}


/* ========== TOGGLE BUTTON — DESKTOP ========== */
@media (min-width: 64rem) {
    .admin-dash-filter-toggle-btn {
        display: block;
        position: fixed;
        top: 5.75rem;
        left: calc(max(0px, calc(50% - 37.5rem)) + 1rem);
        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;
    }
}


/* ========== FILTER FORM — MOBILE ========== */
@media (max-width: 47.9375rem) {
    .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 {
        max-height: 45rem;
    }

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


/* ========== FILTER FORM — TABLET ========== */
@media (min-width: 48rem) and (max-width: 63.9375rem) {
    .admin-dash-filter-form {
        position: fixed;
        top: 4.75rem;
        left: 0;
        right: 0;
        z-index: 1000;
        background-color: white;
        padding: 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;
        border-radius: 0.5rem;
        margin: 0;
        max-width: none;
    }

    .admin-dash-filter-form.expanded {
        max-height: 40rem;
    }

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


/* ========== FILTER FORM — DESKTOP ========== */
@media (min-width: 64rem) {
    .admin-dash-filter-form {
        position: fixed;
        top: 4.75rem;
        left: max(0px, calc(50% - 37.5rem));
        z-index: 1000;
        background-color: white;
        padding: 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;
        border-radius: 0.5rem;
        width: min(75rem, 100vw);
        max-width: none;
        margin: 0;
    }

    .admin-dash-filter-form.expanded {
        max-height: 40rem;
    }

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


/* ========== COLLAPSED OVERLAY — MOBILE ========== */
@media (max-width: 47.9375rem) {
    .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;
    }
}


/* ========== COLLAPSED OVERLAY — TABLET ========== */
@media (min-width: 48rem) and (max-width: 63.9375rem) {
    .admin-dash-filter-overlay {
        display: none;
        position: fixed;
        top: 4.75rem;
        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: 1.2rem;
        font-weight: 600;
    }

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


/* ========== COLLAPSED OVERLAY — DESKTOP ========== */
@media (min-width: 64rem) {
    .admin-dash-filter-overlay {
        display: none;
        position: fixed;
        top: 4.75rem;
        left: max(0px, calc(50% - 37.5rem));
        height: 4rem;
        width: min(75rem, 100vw);
        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: 1.2rem;
        font-weight: 600;
    }

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


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

/* Mobile: filter is tall when stacked */
@media (max-width: 47.9375rem) {
    h1.admin-dash-page-title {
        margin-top: 44rem;
        padding-top: 1rem;
		font-size: 2rem;
    }	
}

/* Tablet: filter is 2-row grid with labels, more compact */
@media (min-width: 48rem) and (max-width: 63.9375rem) {
    h1.admin-dash-page-title {
        margin-top: 14rem;
        padding-top: 1rem;
    }
}

/* Desktop: same grid height as tablet */
@media (min-width: 64rem) {
    h1.admin-dash-page-title {
        margin-top: 14rem;
        padding-top: 1rem;
    }
}


/* ========== 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 ========== */

/* Lock fields to 3-column grid on desktop (overrides auto-fit in components.css) */
@media (min-width: 64rem) {
    .admin-dash-filter-form .admin-filter-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Tablet: 2-column grid for fields */
@media (min-width: 48rem) and (max-width: 63.9375rem) {
    .admin-dash-filter-form .admin-filter-grid {
        grid-template-columns: repeat(2, 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;
}