/* ========================================
   FLIGHTS RESULTS PAGE STYLES
   ======================================== */

/* Results Search Section */
.results-search-section {
    background: #f8f9fa;
    padding: 1.5rem 0 2rem;
    border-bottom: 1px solid #e9ecef;
    transition: padding 0.3s ease;
    /* Keep overflow visible to prevent layout jumps - rely on child overflow control */
}

/* Collapsed state - minimal padding */
.results-search-section.collapsed {
    padding: 0.75rem 0;
}

/* Search Toggle Button */
.search-toggle-btn {
    width: 100%;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.search-toggle-btn:hover {
    border-color: #FFC107;
    background: #fff9e6;
}

.search-toggle-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.search-toggle-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.search-toggle-icon svg {
    color: #495057;
}

.search-toggle-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
}

/* Desktop: Display search info in one row */
@media (min-width: 769px) {
    .search-toggle-text {
        flex-direction: row;
        align-items: center;
        gap: 0.5rem;
    }
    
    .search-toggle-label::after {
        content: ':';
    }
}

.search-toggle-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #495057;
}

.search-toggle-summary {
    font-size: 0.813rem;
    color: #6c757d;
    text-align: left;
}

.search-toggle-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.search-toggle-arrow svg {
    color: #6c757d;
}

/* Rotate arrow when expanded */
.results-search-section:not(.collapsed) .search-toggle-arrow {
    transform: rotate(180deg);
}

/* Collapsible Content - Outer keeps overflow visible for dropdown */
.search-collapse-content {
    overflow: visible !important;
    position: relative;
    z-index: 5;
}

/* Inner wrapper handles the grid animation */
.search-collapse-inner {
    display: grid;
    grid-template-rows: 0fr;
    overflow: hidden;
    transition: grid-template-rows 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateZ(0);
    backface-visibility: hidden;
    margin-top: 0;
}

.search-collapse-inner > * {
    min-height: 0;
    opacity: 0;
    transform: translateY(-20px); /* Start position above */
    transition: opacity 0.2s ease 0s, transform 0.3s ease 0s; /* Slide up and fade out when collapsing */
}

.results-search-section:not(.collapsed) .search-collapse-inner {
    grid-template-rows: 1fr;
    overflow: visible;
    margin-top: 1.25rem;
}

.results-search-section:not(.collapsed) .search-collapse-inner > * {
    opacity: 1;
    transform: translateY(0); /* Slide to normal position */
    transition: opacity 0.3s ease 0.1s, transform 0.4s ease 0.1s; /* Slide down and fade in when expanding */
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .search-toggle-btn {
        padding: 0.875rem 1rem;
    }
    
    .search-toggle-icon {
        width: 36px;
        height: 36px;
    }
    
    .search-toggle-label {
        font-size: 0.813rem;
    }
    
    .search-toggle-summary {
        font-size: 0.75rem;
        text-align: left;
    }
}

.trip-type-compact {
    display: flex;
    gap: 1.5rem;
}

.trip-type-compact .form-check {
    margin: 0;
}

.trip-type-compact .form-check-label {
    font-size: 0.9rem;
    color: #495057;
    cursor: pointer;
}

.search-card-compact {
    background: white;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
}

.destination-field-compact {
    position: relative;
}

.btn-swap-compact {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
}

.btn-swap-compact:hover {
    background: #f8f9fa;
    border-color: #FFC107;
}

.btn-swap-compact svg {
    color: #6c757d;
}

/* Quick Filters */
.quick-filters {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.quick-filter-btn {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.quick-filter-btn:hover {
    border-color: #FFC107;
    background: #fff9e6;
}

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

.quick-filter-btn.active .filter-label,
.quick-filter-btn.active .filter-price {
    color: #000;
}

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

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

/* Results Section */
.results-section {
    padding: 2rem 0;
}

/* Filter Sidebar */
.results-sidebar {
    padding-right: 1.5rem;
}

.filter-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
}

.filter-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #212529;
    margin-bottom: 1.5rem;
}

.filter-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e9ecef;
}

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

.filter-subtitle {
    font-size: 0.9rem;
    font-weight: 600;
    color: #212529;
    margin-bottom: 1rem;
    user-select: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: color 0.2s ease;
}

.filter-subtitle.collapsible {
    cursor: pointer;
}

.filter-subtitle.collapsible:hover {
    color: #4da6ff;
}

.filter-subtitle.collapsible::after {
    content: '▼';
    font-size: 0.75rem;
    transition: transform 0.3s ease;
    color: #6c757d;
}

.filter-subtitle.collapsible.collapsed::after {
    transform: rotate(-90deg);
}

.filter-content {
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
}

.filter-content.collapsed {
    max-height: 0 !important;
    opacity: 0;
}

.filter-scrollable {
    max-height: 200px;
    overflow-y: auto;
}

.filter-scrollable::-webkit-scrollbar {
    width: 4px;
}

.filter-scrollable::-webkit-scrollbar-track {
    background: #f8f9fa;
}

.filter-scrollable::-webkit-scrollbar-thumb {
    background: #ced4da;
    border-radius: 2px;
}

.range-slider {
    padding: 0.5rem 0;
}

.range-values {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #6c757d;
}

.form-check {
    margin-bottom: 0.5rem;
}

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

/* Results Content */
.results-content {
    padding-right: 1.5rem;
}

.results-loading {
    padding: 1rem 0;
    background: white;
    border-bottom: 1px solid #e9ecef;
}

.loading-text {
    margin-top: 1rem;
    color: #6c757d;
    font-size: 0.9rem;
}

.results-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Flight Card - New Layout */
.flight-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
    transition: all 0.2s;
    margin-bottom: 1rem;
}

.flight-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    border-color: #FFC107;
}

.flight-card-main {
    display: flex;
    gap: 2rem;
}

/* Left Side - Airlines, Price, Buttons */
.flight-left-side {
    flex-shrink: 0;
    width: 220px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.airlines-and-price {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.airline-logos-vertical {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
}

.airline-logos-vertical img {
    height: 45px !important;
    object-fit: contain;
}

.price-section {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}

.price-large {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0066cc;
    white-space: nowrap;
}

.agency-badge {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    color: #6c757d;
}

.agency-badge img {
    height: 20px !important;
}

.agency-text {
    font-size: 0.875rem;
}

.baggage-info {
    font-size: 0.75rem;
    color: #6c757d;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.btn-go-to-trip {
    background: #4da6ff;
    color: white;
    border: none;
    padding: 0.75rem;
    border-radius: 8px;
    font-weight: 600;
    width: 100%;
}

.btn-go-to-trip:hover {
    background: #3d96ef;
}

.btn-show-details {
    background: white;
    color: #495057;
    border: 1px solid #dee2e6;
    padding: 0.75rem;
    border-radius: 8px;
    font-weight: 500;
    width: 100%;
}

.btn-show-details:hover {
    background: #f8f9fa;
    color: #495057;
}

/* Right Side - Flight Details */
.flight-right-side {
    flex: 1;
}

.flight-leg {
    /* Container for each flight leg */
}

.flight-times-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.time-block {
    flex: 0 0 auto;
}

.time-block:last-child {
    text-align: right; /* Align arrival time to the right */
}

.time-large {
    font-size: 1.5rem;
    font-weight: 700;
    color: #212529;
}

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

.duration-text {
    font-size: 0.875rem;
    color: #495057;
    font-weight: 600;
}

.flight-path-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.city-info {
    flex: 0 0 auto;
    min-width: 100px;
}

.city-info:last-child {
    text-align: right; /* Align arrival info to the right */
}

.city-name {
    font-size: 0.875rem;
    color: #495057;
    font-weight: 500;
    margin-top: -0.2rem;
}

.city-date {
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 0.125rem;
}

.path-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.path-line-container {
    display: flex;
    align-items: flex-start;
    width: 100%;
    position: relative;
}

.path-spacer {
    width: 5px;
    flex-shrink: 0;
}

.path-point {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}

.path-point:first-child {
    align-items: flex-start;
}

.path-point:last-child {
    align-items: flex-end;
}

.path-dot {
    width: 12px;
    height: 12px;
    background: #FFC107;
    border-radius: 50%;
    position: relative;
    z-index: 2;
    flex-shrink: 0;
}

.stop-dot {
    width: 12px;
    height: 12px;
    background: #FFC107;
    border-radius: 50%;
    position: relative;
    z-index: 2;
    flex-shrink: 0;
    top: 1px; /* Adjusted to 1px instead of 2px */
}

.path-line-part {
    flex: 1;
    height: 2px;
    background: linear-gradient(to right, #dee2e6 0%, #dee2e6 50%, transparent 50%, transparent 100%);
    background-size: 8px 2px;
    position: relative;
    align-self: flex-start;
    margin-top: 5px; /* Align with center of dot */
}

.iata-code {
    font-size: 0.875rem;
    font-weight: 600;
    color: #212529;
    white-space: nowrap;
}

/* Alternative Agencies */
.alternative-agencies {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.agency-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    min-width: 80px;
}

.agency-logo-small {
    height: 20px;
    object-fit: contain;
}

.agency-name {
    display: none; /* Hide agency name, only show image */
}

.agency-price {
    font-size: 0.875rem;
    font-weight: 600;
    color: #212529;
}

/* Old styles to keep for compatibility */
.airline-logos-container {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    flex-shrink: 0;
    min-width: 80px;
}

.airline-logos-container img {
    height: 30px;
    object-fit: contain;
}

.airline-logos {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.airline-logos img {
    height: 25px;
    object-fit: contain;
}

.airline-logo {
    flex-shrink: 0;
}

.airline-logo img {
    width: 60px;
    height: 40px;
    object-fit: contain;
}

.flight-route {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.flight-route-detailed {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 1rem;
}

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

.flight-time-detailed {
    text-align: center;
    min-width: 100px;
}

.flight-time .time,
.flight-time-detailed .time {
    font-size: 1.5rem;
    font-weight: 700;
    color: #212529;
    line-height: 1.2;
}

.flight-time-detailed .city {
    font-size: 0.875rem;
    color: #495057;
    margin-top: 0.25rem;
    font-weight: 500;
}

.flight-time-detailed .date {
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 0.125rem;
}

.flight-time .airport,
.flight-time-detailed .airport {
    font-size: 0.875rem;
    color: #6c757d;
    margin-top: 0.25rem;
    font-weight: 600;
}

.flight-path {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.duration-badge {
    font-size: 0.875rem;
    color: #495057;
    font-weight: 600;
    white-space: nowrap;
}

.path-line {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.path-line::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 2px;
    background: linear-gradient(to right, #dee2e6 0%, #dee2e6 50%, transparent 50%, transparent 100%);
    background-size: 10px 2px;
    transform: translateY(-50%);
    z-index: 0;
}

.path-dot {
    width: 12px;
    height: 12px;
    background: #FFC107;
    border-radius: 50%;
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

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

.duration-line {
    height: 2px;
    background: #dee2e6;
    margin-bottom: 0.5rem;
    position: relative;
}

.duration-line::before {
    content: '';
    position: absolute;
    left: 0;
    top: -3px;
    width: 8px;
    height: 8px;
    background: #FFC107;
    border-radius: 50%;
}

.duration-line::after {
    content: '';
    position: absolute;
    right: 0;
    top: -3px;
    width: 8px;
    height: 8px;
    background: #FFC107;
    border-radius: 50%;
}

.duration-text {
    font-size: 0.875rem;
    color: #212529;
    font-weight: 600;
}

.stops {
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

.flight-price {
    text-align: right;
    flex-shrink: 0;
}

.flight-price .price {
    font-size: 1.5rem;
    font-weight: 700;
    color: #212529;
    margin-bottom: 0.5rem;
}

.flight-details {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

/* Flight Details Container - Smooth collapse animation */
.flight-details-container {
    display: grid;
    grid-template-rows: 1fr;
    overflow: hidden;
    transition: grid-template-rows 0.5s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.5s ease;
    transform: translateZ(0);
    backface-visibility: hidden;
    opacity: 1;
}

.flight-details-container.collapsed {
    grid-template-rows: 0fr;
    opacity: 0;
}

.flight-details-container.loading {
    opacity: 0.6;
}

.flight-details-container > * {
    min-height: 0;
}

/* Mobile Filter Button */
.mobile-filter-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #FFC107;
    color: #000;
    border: none;
    border-radius: 50px;
    padding: 1rem 1.5rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 1000;
    cursor: pointer;
}

.mobile-filter-btn:hover {
    background: #f0b800;
}

/* Hide mobile-only elements on desktop */
.mobile-filter-header,
.mobile-filter-apply {
    display: none;
}

/* Desktop: Show normal filter title */
.filter-title {
    display: block;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .results-search-section {
        padding: 1rem 0 1.5rem;
    }

    .search-card-compact {
        padding: 1rem;
    }

    .quick-filters {
        justify-content: space-between;
    }

    .quick-filter-btn {
        flex: 1;
        min-width: 0;
        padding: 0.5rem;
    }

    .filter-label {
        font-size: 0.75rem;
    }

    .filter-price {
        font-size: 0.7rem;
    }

    /* Filter backdrop overlay */
    .filter-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1099;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }
    
    .filter-overlay.show {
        opacity: 1;
        pointer-events: auto;
    }

    .results-sidebar {
        position: fixed;
        top: 0;
        right: -90%;
        width: 85%;
        max-width: 400px;
        height: 100vh;
        background: white;
        z-index: 1100;
        padding: 0;
        overflow: hidden;
        transition: right 0.3s ease;
        display: flex;
        flex-direction: column;
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.2);
        border-radius: 16px 0 0 16px;  /* Rounded top-left and bottom-left */
    }
    
    .results-sidebar.show {
        right: 0;
    }
    
    /* Mobile Filter Header */
    .mobile-filter-header {
        background: #212529;
        color: white;
        padding: 1rem 1.25rem;
        display: flex;
        align-items: center;
        gap: 1rem;
        flex-shrink: 0;
        z-index: 10;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        height: 60px;  /* Fixed height */
        border-radius: 16px 0 0 0;  /* Rounded top-left corner */
    }
    
    /* Hide the desktop filter title on mobile */
    .results-sidebar .filter-card .filter-title {
        display: none;
    }
    
    .mobile-filter-close {
        background: none;
        border: none;
        color: white;
        font-size: 24px;
        cursor: pointer;
        padding: 0;
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        transition: background 0.2s;
    }
    
    .mobile-filter-close:hover {
        background: rgba(255, 255, 255, 0.1);
    }
    
    .mobile-filter-title {
        font-size: 1.125rem;
        font-weight: 600;
        margin: 0;
    }
    
    /* Mobile Filter Content */
    .results-sidebar .filter-card {
        height: calc(100vh - 60px - 88px);  /* Header (60px) + button with margins (88px) */
        overflow-y: auto;
        overflow-x: hidden;
        padding: 0;
        padding-bottom: 1rem;
        border: none;
        box-shadow: none;
        border-radius: 0;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Add proper spacing to filter sections on mobile */
    .results-sidebar .filter-section {
        padding: 1.25rem 1rem;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .results-sidebar .filter-section:last-child {
        border-bottom: none;
    }
    
    /* Mobile Filter Apply Button */
    .mobile-filter-apply {
        background: #FFC107;
        color: #212529;
        border: none;
        padding: 1rem 1.5rem;
        margin: 1rem;
        font-size: 1rem;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.2s;
        width: calc(100% - 2rem);
        border-radius: 8px;
        box-shadow: none;
        z-index: 11;
        flex-shrink: 0;
        display: block;
        height: auto;
    }
    
    .mobile-filter-apply:hover {
        background: #FFB300;
    }

    .results-content {
        padding-right: 12px;
    }

    .flight-card {
        padding: 0.75rem;  /* Reduced from 1rem */
    }

    .flight-card-main {
        flex-direction: column;
        gap: 0.5rem;  /* Reduced from 1rem for tighter spacing */
    }

    .flight-left-side {
        width: 100%;
        order: 2;
    }

    .flight-right-side {
        order: 1;
    }

    .airlines-and-price {
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
        margin-top: 0.75rem;
    }

    .flight-path-row {
        gap: 0;
    }

    .city-info {
        min-width: 80px;
    }

    .airline-logos-vertical {
        flex-direction: row;
    }

    .airline-logos-vertical img {
        height: 38px !important;
    }

    .airline-logos-vertical img {
        height: 38px !important;
    }

    .price-large {
        font-size: 1.25rem;  /* Reverted to original */
    }

    .time-large {
        font-size: 1.25rem;
    }

    .city-name {
        font-size: 0.75rem;
    }

    .city-date {
        font-size: 0.7rem;
    }

    .duration-text {
        font-size: 0.8rem;
    }

    .iata-code {
        font-size: 0.75rem;
    }

    .alternative-agencies {
        gap: 0.75rem;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.5rem;
    }
    
    /* Reduce spacing between flight legs on mobile */
    .flight-leg {
        margin-bottom: 0.5rem;
    }
    
    .flight-leg:last-child {
        margin-bottom: 0;
    }
    
    .flight-times-row {
        margin-bottom: 0.375rem !important;
    }
    
    /* Make action buttons side-by-side on mobile */
    .action-buttons {
        flex-direction: row !important;
        gap: 0.5rem;
    }
    
    .btn-go-to-trip,
    .btn-show-details {
        padding: 0.625rem 0.75rem !important;
        font-size: 0.875rem !important;
        flex: 1;
        white-space: nowrap;
    }
    
    /* Make alternative agencies more compact on mobile */
    .agency-option {
        min-width: 60px;
        font-size: 0.75rem;
        flex-shrink: 0 !important;
    }
    
    .agency-price {
        font-size: 0.75rem;
    }
    
    /* Reduce airlines and price gap */
    .airlines-and-price {
        gap: 0.5rem !important;
    }
    
    /* Reduce duration text size */
    .duration-text {
        font-size: 0.75rem !important;
    }

    /* Hide scrollbar but keep functionality */
    .alternative-agencies::-webkit-scrollbar {
        height: 4px;
    }

    .alternative-agencies::-webkit-scrollbar-track {
        background: transparent;
    }

    .alternative-agencies::-webkit-scrollbar-thumb {
        background: #dee2e6;
        border-radius: 2px;
    }

    .flight-header {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .airline-logos-container {
        width: 100%;
        justify-content: flex-start;
    }

    .airline-logos-container img {
        height: 25px;
    }

    .airline-logo {
        width: 100%;
    }

    .flight-time .time {
        font-size: 1.1rem;
    }

    .flight-price .price {
        font-size: 1.25rem;
    }
}

@media (max-width: 768px) and (min-width: 769px) {
    /* This range intentionally left empty - removed overly aggressive tablet styles */
}

@media (max-width: 768px) {
    .results-section {
        padding: 1rem 0;
    }

    .results-content {
        padding-right: 12px;
    }

    .flight-time-detailed {
        min-width: 80px;
    }

    .flight-time-detailed .time {
        font-size: 1.25rem;
    }

    .flight-time-detailed .city {
        font-size: 0.8rem;
    }
}

/* Agency Search Animation - Modern Compact Design */
.agencies-search-animation {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 1rem 1rem;  /* Reduced from 2rem for tighter spacing */
}

/* Progress Header */
.search-progress-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    text-align: left;  /* Override parent center alignment */
}

.search-spinner {
    width: 32px;  /* Reduced from 40px to fit better inline */
    height: 32px;
    border: 3px solid #e9ecef;
    border-top-color: #4da6ff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}

.search-progress-content {
    flex: 1;
}

.search-title-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;  /* Reduced gap */
    flex-wrap: wrap;
}

.search-title {
    font-size: 1.125rem;  /* Slightly smaller */
    font-weight: 700;
    color: #212529;
    margin: 0;
    line-height: 1;  /* Tighter line height */
}

.search-stats-inline {
    display: flex;
    align-items: baseline;
    gap: 0.375rem;  /* Reduced gap */
    background: #e3f2fd;
    padding: 0.25rem 0.75rem;  /* Reduced padding */
    border-radius: 16px;  /* Slightly smaller radius */
}

.search-hits-count {
    font-size: 1.25rem;  /* Reduced from 1.5rem */
    font-weight: 700;
    color: #4da6ff;
    line-height: 1;
    transition: all 0.3s ease;
}

.search-hits-label {
    font-size: 0.7rem;  /* Slightly smaller */
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.search-subtitle {
    color: #6c757d;
    margin: 0.375rem 0 0 0;  /* Small top margin to separate from title row */
    font-size: 0.875rem;
}

/* Progress Bar */
.search-progress-bar {
    width: 100%;
    height: 4px;
    background: #e9ecef;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.search-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4da6ff 0%, #7ec8ff 100%);
    width: 0%;
    transition: width 0.3s ease;
    animation: progressPulse 1.5s ease-in-out infinite;
}

@keyframes progressPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Compact Agency Grid */
.agencies-compact-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

.agency-compact-item {
    position: relative;
    width: 80px;
    height: 80px;
    background: white;
    border-radius: 12px;
    border: 2px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    opacity: 0;
    transform: scale(0.8);
}

.agency-compact-item.visible {
    opacity: 1;
    transform: scale(1);
}

.agency-compact-item img {
    max-width: 70%;
    max-height: 70%;
    object-fit: contain;
}

.agency-compact-item.completed {
    border-color: #28a745;
    background: #f0fff4;
}

/* Desktop specific styles */
@media (min-width: 992px) {
    .agencies-search-animation {
        max-width: 1100px;
        padding: 2.5rem 2rem;
    }
    
    .search-progress-header {
        gap: 1.5rem;
    }
    
    .agencies-compact-grid {
        gap: 1rem;
    }
    
    .agency-compact-item {
        width: 90px;
        height: 90px;
    }
    
    /* Ensure flight cards use desktop layout */
    .flight-card-main {
        flex-direction: row !important;
        gap: 2rem;
    }
    
    .flight-left-side {
        width: 220px !important;
        order: 0 !important;
    }
    
    .flight-right-side {
        order: 0 !important;
    }
    
    .airlines-and-price {
        flex-direction: column !important;
        align-items: flex-start !important;
    }
}
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 0.75rem;
    display: none; /* Hidden initially */
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    animation: fadeInScale 0.3s ease;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.agency-compact-item img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: grayscale(100%) opacity(0.3);
    transition: filter 0.3s ease;
}

.agency-compact-item.completed img {
    filter: grayscale(0%) opacity(1);
}

.agency-status {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 20px;
    height: 20px;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.agency-compact-item.searching .agency-status {
    border-color: #4da6ff;
    background: #4da6ff;
}

.agency-compact-item.searching .agency-status::after {
    content: '';
    width: 8px;
    height: 8px;
    border: 2px solid white;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.agency-compact-item.completed .agency-status {
    border-color: #28a745;
    background: #28a745;
}

.agency-compact-item.completed .agency-status::before {
    content: '✓';
    color: white;
    font-size: 12px;
    font-weight: bold;
    line-height: 1;
}

.agency-compact-item.completed {
    border-color: #28a745;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.15);
}

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

@media (max-width: 768px) {
    .agencies-search-animation {
        padding: 0.75rem 1rem;  /* Reduced from 1.5rem for tighter mobile spacing */
        max-width: 100%;  /* Full width on mobile */
    }
    
    .search-title {
        font-size: 1.125rem;
    }
    
    .search-hits-count {
        font-size: 1.5rem;
    }
    
    .agency-compact-item {
        width: 70px;
        height: 70px;
    }
    
    .agencies-compact-grid {
        gap: 0.5rem;
    }
    
    /* Mobile styles for new loading layout */
    .search-progress-header {
        gap: 0.75rem;
        margin-bottom: 0.75rem;
        flex-direction: row;  /* Keep inline on mobile too */
    }
    
    .search-spinner {
        width: 28px;  /* Smaller on mobile */
        height: 28px;
    }
    
    .search-title {
        font-size: 1rem;
    }
    
    .search-title-row {
        gap: 0.5rem;
    }
    
    .search-stats-inline {
        padding: 0.25rem 0.625rem;
    }
    
    .search-hits-count {
        font-size: 1.125rem;
    }
    
    .search-hits-label {
        font-size: 0.65rem;
    }
    
    .search-subtitle {
        font-size: 0.813rem;
    }
    
    .agencies-compact-grid {
        justify-content: center;  /* Center on mobile for better balance */
    }
    
    .agency-compact-item {
        width: 70px;
        height: 70px;
    }
}

/* Flight Details Container */
.flight-details-container {
    margin-top: 1rem;
    background: white;
}

/* Ticket Details Structure */
.ticket-details__item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ticket-details__ariline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 0;
    margin-top: 1rem;
    border-bottom: 1px solid #e9ecef;
}

.ticket-details__ariline:first-child {
    margin-top: 0;
}

.ticket-details__ariline-logo {
    height: 24px;
}

.ticket-details__ariline-name {
    font-weight: 600;
    font-size: 0.875rem;
}

/* Direction Title */
.direction-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #212529;
    margin: 1.5rem 0 0.75rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #dee2e6;
}

/* Direction Separator */
.direction-separator {
    margin: 1.5rem 0;
    border-top: 2px solid #dee2e6;
}

/* Segment Structure - Airline on Left, Times Above Line */
.ticket__segment.segment.segment_detail {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1rem;
    padding: 1rem;
    margin: 0.5rem 0;
    background: #f8f9fa;
    border-radius: 8px;
    align-items: center;
}

/* Airline Logo on Left */
.segment__airline-left {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.5rem;
}

.segment__airline-left img {
    height: 35px;
    max-width: 80px;
    object-fit: contain;
}

/* Content Section */
.segment__content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

/* Times Row (Top) */
.segment__times-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1rem;
    align-items: center;
}

.segment__time-left {
    font-size: 1.5rem;
    font-weight: 700;
    color: #212529;
    text-align: left;
}

.segment__duration-center {
    font-size: 0.875rem;
    color: #6c757d;
    text-align: center;
    white-space: nowrap;
}

.segment__time-right {
    font-size: 1.5rem;
    font-weight: 700;
    color: #212529;
    text-align: right;
}

/* Path Row (Bottom) */
.segment__path-row {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 1rem;
    align-items: start;
}

.segment__location-left {
    display: block !important;
    text-align: left;
    min-width: 100px;  /* Match city-info */
}

.segment__location-right {
    display: block !important;
    text-align: right;
    min-width: 100px;  /* Match city-info */
}

.segment__city {
    font-size: 0.875rem;
    color: #495057;
    font-weight: 500;
    margin-top: -0.2rem;
}

.segment__date {
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 0.125rem;
}

/* Path Visualization */
.segment__path-visual {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    align-items: center;
}

.segment__path-line-wrapper {
    display: flex;
    align-items: flex-start;  /* Changed from center to flex-start */
    width: 100%;
    position: relative;
}

.segment__path-dot-yellow {
    width: 12px;
    height: 12px;
    background: #FFC107;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(255, 193, 7, 0.3);
    flex-shrink: 0;
    z-index: 2;
}

.segment__path-line {
    flex: 1;
    height: 1px;
    background: repeating-linear-gradient(
        to right,
        #6c757d 0px,
        #6c757d 3px,
        transparent 3px,
        transparent 7px
    );
    margin: 0 4px;
    margin-top: 6px;  /* Half of dot height (12px / 2) to center the line with dots */
}

.segment__iata-row {
    display: flex;
    justify-content: space-between;
    width: 100%;
    padding: 0 2px;
}

.segment__path-iata {
    font-size: 0.875rem;
    font-weight: 600;
    color: #212529;
}

/* ========================================
   DUAL-HANDLE RANGE SLIDERS - WITH OFFSET
   Add this to the end of flights.css
   ======================================== */

.dual-range-container {
    position: relative;
    height: 40px;
    margin: 10px 0;
    padding: 0 10px;
}

.dual-range-container input[type="range"] {
    position: absolute;
    pointer-events: none;
    -webkit-appearance: none;
    background: transparent;
}

/* Min slider - slightly indented from left */
.dual-range-container input[type="range"]:first-child {
    width: calc(100% - 10px);
    left: 0;
    z-index: 1;
}

/* Max slider - slightly indented from right */
.dual-range-container input[type="range"]:last-child {
    width: calc(100% - 10px);
    right: 0;
    z-index: 1;
}

/* Hide the track on MAX slider */
.dual-range-container input[type="range"]:last-child::-webkit-slider-runnable-track {
    background: transparent;
}

.dual-range-container input[type="range"]:last-child::-moz-range-track {
    background: transparent;
}

/* Make ONLY the thumbs clickable - with HIGH z-index */
.dual-range-container input[type="range"]::-webkit-slider-thumb {
    pointer-events: all;
    cursor: pointer;
    position: relative;
    z-index: 999 !important;
}

.dual-range-container input[type="range"]::-moz-range-thumb {
    pointer-events: all;
    cursor: pointer;
    position: relative;
    z-index: 999 !important;
}

.segment__path-point {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.segment__path-iata {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6c757d;
    text-align: center;
}


@media (max-width: 768px) {


    /* Segment Structure - Airline on Left, Times Above Line */
.ticket__segment.segment.segment_detail {
    gap: 0;
}



    .flight-details-container {
        /* No padding */
    }
    
    .ticket__segment.segment.segment_detail {
        grid-template-columns: 1fr;
        padding: 0.75rem;
    }
    
    .segment__airline-left {
        padding: 0 0 0.5rem 0;
        justify-content: flex-start;
    }
    
    .segment__airline-left img {
        height: 30px;
    }
    
    .segment__time-left,
    .segment__time-right {
        font-size: 1.25rem;
    }
    
    .segment__path-row {
        grid-template-columns: auto 1fr auto;  /* Left - Center - Right like regular view */
        gap: 0.5rem;
        align-items: start;
    }
    
    .segment__location-left {
        text-align: left;
        min-width: 80px;  /* Match mobile city-info */
    }
    
    .segment__location-right {
        text-align: right;
        min-width: 80px;  /* Match mobile city-info */
    }
    
    /* Match mobile city-name and city-date font sizes */
    .segment__city {
        font-size: 0.75rem;  /* Match mobile city-name */
    }
    
    .segment__date {
        font-size: 0.7rem;  /* Match mobile city-date */
    }
}
/* ================================================
   noUiSlider overrides
   ================================================ */
.noUi-connect {
    background: #007bff;
}
.noUi-handle {
    border: 1px solid #007bff;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}
.noUi-handle::before,
.noUi-handle::after {
    display: none;
}
