/* ============================================
   SEARCH RESULTS PAGE - AI-AVIA (Kiwi-style)
   Path: assets/css/search.css
   ============================================ */

/* ===== SEARCH PAGE ===== */
.search-page {
    min-height: 100vh;
    background: #f8fafc;
    padding-bottom: 60px;
}

/* Hide breadcrumbs on search page */
.breadcrumbs,
.breadcrumb-nav,
.breadcrumb {
    display: none !important;
}

/* ===== SEARCH SUMMARY BAR - HIDDEN ===== */
.search-summary {
    display: none;
}

/* ===== MAIN CONTAINER ===== */
.search-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 25px;
}

/* ===== MOBILE FILTER BUTTON ===== */
.mobile-filter-btn {
    display: none;
    width: 100%;
    padding: 12px;
    background: #1a1f71;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 15px;
}

.filters-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

.filters-overlay.show {
    display: block;
}

/* ===== FILTERS SIDEBAR ===== */
.filters-sidebar {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    height: fit-content;
    position: sticky;
    top: 84px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 15px;
}

.filters-header h3 {
    font-size: 1.1rem;
    color: #1a1f71;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filters-reset {
    background: none;
    border: none;
    color: #ffc800;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
}

.filters-reset:hover {
    text-decoration: underline;
}

/* ===== PRICE ALERT ROW ===== */
.price-alert-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: linear-gradient(135deg, #fff9e6, #fff3cc);
    border-radius: 10px;
    margin-bottom: 20px;
    border: 1px solid #ffc800;
}

.price-alert-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.price-alert-info strong {
    color: #1a1f71;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.price-alert-info span {
    font-size: 0.8rem;
    color: #666;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 50px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #ccc;
    border-radius: 26px;
    transition: 0.3s;
}

.toggle-slider::before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: 0.3s;
}

.toggle-switch input:checked + .toggle-slider {
    background: #1a1f71;
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(24px);
}

/* ===== FILTER SECTIONS ===== */
.filter-section {
    border-bottom: 1px solid #e5e7eb;
    padding: 12px 0;
}

.filter-section:last-child {
    border-bottom: none;
}

.filter-toggle {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.filter-toggle-title {
    font-weight: 600;
    color: #1a1f71;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-toggle-arrow {
    color: #999;
    transition: transform 0.2s;
}

.filter-section.open .filter-toggle-arrow {
    transform: rotate(180deg);
}

.filter-content {
    display: none;
    padding-top: 12px;
}

.filter-section.open .filter-content {
    display: block;
}

/* Filter Checkbox */
.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    cursor: pointer;
    font-size: 0.9rem;
    color: #374151;
}

.filter-checkbox input {
    display: none;
}

.filter-checkbox .checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    position: relative;
    flex-shrink: 0;
}

.filter-checkbox input:checked + .checkmark {
    background: #1a1f71;
    border-color: #1a1f71;
}

.filter-checkbox input:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    color: #fff;
    font-size: 12px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Filter Radio */
.filter-radio {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    cursor: pointer;
    font-size: 0.9rem;
    color: #374151;
}

.filter-radio input {
    display: none;
}

.filter-radio .radiomark {
    width: 18px;
    height: 18px;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    position: relative;
    flex-shrink: 0;
}

.filter-radio input:checked + .radiomark {
    border-color: #1a1f71;
}

.filter-radio input:checked + .radiomark::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    background: #1a1f71;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.filter-separator {
    height: 1px;
    background: #e5e7eb;
    margin: 10px 0;
}

/* Baggage Counter */
.baggage-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
}

.baggage-info {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #374151;
    font-size: 0.9rem;
}

.baggage-info i {
    color: #1a1f71;
    width: 20px;
}

.baggage-counter {
    display: flex;
    align-items: center;
    gap: 8px;
}

.baggage-counter button {
    width: 28px;
    height: 28px;
    border: 1px solid #d1d5db;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    color: #1a1f71;
    display: flex;
    align-items: center;
    justify-content: center;
}

.baggage-counter button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.baggage-counter .count {
    min-width: 24px;
    text-align: center;
    font-weight: 600;
}

/* Slider */
.slider-wrapper {
    padding: 5px 0;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 8px;
}

.duration-display {
    font-size: 0.9rem;
    color: #374151;
    margin-bottom: 10px;
}

.slider-track input[type="range"] {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    background: #e5e7eb;
    border-radius: 3px;
    outline: none;
}

.slider-track input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: #1a1f71;
    border-radius: 50%;
    cursor: pointer;
}

/* ===== SEARCH RESULTS ===== */
.search-results {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.results-count {
    font-weight: 600;
    color: #1a1f71;
}

.sort-options {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sort-options label {
    color: #666;
    font-size: 0.9rem;
}

.sort-options select {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9rem;
    background: #fff;
    cursor: pointer;
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: 60px 20px;
    background: #fff;
    border-radius: 12px;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e5e7eb;
    border-top-color: #1a1f71;
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-state p {
    font-size: 1.1rem;
    color: #1a1f71;
    margin-bottom: 5px;
}

.loading-state small {
    color: #666;
}

/* Error State */
.error-state {
    text-align: center;
    padding: 60px 20px;
    background: #fff;
    border-radius: 12px;
}

.error-state i {
    font-size: 3rem;
    color: #ef4444;
    margin-bottom: 15px;
}

.error-state h3 {
    color: #1a1f71;
    margin-bottom: 10px;
}

.error-state p {
    color: #666;
    margin-bottom: 20px;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 40px;
    color: #666;
}

.no-results i {
    font-size: 2.5rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* ===== FLIGHT CARDS ===== */
.flights-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.flight-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: box-shadow 0.2s, transform 0.2s;
}

.flight-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.flight-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.flight-leg {
    display: flex;
    align-items: center;
    gap: 25px;
}

.airline-info {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 140px;
}

.airline-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.airline-name {
    font-size: 0.85rem;
    color: #666;
}

.flight-times {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 15px;
}

.time-block {
    text-align: center;
}

.time-block .time {
    display: block;
    font-size: 1.3rem;
    font-weight: 700;
    color: #1a1f71;
}

.time-block .airport {
    font-size: 0.85rem;
    color: #666;
}

.flight-duration {
    flex: 1;
    text-align: center;
}

.duration-text {
    font-size: 0.85rem;
    color: #666;
}

.duration-line {
    height: 2px;
    background: #e5e7eb;
    position: relative;
    margin: 8px 0;
}

.stops-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
}

.stops-indicator.has-stops {
    background: #f59e0b;
}

.stops-text {
    font-size: 0.8rem;
    color: #22c55e;
    font-weight: 600;
}

.stops-text.has-stops {
    color: #f59e0b;
}

/* Flight Price */
.flight-price {
    text-align: center;
    padding-left: 25px;
    border-left: 1px solid #e5e7eb;
    min-width: 140px;
}

.price-amount {
    font-size: 1.5rem;
    font-weight: 800;
    color: #1a1f71;
}

.price-per {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 12px;
}

.btn-select {
    width: 100%;
    padding: 12px 24px;
    background: #ffc800;
    color: #1a1f71;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-select:hover {
    background: #e6b400;
    transform: scale(1.02);
}

.seats-left {
    display: none;
    margin-top: 10px;
    font-size: 0.8rem;
    color: #ef4444;
    font-weight: 600;
}

/* Load More */
.load-more {
    text-align: center;
    padding: 20px;
}

.btn-outline {
    padding: 12px 30px;
    background: transparent;
    border: 2px solid #1a1f71;
    color: #1a1f71;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-outline:hover {
    background: #1a1f71;
    color: #fff;
}

.btn-yellow {
    background: #ffc800;
    color: #1a1f71;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .search-container {
        grid-template-columns: 1fr;
    }
    
    .mobile-filter-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
    }
    
    .filters-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 300px;
        height: 100vh;
        z-index: 1000;
        border-radius: 0;
        overflow-y: auto;
        transition: left 0.3s;
    }
    
    .filters-sidebar.show {
        left: 0;
    }
}

@media (max-width: 768px) {
    .flight-card {
        flex-direction: column;
        gap: 20px;
    }
    
    .flight-leg {
        flex-direction: column;
        gap: 15px;
        width: 100%;
    }
    
    .airline-info {
        justify-content: center;
    }
    
    .flight-times {
        width: 100%;
        justify-content: space-between;
    }
    
    .flight-price {
        border-left: none;
        border-top: 1px solid #e5e7eb;
        padding-left: 0;
        padding-top: 20px;
        width: 100%;
    }
    
    .results-header {
        flex-direction: column;
        gap: 15px;
    }
}
