/**
 * Job Filters Component Styles
 * 
 * @package Blocksy_Child
 */

/* ============================================
   CONTAINER & LAYOUT
   ============================================ */

.filters-container {
    position: relative;
    z-index: 999;
    margin: 0 0 1.5rem 0;
    transition: background-color 0.3s ease;
}

/* Sticky state - applied by JavaScript */
.filters-container.is-stuck {
    position: fixed;
    margin: 0;
    top: 116px; /* Header height: 48px + 68px */
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Admin bar offset when stuck */
.admin-bar .filters-container.is-stuck {
    top: calc(116px + 32px); /* Header + admin bar */
}

@media screen and (max-width: 782px) {
    .admin-bar .filters-container.is-stuck {
        top: calc(116px + 46px); /* Header + mobile admin bar */
    }
}

.filters-scroll-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    margin: 0 auto;
    height: 88px;
}

.filters-scrollable {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none; /* Firefox */
    padding: 12px 0;
    height: 88px;
    width: 100%;
    border-top: 2px solid var(--theme-palette-color-7);
    border-bottom: 2px solid var(--theme-palette-color-7);
}

.filters-container.is-stuck .filters-scrollable {
    border: 0;
}

/* Hide scrollbar - Chrome, Safari, Edge */
.filters-scrollable::-webkit-scrollbar {
    display: none;
}

/* ============================================
   FILTER GROUP
   ============================================ */

.filter-group {
    position: relative;
    flex-shrink: 0;
}

.filter-group:first-child {
    margin-left: 12px;
}

.filter-group:last-child {
    margin-right: 12px;
}

/* ============================================
   FILTER BUTTON
   ============================================ */

.filter-button {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 140px;
    padding: 12px 16px;
    padding-right: 40px; /* Space for chevron */
    background: white;
    border: 2px solid var(--theme-palette-color-7);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-condensed);
    white-space: nowrap;
}

.filter-button-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.filter-label {
    font-size: 11px;
    font-weight: 600;
    color: #666666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    line-height: 1;
}

.filter-value {
    font-size: 14px;
    font-weight: 500;
    color: var(--theme-palette-color-3); /* Brand Secondary */
    line-height: 1.2;
}

.filter-chevron {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: #999999;
    transition: transform 0.3s ease, color 0.3s ease;
}

/* ============================================
   FILTER BUTTON - ACTIVE STATE
   ============================================ */

.filter-button.is-active {
    background: var(--theme-palette-color-1); /* Brand Primary */
    border-color: var(--theme-palette-color-1);
}

.filter-button.is-active .filter-label {
    color: rgba(255, 255, 255, 0.9);
}

.filter-button.is-active .filter-value {
    color: white;
    font-weight: 600;
}

.filter-button.is-active .filter-chevron {
    color: white;
}

/* ============================================
   FILTER BUTTON - HOVER STATE
   ============================================ */

.filter-button:hover:not(.is-active) {
    border-color: var(--theme-palette-color-1);
    box-shadow: 0 2px 8px rgba(227, 10, 108, 0.15);
}

/* ============================================
   FILTER BUTTON - EXPANDED STATE
   ============================================ */

.filter-button[aria-expanded="true"] .filter-chevron {
    transform: translateY(-50%) rotate(180deg);
}

/* ============================================
   DROPDOWN - FIXED POSITIONING
   ============================================ */

.filter-dropdown {
    position: fixed;
    min-width: 220px;
    max-height: 400px;
    overflow-y: auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

.filter-dropdown[aria-hidden="false"] {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Custom scrollbar styling */
.filter-dropdown::-webkit-scrollbar {
    width: 8px;
}

.filter-dropdown::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 4px;
}

.filter-dropdown::-webkit-scrollbar-thumb {
    background: var(--theme-palette-color-7); /* Light gray */
    border-radius: 4px;
    transition: background 0.3s ease;
}

.filter-dropdown::-webkit-scrollbar-thumb:hover {
    background: var(--theme-palette-color-1); /* Brand pink */
}

/* Firefox scrollbar */
.filter-dropdown {
    scrollbar-width: thin;
    scrollbar-color: var(--theme-palette-color-7) #f5f5f5;
}

/* ============================================
   DROPDOWN OPTIONS
   ============================================ */

.filter-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 10px 16px;
    border: none;
    background: white;
    font-family: var(--font-condensed);
    font-size: 14px;
    font-weight: 500;
    color: var(--theme-palette-color-3);
    text-align: left;
    cursor: pointer;
    transition: background 0.2s ease;
}

.filter-option-name {
    flex: 1;
}

.filter-option-count {
    color: #999999;
    font-size: 13px;
    margin-left: 8px;
}

.filter-option:hover:not(.is-disabled):not(.is-current) {
    background: #f8f8f8;
}

.filter-option.is-current {
    background: var(--theme-palette-color-1);
    color: white;
    font-weight: 600;
}

.filter-option.is-current .filter-option-count {
    color: rgba(255, 255, 255, 0.8);
}

.filter-option.is-disabled {
    color: #cccccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.filter-option.is-disabled .filter-option-count {
    color: #cccccc;
}

/* ============================================
   SCROLL BUTTONS
   ============================================ */

.scroll-button {
    flex-shrink: 0;
    width: 40px;
    height: 88px;
    border: 2px solid var(--theme-palette-color-7);
    background: white;
    color: var(--theme-palette-color-3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.filters-container.is-stuck .scroll-button {
    border: 0;
}

.scroll-right {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

.scroll-left {
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

.filters-container.is-stuck .scroll-right {
    border-left: 2px solid var(--theme-palette-color-7);
    border-radius: 0;
}

.filters-container.is-stuck .scroll-left {
    border-right: 2px solid var(--theme-palette-color-7);
    border-radius: 0;
}

.filters-container.is-stuck .filters-scrollable, 
.filters-container.is-stuck .filters-scroll-wrapper, 
.filters-container.is-stuck .scroll-button {
    height: 84px;
}

.scroll-button:hover:not(:disabled) {
    border-color: var(--theme-palette-color-1);
    color: var(--theme-palette-color-8);
    background: var(--theme-palette-color-1);
}

.scroll-button:disabled {
    background: rgba(255, 255, 255, 0.3);
    color: var(--theme-palette-color-7);
    cursor: not-allowed;
}

.scroll-button svg {
    width: 20px;
    height: 20px;
}

/* ============================================
   CLEAR FILTERS BUTTON
   ============================================ */

.clear-filters-button {
    flex-shrink: 0;
    width: 88px;
    height: 88px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--theme-palette-color-3);
    color: white;
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
    border-left: none;
    font-family: var(--font-condensed);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.clear-filters-button:hover {
    background: var(--theme-palette-color-1);
}

.clear-icon {
    width: 20px;
    height: 20px;
}

.clear-label {
    line-height: 1;
    text-align: center;
}

/* Remove scroll-right radius when clear button is present */
.filters-scroll-wrapper:has(.clear-filters-button) .scroll-right {
    border-radius: 0;
}

/* Sticky state - no border radius on clear button */
.filters-container.is-stuck .clear-filters-button {
    height: 84px;
    width: 84px;
    border-radius: 0;
    border-left: 2px solid var(--theme-palette-color-7);
}

/* ============================================
   RESPONSIVE - TABLET (< 1000px)
   ============================================ */

@media (max-width: 999px) {
    .filters-scrollable, 
    .filters-scroll-wrapper, 
    .scroll-button {
        height: 80px;
    }

    .clear-filters-button {
        width: 80px;
        height: 80px;
    }

    .filters-container.is-stuck .filters-scrollable, 
    .filters-container.is-stuck .filters-scroll-wrapper, 
    .filters-container.is-stuck .scroll-button {
        height: 78px;
    }

    .filters-container.is-stuck .clear-filters-button {
        width: 78px;
        height: 78px;
    }

    .filter-button {
        min-width: 120px;
        padding: 10px 14px;
        padding-right: 36px;
    }
    
    .filter-label {
        font-size: 10px;
    }
    
    .filter-value {
        font-size: 13px;
    }
    
    .filter-chevron {
        right: 10px;
    }
}

/* ============================================
   RESPONSIVE - MOBILE (< 690px)
   ============================================ */

@media (max-width: 689px) {
    .filters-scrollable, 
    .filters-scroll-wrapper, 
    .scroll-button {
        height: 76px;
    }

    .clear-filters-button {
        width: 76px;
        height: 76px;
    }

    .filters-container.is-stuck .filters-scrollable, 
    .filters-container.is-stuck .filters-scroll-wrapper, 
    .filters-container.is-stuck .scroll-button {
        height: 72px;
    }

    .filters-container.is-stuck .clear-filters-button {
        width: 72px;
        height: 72px;
    }

    .filters-container {
        margin-bottom: 24px;
    }
    
    .filters-container.is-stuck {
        top: 116px;
    }
    
    .admin-bar .filters-container.is-stuck {
        top: calc(116px + 46px);
    }
    
    .filter-button {
        min-width: 100px;
        padding: 8px 12px;
        padding-right: 32px;
    }
    
    .filter-label {
        font-size: 9px;
    }
    
    .filter-value {
        font-size: 12px;
    }
    
    .filter-chevron {
        width: 14px;
        height: 14px;
        right: 8px;
    }
    
    .scroll-button {
        width: 36px;
    }
    
    .scroll-button svg {
        width: 18px;
        height: 18px;
    }
    
    .filter-dropdown {
        min-width: 200px;
        max-height: 340px;
    }
    
    .filter-option {
        padding: 8px 14px;
        font-size: 13px;
    }
    
    .filter-option-count {
        font-size: 12px;
    }
}