/**
 * Student Archive Page Styles
 * Teach Haiti Brand Colors
 */

/* Full Width Layout for Archive */
.post-type-archive-student #main-content .container {
    padding: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
}

.post-type-archive-student #main-content .container:before {
    display: none !important;
    content: none !important;
}

.post-type-archive-student #content-area.th-full-width {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
}

.post-type-archive-student #left-area.th-full-width-content {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    float: none !important;
}

.post-type-archive-student #sidebar {
    display: none !important;
}

/* Archive Container */
.th-students-archive {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 2rem 4rem;
}

/* Archive Header */
.th-archive-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem 0;
}

.th-archive-title {
    color: #003349;
    font-family: 'Mr Eaves Mod OT', Georgia, serif;
    font-size: 3rem;
    font-weight: 700;
    margin: 0 0 1rem 0;
    line-height: 1.2;
}

.th-archive-description {
    color: #005E93;
    font-family: 'Avenir Next', Arial, sans-serif;
    font-size: 1.2rem;
    line-height: 1.8;
    max-width: 800px;
    margin: 0 auto;
}

/* Mobile Filter Toggle (hidden on desktop) */
.th-mobile-filter-toggle {
    display: none;
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 999;
    background: #F18721;
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 1rem 1.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(241, 135, 33, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    align-items: center;
    gap: 0.5rem;
}

.th-mobile-filter-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(241, 135, 33, 0.5);
}

.th-mobile-filter-toggle svg {
    display: block;
}

.th-mobile-filter-toggle__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: #fff;
    color: #F18721;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
}

/* Layout Container */
.th-archive-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2.5rem;
    align-items: start;
}

/* Sidebar */
.th-archive-sidebar {
    background: #fff;
    border-radius: 20px;
    padding: 1.75rem;
    box-shadow: 0 4px 20px rgba(0, 91, 150, 0.08);
    position: sticky;
    top: 2rem;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.th-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f0f4f8;
}

.th-sidebar-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #003349;
    margin: 0;
    font-family: 'Avenir Next', Arial, sans-serif;
}

.th-sidebar-close {
    display: none;
    background: none;
    border: none;
    color: #8596a5;
    cursor: pointer;
    padding: 0.25rem;
    transition: color 0.2s ease;
}

.th-sidebar-close:hover {
    color: #003349;
}

.th-sidebar-body {
    flex: 1;
}

.th-sidebar-footer {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid #f0f4f8;
}

/* Backdrop (hidden on desktop) */
.th-archive-backdrop {
    display: none;
}

/* Main Content Area */
.th-archive-main {
    min-width: 0;
}

/* Search Container */
.th-search-container {
    margin-bottom: 1.5rem;
}

.th-search-label {
    display: block;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.75rem;
    color: #8596a5;
    margin-bottom: 0.5rem;
    font-family: 'Avenir Next', Arial, sans-serif;
}

.th-search-wrapper {
    position: relative;
    width: 100%;
}

.th-search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: #487091;
    pointer-events: none;
}

input.th-search-input {
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 2.75rem;
    font-size: 0.95rem;
    font-family: 'Avenir Next', Arial, sans-serif;
    border: 1px solid rgba(0, 62, 107, 0.12);
    border-radius: 12px;
    background: #f7fafc;
    color: #003349;
    transition: all 0.3s ease;
}

input.th-search-input:focus {
    outline: none;
    border-color: #005E93;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(104, 191, 208, 0.1);
}

input.th-search-input::placeholder {
    color: #8596a5;
}

.th-search-clear {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    background: #EF3B49;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 0;
}

.th-search-clear svg {
    width: 14px;
    height: 14px;
    color: white;
}

.th-search-clear:hover {
    background: #d63442;
    transform: translateY(-50%) scale(1.1);
}

/* Filters Container */
.th-filters-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.th-filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.th-filter-label {
    display: block;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.75rem;
    color: #8596a5;
    font-family: 'Avenir Next', Arial, sans-serif;
}

.th-filter-icon {
    width: 18px;
    height: 18px;
    fill: #005E93;
}

.th-filter-select {
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    font-size: 0.95rem;
    font-family: 'Avenir Next', Arial, sans-serif;
    border: 1px solid rgba(0, 62, 107, 0.12);
    border-radius: 12px;
    background: #f7fafc;
    color: #003349;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 12 8'%3E%3Cpath fill='%23487091' d='M1.41 0L6 4.58 10.59 0 12 1.41l-6 6-6-6z'/%3E%3C/svg%3E");
    background-size: 10px 6px;
    background-repeat: no-repeat;
    background-position: right 0.875rem center;
}

.th-filter-select:hover {
    border-color: #005E93;
}

.th-filter-select:focus {
    outline: none;
    border-color: #005E93;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(104, 191, 208, 0.1);
}

/* Clear Filters Button */
.th-clear-filters {
    width: 100%;
    background: transparent;
    border: 2px solid #005B96;
    color: #005B96;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    font-family: 'Avenir Next', Arial, sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
}

.th-clear-filters:hover,
.th-clear-filters:focus {
    background: #005B96;
    color: #fff;
}

/* Results Info */
.th-results-info {
    margin-bottom: 1.5rem;
    text-align: left;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e9ecef;
}

.th-results-info span {
    font-family: 'Avenir Next', Arial, sans-serif;
    font-size: 1rem;
    color: #005E93;
}

.th-results-info strong {
    color: #003349;
    font-weight: 700;
}

/* Students Grid */
.th-students-archive-grid {
    transition: opacity 0.3s ease;
    width: 100%;
}

.th-students-archive-grid .th-student-cards-wrapper {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
    gap: 2rem;
    max-width: 100% !important;
}

.th-students-archive-grid.filtering {
    opacity: 0.5;
    pointer-events: none;
}

/* No Results */
.th-no-results {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 51, 73, 0.1);
}

.th-no-results-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.th-no-results h3 {
    color: #003349;
    font-family: 'Mr Eaves Mod OT', Georgia, serif;
    font-size: 2rem;
    margin: 0 0 1rem 0;
}

.th-no-results p {
    color: #005E93;
    font-family: 'Avenir Next', Arial, sans-serif;
    font-size: 1.1rem;
    margin: 0 0 2rem 0;
}

.th-reset-search {
    background: linear-gradient(45deg, #68BFD0, #005E93);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 1rem;
    font-family: 'Avenir Next', Arial, sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
}

.th-reset-search:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(104, 191, 208, 0.4);
}

/* Responsive Design */
@media (max-width: 1100px) {
    /* Adjust sidebar width for medium screens */
    .th-archive-layout {
        grid-template-columns: 280px 1fr;
        gap: 2rem;
    }
}

@media (max-width: 900px) {
    /* Stack sidebar on smaller screens (but not mobile) */
    .th-archive-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .th-archive-sidebar {
        position: relative;
        top: 0;
        max-height: none;
    }
}

@media (max-width: 768px) {
    .th-students-archive {
        padding: 1.5rem 1rem 3rem;
    }

    .th-archive-title {
        font-size: 2.5rem;
    }

    .th-archive-description {
        font-size: 1.1rem;
    }

    /* Switch to mobile layout */
    .th-archive-layout {
        grid-template-columns: 1fr;
        gap: 0;
    }

    /* Show mobile filter button */
    .th-mobile-filter-toggle {
        display: inline-flex;
    }

    /* Transform sidebar into bottom sheet */
    .th-archive-sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        max-height: 85vh;
        border-radius: 24px 24px 0 0;
        box-shadow: 0 -4px 32px rgba(0, 51, 73, 0.2);
        transform: translateY(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        top: auto;
        max-width: 100%;
    }

    .th-archive-sidebar.is-open {
        transform: translateY(0);
    }

    /* Show close button on mobile */
    .th-sidebar-close {
        display: block;
    }

    /* Show backdrop on mobile */
    .th-archive-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 51, 73, 0.5);
        backdrop-filter: blur(4px);
        z-index: 999;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    .th-archive-backdrop.is-visible {
        opacity: 1;
        pointer-events: auto;
    }

    .th-filters-container {
        gap: 1.25rem;
    }
}

@media (max-width: 640px) {
    .th-archive-title {
        font-size: 2rem;
    }

    .th-archive-description {
        font-size: 1rem;
    }

    .th-archive-sidebar {
        padding: 1.5rem;
    }

    .th-mobile-filter-toggle {
        bottom: 1rem;
        right: 1rem;
        padding: 0.875rem 1.25rem;
        font-size: 0.9rem;
    }
}

/* Mobile Responsive Adjustments */
@media (max-width: 980px) {
    .post-type-archive-student #main-content .container {
        width: 100% !important;
        padding: 0 1rem !important;
    }
}
