/**
 * Filter Controls CSS
 * Styling for the flight search filter panel
 */

/* Filter Panel Container */
.filter-panel {
    background: linear-gradient(135deg, #1a2332 0%, #0f1724 100%);
    border: 1px solid #2a3a4a;
    border-radius: 12px;
    margin-bottom: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.filter-panel.collapsed .filter-content {
    display: none;
}

/* Filter Header (collapsible toggle) */
.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    user-select: none;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
}

.filter-header:hover {
    background: rgba(255, 255, 255, 0.05);
}

.filter-panel:not(.collapsed) .filter-header {
    border-bottom-color: #2a3a4a;
}

.filter-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-header-icon {
    font-size: 1.1rem;
}

.filter-header-title {
    font-weight: 600;
    color: #cfe8ff;
    font-size: 0.95rem;
}

.filter-badge {
    background: linear-gradient(135deg, #4a90d9 0%, #357abd 100%);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
    min-width: 20px;
    text-align: center;
}

.filter-badge.hidden {
    display: none;
}

.filter-toggle-icon {
    color: #8899aa;
    font-size: 0.9rem;
    transition: transform 0.3s ease;
}

.filter-panel:not(.collapsed) .filter-toggle-icon {
    transform: rotate(180deg);
}

/* Filter Content */
.filter-content {
    padding: 16px;
    display: grid;
    gap: 16px;
}

/* Filter Row - horizontal layout */
.filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    align-items: end;
}

/* Individual Filter Group */
.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-label {
    font-size: 0.8rem;
    color: #8899aa;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Input Styles */
.filter-input {
    background: #0b1220;
    border: 1px solid #2a3a4a;
    border-radius: 8px;
    padding: 10px 12px;
    color: #e6eef8;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    width: 100%;
    box-sizing: border-box;
}

.filter-input:hover {
    border-color: #3a4a5a;
}

.filter-input:focus {
    outline: none;
    border-color: #4a90d9;
    box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.2);
}

.filter-input::placeholder {
    color: #556677;
}

/* Input with prefix (like $ for price) */
.filter-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.filter-input-prefix {
    position: absolute;
    left: 12px;
    color: #8899aa;
    font-weight: 500;
    pointer-events: none;
}

.filter-input.has-prefix {
    padding-left: 28px;
}

/* Select/Dropdown Styles */
.filter-select {
    background: #0b1220;
    border: 1px solid #2a3a4a;
    border-radius: 8px;
    padding: 10px 12px;
    color: #e6eef8;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    box-sizing: border-box;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238899aa' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.filter-select:hover {
    border-color: #3a4a5a;
}

.filter-select:focus {
    outline: none;
    border-color: #4a90d9;
    box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.2);
}

.filter-select option {
    background: #0b1220;
    color: #e6eef8;
}

/* Multi-select Airlines */
.airline-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 0;
}

.airline-chip {
    background: #1a2332;
    border: 1px solid #2a3a4a;
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 0.8rem;
    color: #aabbcc;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.airline-chip:hover {
    border-color: #4a90d9;
    background: #1e2a3a;
}

.airline-chip.selected {
    background: linear-gradient(135deg, #4a90d9 0%, #357abd 100%);
    border-color: #4a90d9;
    color: white;
    font-weight: 500;
}

.airline-chip.selected:hover {
    background: linear-gradient(135deg, #5aa0e9 0%, #458acd 100%);
}

/* Checkbox Styles */
.filter-checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 10px 0;
}

.filter-checkbox {
    width: 18px;
    height: 18px;
    accent-color: #4a90d9;
    cursor: pointer;
}

.filter-checkbox-label {
    color: #cfe8ff;
    font-size: 0.9rem;
    cursor: pointer;
}

/* Filter Actions */
.filter-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 8px;
    border-top: 1px solid #2a3a4a;
    margin-top: 8px;
}

.filter-btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.filter-btn-clear {
    background: transparent;
    border: 1px solid #3a4a5a;
    color: #8899aa;
}

.filter-btn-clear:hover {
    border-color: #ff6b6b;
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
}

.filter-btn-apply {
    background: linear-gradient(135deg, #4a90d9 0%, #357abd 100%);
    color: white;
}

.filter-btn-apply:hover {
    background: linear-gradient(135deg, #5aa0e9 0%, #458acd 100%);
    transform: translateY(-1px);
}

/* Active Filter Tags (shown in header when collapsed) */
.active-filters-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-width: 300px;
}

.active-filter-tag {
    background: rgba(74, 144, 217, 0.2);
    border: 1px solid rgba(74, 144, 217, 0.3);
    color: #8cb8e8;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 4px;
    white-space: nowrap;
}

/* Responsive Design */
@media (max-width: 768px) {
    .filter-row {
        grid-template-columns: 1fr;
    }
    
    .filter-header {
        padding: 10px 12px;
    }
    
    .filter-content {
        padding: 12px;
    }
    
    .active-filters-preview {
        display: none;
    }
    
    .airline-chips {
        max-height: 150px;
        overflow-y: auto;
    }
}

/* Animation for filter panel */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.filter-content {
    animation: slideDown 0.2s ease-out;
}

/* Filter applied indicator on flight tables */
.filtered-results-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(74, 144, 217, 0.15);
    border: 1px solid rgba(74, 144, 217, 0.3);
    color: #8cb8e8;
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 4px;
    margin-left: 12px;
}

.filtered-results-indicator::before {
    content: '🔍';
    font-size: 0.7rem;
}
