/* ==============================================
   FILTERS COMPONENTS
   Date pickers, league selectors, search bars
   ============================================== */

/* ========================================
   DATE FILTER BUTTONS
   ======================================== */
.date-filter-container {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.date-filter-btn {
    padding: var(--space-sm) var(--space-md);
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    border-radius: var(--radius-lg);
    transition: background-color var(--transition-fast), color var(--transition-fast);
    cursor: pointer;
    border: none;
    background-color: var(--color-bg-tertiary);
    color: var(--color-text-secondary);
}

.date-filter-btn:hover:not(.active) {
    background-color: var(--color-border-secondary);
    /* ❌ REMOVED: transform: translateY(-1px); - causes jank */
}

.date-filter-btn.active {
    background-color: var(--color-brand-primary);
    color: #0f172a;
    box-shadow: var(--shadow-sm);
}

/* ========================================
   LEAGUE SELECTOR
   ======================================== */
.league-selector {
    position: relative;
}

.league-selector-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background-color: var(--color-bg-primary);
    border: 1px solid var(--color-border-primary);
    border-radius: var(--radius-lg);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    cursor: pointer;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    min-width: 200px;
}

.league-selector-trigger:hover {
    border-color: var(--color-brand-primary);
    box-shadow: var(--shadow-sm);
}

.league-selector-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: var(--space-xs);
    background-color: var(--color-bg-primary);
    border: 1px solid var(--color-border-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-height: 300px;
    overflow-y: auto;
    z-index: var(--z-dropdown);
    display: none;
}

.league-selector-dropdown.open {
    display: block;
}

.league-option {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.league-option:hover {
    background-color: var(--color-bg-secondary);
}

.league-option.selected {
    background-color: var(--color-brand-primary);
    color: #0f172a;
    font-weight: var(--font-semibold);
}

.league-option-logo {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

/* ========================================
   SEARCH BAR
   ======================================== */
.search-bar {
    position: relative;
    width: 100%;
}

.search-input {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    padding-left: var(--space-2xl);
    border: 1px solid var(--color-border-primary);
    border-radius: var(--radius-lg);
    font-size: var(--text-sm);
    background-color: var(--color-bg-primary);
    color: var(--color-text-primary);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.search-input:focus {
    outline: none;
    border-color: var(--color-brand-primary);
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.1);
}

.search-icon {
    position: absolute;
    left: var(--space-md);
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-tertiary);
    pointer-events: none;
}

/* ========================================
   FILTER GROUP (General)
   ======================================== */
.filter-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.filter-label {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--color-text-secondary);
}

.filter-label i {
    width: 16px;
    height: 16px;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 640px) {
    .date-filter-container {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: var(--space-xs);
    }

    .date-filter-btn {
        flex-shrink: 0;
    }

    .league-selector-trigger {
        min-width: unset;
        width: 100%;
    }
}
