/* Modern Filter UI Styling */
.match-filter-section {
    background-color: #f0f0f5;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 24px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    min-height: 80px; /* Prevent section from collapsing */
    position: relative; /* Ensure proper stacking context */
}

.match-filter-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.match-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    justify-content: center;
}

.match-filter-group {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.match-filter-label {
    font-weight: 600;
    color: #354052;
    font-size: 15.2px;
}

/* Filter Buttons for Common Options */
.match-filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.match-filter-btn {
    background-color: white;
    border: 1px solid #e6e9f0;
    border-radius: 30px;
    padding: 6px 16px;
    font-size: 13.6px;
    color: #5c6b7f;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.match-filter-btn:hover {
    border-color: #3498db;
    color: #3498db;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

.match-filter-btn.active {
    background-color: #3498db;
    border-color: #3498db;
    color: white;
    font-weight: 500;
    box-shadow: 0 2px 6px rgba(52, 152, 219, 0.3);
}

/* Remove All Leagues button */
.match-filter-remove-all {
    background-color: white;
    border: 1px solid #e6e9f0;
    border-radius: 30px;
    padding: 6px 16px;
    font-size: 13.6px;
    color: #5c6b7f;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.match-filter-remove-all:hover {
    border-color: #e74c3c;
    color: #e74c3c;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

/* Dropdown for Many Options */
.filter-dropdown {
    position: relative;
    display: inline-block;
    width: 220px;
}

.filter-dropdown-toggle {
    background-color: white;
    border: 1px solid #e6e9f0;
    border-radius: 30px;
    padding: 6px 16px;
    font-size: 13.6px;
    color: #5c6b7f;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.filter-dropdown-toggle span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    text-align: left;
}

.filter-dropdown-toggle:hover {
    border-color: #3498db;
    color: #3498db;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

.filter-dropdown-toggle i {
    transition: transform 0.3s ease;
}

.filter-dropdown-toggle.active i {
    transform: rotate(180deg);
}

.filter-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1050;
    display: none;
    flex-direction: column;
    min-width: 220px;
    padding: 0;
    margin-top: 8px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-height: 300px;
    overflow: hidden;
}

.filter-dropdown-menu.show {
    display: flex;
}

.filter-dropdown-menu__scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 8px;
}

.filter-dropdown-menu__footer {
    flex-shrink: 0;
    padding: 8px;
    padding-top: 8px;
    border-top: 1px solid #e6e9f0;
    background-color: white;
    /* Hidden by default; JS adds .is-visible only when user has selected leagues */
    display: none;
}

.filter-dropdown-menu__footer.is-visible {
    display: block;
}

/* Search within dropdown */
.filter-dropdown-menu__scroll .filter-search {
    position: sticky;
    top: 0;
    padding: 0 0 8px 0;
    background-color: white;
    margin-bottom: 0;
    z-index: 1;
}

.filter-search input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e6e9f0;
    border-radius: 6px;
    font-size: 13.6px;
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-option {
    display: flex;
    align-items: center;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.filter-option:hover {
    background-color: #f5f7fa;
}

.filter-option.selected {
    background-color: #ebf5fd;
    color: #3498db;
}

.filter-option input {
    margin-right: 8px;
}

/* Filter groups */
.filter-group {
    margin-bottom: 12px;
}

.filter-group-title {
    font-weight: 600;
    font-size: 12.8px;
    color: #8c99ab;
    padding: 4px 8px;
    border-bottom: 1px solid #f0f2f5;
    margin-bottom: 8px;
}

/* Active filters display */
.active-filters {
    display: none !important; /* Hidden as per user request */
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.filter-chip {
    background-color: #ebf5fd;
    color: #3498db;
    border-radius: 30px;
    padding: 4px 12px;
    font-size: 12.8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-chip button {
    background: none;
    border: none;
    color: #3498db;
    font-size: 12.8px;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
}

/* Mobile Filter Toggle Button */
.mobile-filter-toggle {
    display: none;
    background-color: var(--color-primary);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 15px;
    font-weight: 500;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.mobile-filter-toggle:hover {
    background-color: var(--color-primary-dark);
}

.mobile-filter-toggle i {
    font-size: 14px;
}

/* Media queries for responsive design */
@media (max-width: 768px) {
    .mobile-filter-toggle {
        display: flex;
    }
    
    .match-filter-container {
        display: none;
        background-color: var(--color-white);
        border-radius: 8px;
        box-shadow: var(--shadow-md);
        padding: 15px;
        margin-bottom: 15px;
        position: relative;
        z-index: 20;
    }
    
    .match-filter-container.show-mobile {
        display: block;
        animation: fadeIn 0.3s ease;
    }
    
    .match-filter-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .match-filter-group {
        width: 100%;
    }
    
    .match-filter-label {
        margin-bottom: 8px;
        display: block;
        font-weight: 500;
    }
    
    .match-filter-options, 
    .filter-dropdown {
        width: 100%;
    }
    
    .match-filter-btn {
        flex: 1;
    }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .match-filter-section {
        padding: 12px;
    }
    
    .match-filter-row {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }
    
    .match-filter-group {
        width: 100%;
    }
    
    .match-filter-options {
        flex-wrap: wrap;
        width: 100%;
    }
    
    .match-filter-btn {
        flex: 1;
        text-align: center;
        min-width: 70px;
    }
    
    .filter-dropdown {
        width: 100%;
    }
    
    .filter-dropdown-toggle {
        width: 100%;
        justify-content: space-between;
    }
    
    .filter-dropdown-menu {
        width: 100%;
        min-width: auto;
    }
} 