/**
 * SkyTeam Travel - Premium Flight Cards
 * Google Flights inspired search results
 * v1.0.0
 */

/* ==========================================================================
   Flight Card - Main Container
   ========================================================================== */

.st-flight-result {
    background: var(--st-bg-card, #fff);
    border-radius: var(--st-radius-lg, 12px);
    box-shadow: var(--st-shadow-card, 0 2px 8px rgba(0, 0, 0, 0.08));
    margin-bottom: 16px;
    transition: all 0.25s ease;
    border: 2px solid transparent;
    overflow: hidden;
}

.st-flight-result:hover {
    box-shadow: var(--st-shadow-card-hover, 0 8px 25px rgba(0, 0, 0, 0.15));
    transform: translateY(-2px);
    border-color: var(--st-accent, #3554D1);
}

/* Card Inner Layout */
.st-flight-result-inner {
    display: flex;
    padding: 20px 24px;
    gap: 20px;
    align-items: center;
}

@media (max-width: 768px) {
    .st-flight-result-inner {
        flex-direction: column;
        padding: 16px;
        gap: 16px;
    }
}

/* ==========================================================================
   Airline Logo Section
   ========================================================================== */

.st-flight-airline {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100px !important;
    /* Increased from 80px */
    flex-shrink: 0;
    margin-right: 15px;
    text-align: center;
}

.st-flight-airline-logo {
    width: 80px !important;
    /* Increased from 64px */
    height: 80px !important;
    object-fit: contain;
    border-radius: 8px;
    background: #ffffff;
    /* White bg for better contrast */
    padding: 4px;
    /* Slight padding to prevent edge touching */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.st-flight-airline-name {
    font-size: 12px;
    font-weight: 500;
    color: var(--st-text-muted, #9CA3AF);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 75px;
}

@media (max-width: 768px) {
    .st-flight-airline {
        flex-direction: row;
        width: 100%;
        justify-content: flex-start;
        gap: 12px;
    }

    .st-flight-airline-logo {
        width: 48px;
        height: 48px;
    }

    .st-flight-airline-name {
        max-width: none;
    }
}

/* ==========================================================================
   Flight Info Section (Main content area)
   ========================================================================== */

.st-flight-info {
    flex: 1;
    min-width: 0;
}

/* Single Leg Row */
.st-flight-leg {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 8px 0;
}

.st-flight-leg+.st-flight-leg {
    border-top: 1px dashed var(--st-border-light, #E5E7EB);
    margin-top: 8px;
    padding-top: 16px;
}

.st-flight-leg-label {
    display: none;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--st-text-muted, #9CA3AF);
    margin-bottom: 8px;
}

@media (max-width: 768px) {
    .st-flight-leg-label {
        display: block;
    }

    .st-flight-leg {
        flex-wrap: wrap;
    }
}

/* ==========================================================================
   Time & Airport Display
   ========================================================================== */

.st-flight-endpoint {
    text-align: center;
    min-width: 70px;
}

.st-flight-time {
    font-family: var(--st-font-sans, 'Plus Jakarta Sans', sans-serif);
    font-size: 22px;
    font-weight: 700;
    color: var(--st-text-primary, #1F2937);
    font-feature-settings: 'tnum' 1;
    line-height: 1.2;
}

.st-flight-airport {
    font-size: 13px;
    font-weight: 500;
    color: var(--st-text-secondary, #6B7280);
    margin-top: 2px;
}

@media (max-width: 576px) {
    .st-flight-time {
        font-size: 18px;
    }

    .st-flight-endpoint {
        min-width: 55px;
    }
}

/* ==========================================================================
   Flight Timeline (Visual connector)
   ========================================================================== */

.st-flight-route {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 12px;
    min-width: 120px;
}

.st-flight-timeline-visual {
    width: 100%;
    height: 24px;
    position: relative;
    display: flex;
    align-items: center;
}

.st-flight-timeline-line {
    flex: 1;
    height: 2px;
    background: linear-gradient(90deg, var(--st-accent, #3554D1) 0%, var(--st-border-medium, #D1D5DB) 30%, var(--st-border-medium, #D1D5DB) 70%, var(--st-accent, #3554D1) 100%);
    position: relative;
}

/* Departure dot */
.st-flight-timeline-line::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    background: var(--st-accent, #3554D1);
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 0 2px var(--st-accent, #3554D1);
}

/* Arrival dot */
.st-flight-timeline-line::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    background: var(--st-accent, #3554D1);
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 0 2px var(--st-accent, #3554D1);
}

/* Stop indicator */
.st-flight-stop-dot {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    background: var(--st-warning, #F59E0B);
    border: 2px solid white;
    border-radius: 50%;
    z-index: 1;
}

/* Duration text */
.st-flight-duration {
    font-size: 12px;
    font-weight: 500;
    color: var(--st-text-secondary, #6B7280);
    margin-bottom: 4px;
}

/* Stops text */
.st-flight-stops {
    font-size: 11px;
    color: var(--st-text-muted, #9CA3AF);
    margin-top: 4px;
}

.st-flight-stops.nonstop {
    color: var(--st-success, #10B981);
    font-weight: 600;
}

.st-flight-stops.has-stops {
    color: var(--st-warning, #F59E0B);
}

/* ==========================================================================
   Price & CTA Section
   ========================================================================== */

.st-flight-price-section {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    padding-left: 20px;
    border-left: 1px solid var(--st-border-light, #E5E7EB);
    min-width: 140px;
}

@media (max-width: 768px) {
    .st-flight-price-section {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        padding-left: 0;
        padding-top: 16px;
        border-left: none;
        border-top: 1px solid var(--st-border-light, #E5E7EB);
    }
}

.st-flight-price {
    text-align: right;
}

.st-flight-price-amount {
    font-family: var(--st-font-sans, 'Plus Jakarta Sans', sans-serif);
    font-size: 26px;
    font-weight: 700;
    color: var(--st-primary, #1E243A);
    font-feature-settings: 'tnum' 1;
    line-height: 1.1;
}

.st-flight-price-currency {
    font-size: 14px;
    font-weight: 500;
    color: var(--st-text-secondary, #6B7280);
}

.st-flight-price-per {
    font-size: 12px;
    color: var(--st-text-muted, #9CA3AF);
}

@media (max-width: 576px) {
    .st-flight-price-amount {
        font-size: 22px;
    }
}

/* View Offer Button */
.st-flight-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--st-cta-gradient, linear-gradient(135deg, #E53935 0%, #EF5350 100%));
    color: white;
    font-family: var(--st-font-sans, 'Plus Jakarta Sans', sans-serif);
    font-size: 14px;
    font-weight: 600;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
    min-height: 44px;
    white-space: nowrap;
}

.st-flight-cta:hover {
    background: var(--st-cta-dark, #C62828);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(229, 57, 53, 0.3);
}

.st-flight-cta:active {
    transform: translateY(0);
}

/* ==========================================================================
   Flight Badges
   ========================================================================== */

.st-flight-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.st-flight-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.st-flight-badge-best {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: white;
}

.st-flight-badge-cheapest {
    background: var(--st-success-light, #D1FAE5);
    color: #047857;
}

.st-flight-badge-fastest {
    background: var(--st-info-light, #DBEAFE);
    color: var(--st-info, #3B82F6);
}

/* ==========================================================================
   Skeleton Loader for Flight Cards
   ========================================================================== */

.st-flight-skeleton {
    background: var(--st-bg-card, #fff);
    border-radius: var(--st-radius-lg, 12px);
    box-shadow: var(--st-shadow-card, 0 2px 8px rgba(0, 0, 0, 0.08));
    margin-bottom: 16px;
    padding: 24px;
}

.st-flight-skeleton-inner {
    display: flex;
    gap: 20px;
    align-items: center;
}

.st-skeleton-shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: st-card-shimmer 1.5s infinite;
    border-radius: 4px;
}

@keyframes st-card-shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.st-skeleton-logo {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    flex-shrink: 0;
}

.st-skeleton-content {
    flex: 1;
}

.st-skeleton-line {
    height: 14px;
    margin-bottom: 8px;
}

.st-skeleton-line-short {
    width: 40%;
}

.st-skeleton-line-medium {
    width: 60%;
}

.st-skeleton-line-long {
    width: 80%;
}

.st-skeleton-price {
    width: 100px;
    height: 32px;
    margin-left: auto;
}

/* ==========================================================================
   Mobile Sticky Bar
   ========================================================================== */

.st-mobile-sticky-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    padding: 12px 16px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    z-index: 100;
    justify-content: space-between;
    align-items: center;
}

@media (max-width: 768px) {
    .st-mobile-sticky-bar {
        display: flex;
    }

    /* Add padding to body when sticky bar is visible */
    body.has-sticky-bar {
        padding-bottom: 80px;
    }
}

/* ==========================================================================
   Search Results Header
   ========================================================================== */

.st-results-header {
    background: var(--st-bg-card, #fff);
    border-radius: var(--st-radius-lg, 12px);
    padding: 16px 24px;
    margin-bottom: 20px;
    box-shadow: var(--st-shadow-sm, 0 1px 2px rgba(0, 0, 0, 0.05));
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.st-results-count {
    font-size: 18px;
    font-weight: 600;
    color: var(--st-text-primary, #1F2937);
}

.st-results-count span {
    color: var(--st-accent, #FF690F);
}

.st-results-disclaimer {
    font-size: 13px;
    color: var(--st-text-muted, #9CA3AF);
}

/* Sort Button */
.st-sort-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--st-bg-hover, #F9FAFB);
    color: var(--st-text-primary, #1F2937);
    font-size: 14px;
    font-weight: 500;
    padding: 10px 16px;
    border-radius: 8px;
    border: 1px solid var(--st-border-light, #E5E7EB);
    cursor: pointer;
    transition: all 0.2s ease;
}

.st-sort-btn:hover {
    background: white;
    border-color: var(--st-accent, #FF690F);
    color: var(--st-accent, #FF690F);
}

/* ==========================================================================
   Filter Sidebar Enhancements
   ========================================================================== */

.st-filter-section {
    margin-bottom: 24px;
}

.st-filter-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--st-text-primary, #1F2937);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.st-filter-checkbox {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    cursor: pointer;
    transition: background 0.15s ease;
    border-radius: 6px;
    margin: 0 -8px;
    padding-left: 8px;
    padding-right: 8px;
}

.st-filter-checkbox:hover {
    background: var(--st-bg-hover, #F9FAFB);
}

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

.st-filter-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--st-accent, #3554D1);
    cursor: pointer;
}

.st-filter-checkbox-label {
    font-size: 14px;
    color: var(--st-text-primary, #1F2937);
}

.st-filter-checkbox-price {
    font-size: 13px;
    font-weight: 600;
    color: var(--st-accent, #3554D1);
}

/* Price Range Slider */
.st-price-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--st-border-light, #E5E7EB);
    outline: none;
    appearance: none;
    -webkit-appearance: none;
}

.st-price-slider::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: var(--st-accent, #3554D1);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(53, 84, 209, 0.3);
    border: 3px solid white;
}

.st-price-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--st-accent, #3554D1);
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid white;
}

/* ==========================================================================
   Expandable Flight Details
   ========================================================================== */

.st-flight-details-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px;
    background: #F8FAFC;
    border: none;
    border-top: 1px solid #E2E8F0;
    cursor: pointer;
    font-family: var(--st-font-body, 'Inter', sans-serif);
    font-size: 14px;
    font-weight: 600;
    color: #3554D1;
    transition: all 0.2s ease;
    border-radius: 0 0 12px 12px;
}

.st-flight-details-toggle:hover {
    background: #EEF2FF;
}

.st-flight-details-toggle svg {
    transition: transform 0.3s ease;
}

.st-flight-details-toggle.active svg {
    transform: rotate(180deg);
}

.st-flight-details-toggle.active {
    border-radius: 0;
}

.st-flight-details-panel {
    display: none;
    background: #FAFBFC;
    border-top: 1px solid #E2E8F0;
    padding: 24px;
    border-radius: 0 0 12px 12px;
}

.st-flight-details-panel.show {
    display: block;
}

/* Segment Row - Clean Grid Layout */
.st-segment-row {
    display: grid;
    grid-template-columns: 80px 1fr 80px;
    gap: 16px;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid #E2E8F0;
}

.st-segment-row:last-of-type {
    border-bottom: none;
}

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

.st-segment-time {
    font-family: var(--st-font-display, 'Plus Jakarta Sans', sans-serif);
    font-size: 18px;
    font-weight: 700;
    color: #1F2937;
    line-height: 1.2;
}

.st-segment-airport {
    font-size: 13px;
    font-weight: 600;
    color: #6B7280;
    margin-top: 2px;
}

.st-segment-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.st-segment-line {
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, #3554D1 0%, #94A3B8 50%, #3554D1 100%);
    position: relative;
}

.st-segment-line::before,
.st-segment-line::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    background: #3554D1;
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
}

.st-segment-line::before {
    left: 0;
}

.st-segment-line::after {
    right: 0;
}

.st-segment-details {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--st-font-body, 'Inter', sans-serif);
    font-size: 12px;
    color: #64748B;
}

.st-segment-details img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    border-radius: 4px;
}

.st-segment-flight-num {
    font-weight: 600;
    color: #374151;
}

.st-segment-duration {
    margin-left: auto;
    color: #6B7280;
}

/* Mobile adjustments for segment row */
@media (max-width: 576px) {
    .st-segment-row {
        grid-template-columns: 60px 1fr 60px;
        gap: 10px;
    }

    .st-segment-time {
        font-size: 15px;
    }

    .st-segment-airport {
        font-size: 11px;
    }
}

/* Layover Indicator */
.st-layover {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin: 12px 0;
    background: #FEF3C7;
    border-radius: 8px;
    border-left: 4px solid #F59E0B;
}

.st-layover-icon {
    font-size: 18px;
}

.st-layover-text {
    font-family: var(--st-font-body, 'Inter', sans-serif);
    font-size: 14px;
    font-weight: 600;
    color: #92400E;
}

.st-layover-airport {
    font-family: var(--st-font-body, 'Inter', sans-serif);
    font-size: 13px;
    font-weight: 500;
    color: #A16207;
}

/* Direction Label */
.st-direction-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--st-font-body, 'Inter', sans-serif);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 14px;
    border-radius: 6px;
    margin-bottom: 16px;
}

.st-direction-label.outbound {
    background: #DBEAFE;
    color: #1E40AF;
}

.st-direction-label.return {
    background: #D1FAE5;
    color: #047857;
    margin-top: 24px;
}