/* ========================================
   MODERN SEARCH FORM - GRAY/WHITE
   ======================================== */

/* Trip Type Radio Buttons */
.trip-type {
    margin-bottom: 1.5rem;
}

.form-check-inline {
    margin-right: 1.5rem;
}

.form-check-input {
    cursor: pointer;
    border-color: #ced4da;
}

.form-check-input:checked {
    background-color: #FFC107 !important;
    border-color: #FFC107 !important;
}

/* Extra specific rule for radio buttons */
input[type="radio"].form-check-input:checked {
    background-color: #FFC107 !important;
    border-color: #FFC107 !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='2' fill='%23fff'/%3e%3c/svg%3e") !important;
}

.form-check-input:focus {
    border-color: #FFC107;
    box-shadow: 0 0 0 0.2rem rgba(255, 193, 7, 0.25);
}

.form-check-label {
    cursor: pointer;
    color: #495057;
    font-weight: 500;
    font-size: 0.95rem;
}

/* Compact Trip Type (for results page) */
.trip-type-compact {
    margin-bottom: 0.5rem;
}

.trip-type-compact .form-check-inline {
    margin-right: 1rem;
}

.trip-type-compact .form-check-label {
    font-size: 0.875rem;
}

/* Form Labels */
.form-label {
    color: #6c757d;
    font-weight: 500;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

/* Form Controls */
.form-control {
    font-family: 'Inter', sans-serif;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    transition: all 0.2s;
}

.form-control:focus {
    background-color: #ffffff;
    border-color: #495057;
    box-shadow: 0 0 0 0.2rem rgba(33, 37, 41, 0.05);
}

.form-control::placeholder {
    color: #adb5bd;
}

.form-control.border-0 {
    border: 1px solid #e9ecef !important;
}

.form-control.bg-light {
    background-color: #f8f9fa;
}

.form-control:read-only {
    cursor: pointer !important;
    background-color: #f8f9fa;
}

/* Date inputs and passengers should always show pointer cursor */
input[type="text"].form-control[readonly],
.date-input,
#passengers,
#departureDate,
#returnDate {
    cursor: pointer !important;
}

.form-control:read-only:focus {
    background-color: #ffffff;
}

/* Search Button */
.btn-warning {
    background: #FFC107;
    border: none;
    color: #212529;
    padding: 0.75rem 2rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.2s;
}

.btn-warning:hover {
    background: #FFB300;
    color: #212529;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(255, 193, 7, 0.3);
}

.btn-warning:active {
    transform: translateY(0);
}

/* Responsive Grid Gaps */
.row.g-2 {
    --bs-gutter-x: 0.75rem;
    --bs-gutter-y: 0.75rem;
}

/* ========================================
   SWAP BUTTONS - ALL VARIANTS
   ======================================== */

/* Desktop Swap Button (Compact Version) - FIXED */
.btn-swap-compact {
    width: 40px;
    height: 40px;
    border: 1px solid #e9ecef;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
    color: #6c757d;
    flex-shrink: 0;
}

.btn-swap-compact:hover {
    background: #f8f9fa;
    border-color: #ced4da;
    color: #212529;
    transform: rotate(180deg);
}

.btn-swap-compact:active {
    background: #e9ecef;
    transform: rotate(180deg) scale(0.95);
}

.btn-swap-compact svg {
    width: 20px;
    height: 20px;
    pointer-events: none;
}

/* Original Swap Button (if used elsewhere) */
.btn-swap {
    width: 40px;
    height: 40px;
    border: 1px solid #e9ecef;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
    color: #6c757d;
}

.btn-swap:hover {
    background: #FFC107;
    border-color: #FFC107;
    color: #212529;
    transform: scale(1.05);
}

.btn-swap svg {
    width: 20px;
    height: 20px;
}

/* Mobile Swap Button - Positioned Between Inputs */
.btn-swap-between {
    position: absolute;
    bottom: -39px;
    right: 0.75rem;
    width: 40px;
    height: 40px;
    border: 2px solid #e9ecef;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
    color: #6c757d;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-swap-between:hover,
.btn-swap-between:active {
    background: #f8f9fa;
    border-color: #ced4da;
    transform: scale(1.05);
}

.btn-swap-between svg {
    width: 20px;
    height: 20px;
}

/* Mobile Swap Button (created by JavaScript) */
#mobileSwapButton {
    margin-top: 0.5rem;
}

/* Search Form Wrapper */
.search-form-wrapper {
    width: 100%;
}

/* Search Card */
.search-card-compact {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Destination Field Compact */
.destination-field-compact {
    position: relative;
}

/* Return Date Field - Can be hidden */
.return-date-field {
    transition: opacity 0.2s;
}

/* Search Info Text */
.search-info-text {
    text-align: center;
    color: #6c757d;
    margin: 0;
    line-height: 1.5;
}

.search-info-text small {
    font-size: 0.875rem;
}

/* ========================================
   RESULTS PAGE SEARCH SECTION
   ======================================== */

.results-search-section {
    background: white;
    padding: 1rem 0;
    border-bottom: 1px solid #e9ecef;
    /* Removed sticky positioning for better mobile experience */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Quick Filters - Stay in normal flow */
.quick-filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
    position: relative;
    z-index: 10; /* On top during animation */
}

/* Lower z-index when search is fully expanded so dropdown shows above filters */
.results-search-section:not(.collapsed) .quick-filters {
    z-index: 1; /* Below dropdown layer when expanded */
}

.quick-filter-btn {
    flex: 1;
    min-width: 100px;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.quick-filter-btn svg {
    flex-shrink: 0;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.quick-filter-btn .filter-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.125rem;
    margin-left: 5px;
}

.quick-filter-btn:hover {
    background: #f8f9fa;
    border-color: #ced4da;
}

.quick-filter-btn:hover svg {
    opacity: 1;
}

.quick-filter-btn.active {
    background: #212529;
    border-color: #212529;
    color: white;
}

.quick-filter-btn.active svg {
    opacity: 1;
}

.filter-label {
    font-size: 0.875rem;
    font-weight: 600;
}

.filter-price {
    font-size: 0.8125rem;
    color: #6c757d;
}

.quick-filter-btn.active .filter-price {
    color: #FFC107;
}

/* ===========================================
   AUTOCOMPLETE DROPDOWN FIX
   Lägg till i SLUTET av search.css
   =========================================== */

/* Fix all containers that might clip dropdown */
.search-card-compact,
.destination-field-compact,
.destination-field,
.col-12,
.col-md-6,
.col-lg,
.row,
.container {
    overflow: visible !important;
}

/* The .search-collapse-content handles its own overflow state via flights.css:
   - collapsed: overflow: hidden (hides dropdown)
   - expanded: overflow: visible (shows dropdown)
*/

/* Ensure dropdown is above everything */
.destination-dropdown {
    z-index: 10000 !important;
    overflow: visible !important;
}




/* Mobile Responsive */
@media (max-width: 768px) {
    .form-check-inline {
        margin-right: 1rem;
    }
    
    .btn-warning {
        padding: 0.875rem 1.5rem;
    }
    
    .search-card-compact {
        padding: 0.75rem;
    }
    
    .quick-filters {
        gap: 0.375rem;
    }
    
    .quick-filter-btn {
        min-width: 80px;
        padding: 0.625rem 0.75rem;
    }
    
    .filter-label {
        font-size: 0.8125rem;
    }
    
    .filter-price {
        font-size: 0.75rem;
    }
    
    /* Date fields stay col-6 (side by side), everything else full width */
    .search-card-compact .row > div[class*="col-"] {
        /* Let Bootstrap handle col-6 and col-12 naturally */
    }
    
    /* Date fields: side by side by default */
    .search-card-compact .row > .col-6.col-md-3 {
        flex: 0 0 calc(50% - 0.25rem) !important;
        max-width: calc(50% - 0.25rem) !important;
    }
    
    /* Add gap after first date field */
    .search-card-compact .row > .col-6.col-md-3:not(.return-date-field) {
        margin-right: 0.5rem !important;
    }
    
    /* When in enkelresa mode, departure date is full width */
    .search-card-compact.enkelresa-mode .row > .col-6.col-md-3:not(.return-date-field) {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        margin-right: 0 !important;
    }
    
    /* Keep search button full width */
    .search-card-compact .btn-warning {
        width: 100% !important;
        margin-top: 0.5rem !important;
    }
    
    /* Make search card relative for absolute positioning */
    .search-card-compact .row {
        position: relative;
        gap: 0 !important;
    }
    
    .search-card-compact .row > * {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    
    /* Override Bootstrap d-none and position swap button absolutely */
    .search-card-compact .d-none.d-lg-flex {
        display: block !important;
        position: absolute !important;
        right: 0.75rem;
        top: 4.5rem;
        flex: none !important;
        max-width: none !important;
        width: auto !important;
        padding: 0 !important;
        margin-bottom: 0 !important;
        z-index: 10;
    }
    
    /* Show swap button on mobile - positioned absolutely */
    .btn-swap-compact {
        display: flex !important;
        width: 48px !important;
        height: 48px !important;
        margin: 0;
    }
    
    .btn-swap-compact svg {
        width: 24px !important;
        height: 24px !important;
    }
}

/* Tablet/Desktop specific */
@media (min-width: 992px) {
    .btn-swap-compact {
        /* Desktop swap button is visible here */
    }
}
