/* Flight result cards + the nearby-dates prompt — shared between the full
   /flights/ results page and the AJAX quick-search popup (Milestone 23),
   so this must load wherever the ticket search card does, not just on the
   flights route. Moved out of pages/flights-listing.css for exactly that
   reason — it used to only exist there, so the popup's injected cards had
   no styling at all on the homepage. */

.soves-flight-result-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 20px;
}

.soves-flight-result-card {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 24px 26px;
    border: 1px solid rgba(230, 234, 240, 0.9);
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
    animation: sovesFlightCardEnter 0.28s ease both;
    transition: box-shadow 0.18s ease;
}

.soves-flight-result-card:hover {
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.12);
}

@keyframes sovesFlightCardEnter {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.soves-flight-result-card__badges {
    position: absolute;
    top: -11px;
    left: 22px;
    z-index: 1;
    display: flex;
    gap: 6px;
}

.soves-flight-result-card__badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border-radius: 999px;
    padding: 5px 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #ffffff;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.18);
}

.soves-flight-result-card__badge .soves-ms-icon {
    font-size: 13px;
}

.soves-flight-result-card__badge--cheapest {
    background: var(--soves-brand-accent, #00a8f0);
}

.soves-flight-result-card__badge--direct {
    background: var(--soves-primary, var(--soves-brand-primary));
}

.soves-flight-result-card__legs {
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex: 1 1 auto;
    min-width: 0;
}

.soves-flight-leg + .soves-flight-leg {
    padding-top: 16px;
    border-top: 1px solid var(--soves-border, #e1e7ef);
}

.soves-flight-leg__label {
    margin: 0 0 6px;
    color: var(--soves-primary, var(--soves-brand-primary));
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.soves-flight-leg__airline {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    color: var(--soves-text, #172033);
    font-size: 13px;
    font-weight: 600;
}

.soves-flight-leg__airline img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    border-radius: 6px;
    padding: 3px;
    background: var(--soves-soft, #f8fafc);
    border: 1px solid var(--soves-border, #e1e7ef);
}

.soves-flight-leg__route {
    display: flex;
    align-items: center;
    gap: 18px;
}

.soves-flight-leg__point {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.soves-flight-leg__point strong {
    font-size: 20px;
    color: var(--soves-text, #172033);
}

.soves-flight-leg__point span {
    font-size: 12px;
    color: var(--soves-muted, #667085);
    font-weight: 600;
    letter-spacing: 0.04em;
}

.soves-flight-leg__middle {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 120px;
    color: var(--soves-muted, #667085);
    font-size: 12px;
}

.soves-flight-leg__line {
    display: block;
    width: 100%;
    height: 1px;
    background: var(--soves-border, #e1e7ef);
    position: relative;
}

.soves-flight-leg__line::before,
.soves-flight-leg__line::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--soves-border, #e1e7ef);
    transform: translateY(-50%);
}

.soves-flight-leg__line::before {
    left: 0;
}

.soves-flight-leg__line::after {
    right: 0;
}

.soves-flight-leg__date {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 10px;
    padding: 4px 10px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--soves-primary, var(--soves-brand-primary)) 10%, #ffffff);
    color: var(--soves-primary, var(--soves-brand-primary));
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
}

.soves-flight-leg__nextday {
    margin-left: 3px;
    color: #b3261e;
    font-size: 10px;
    font-weight: 700;
}

.soves-flight-result-card__price {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    flex: 0 0 auto;
    padding-left: 24px;
    border-left: 1px solid var(--soves-border, #e1e7ef);
    text-align: right;
}

.soves-flight-result-card__price strong {
    font-size: 24px;
    font-weight: 700;
    color: var(--soves-text, #172033);
}

.soves-flight-result-card__price > span {
    font-size: 12px;
    color: var(--soves-muted, #667085);
}

/* .soves-booking-submit's real pill-button styling normally lives in
   hotel-booking.css, which isn't loaded on the flights route or the
   homepage popup — defined here so "Select" is never a bare unstyled
   link wherever a flight card renders. */
.soves-flight-result-card .soves-booking-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 4px;
    padding: 10px 22px;
    border: 0;
    border-radius: 999px;
    background: var(--soves-primary, var(--soves-brand-primary));
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: filter 0.15s ease;
}

.soves-flight-result-card .soves-booking-submit:hover,
.soves-flight-result-card .soves-booking-submit:focus-visible {
    filter: brightness(0.92);
}

@media (max-width: 720px) {
    .soves-flight-result-card {
        flex-direction: column;
        align-items: stretch;
    }

    .soves-flight-result-card__price {
        align-items: stretch;
        padding-left: 0;
        padding-top: 16px;
        border-left: 0;
        border-top: 1px solid var(--soves-border, #e1e7ef);
        text-align: left;
    }

    .soves-flight-leg__route {
        gap: 10px;
    }
}

.soves-search-overlay__count {
    margin: 0;
    color: var(--soves-muted, #667085);
    font-size: 13px;
    font-weight: 600;
    text-align: left;
}

.soves-search-overlay__message {
    margin: 0;
    color: var(--soves-text, #172033);
    font-size: 15px;
    font-weight: 600;
}

.soves-nearby-dates {
    --nd-accent: var(--soves-primary, var(--soves-brand-primary));
    margin: 16px auto 0;
    padding: 24px 22px;
    max-width: 560px;
    border: 1px solid var(--soves-border, #e1e7ef);
    border-radius: 16px;
    background: var(--soves-soft, #f8fafc);
    text-align: center;
}

.soves-nearby-dates__intro {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.soves-nearby-dates__intro[hidden],
.soves-nearby-dates__results[hidden] {
    display: none;
}

.soves-nearby-dates__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--nd-accent) 12%, #ffffff);
    color: var(--nd-accent);
}

.soves-nearby-dates__prompt {
    margin: 4px 0 0;
    color: var(--soves-text, #172033);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
}

.soves-nearby-dates__sub {
    margin: 0;
    color: var(--soves-muted, #667085);
    font-size: 14px;
    line-height: 1.5;
}

.soves-nearby-dates__yes {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    max-width: 380px;
    min-height: 48px;
    margin-top: 8px;
    padding: 12px 22px;
    border: 0;
    border-radius: 12px;
    background: var(--nd-accent);
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    box-shadow: 0 6px 16px color-mix(in srgb, var(--nd-accent) 32%, transparent);
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.soves-nearby-dates__yes:hover {
    filter: brightness(0.95);
    transform: translateY(-1px);
    box-shadow: 0 8px 20px color-mix(in srgb, var(--nd-accent) 38%, transparent);
}

.soves-nearby-dates__yes:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--nd-accent) 35%, transparent);
    outline-offset: 2px;
}

.soves-nearby-dates__yes:active {
    transform: translateY(0);
}

.soves-nearby-dates__yes:disabled {
    opacity: 0.6;
    cursor: default;
    transform: none;
}

.soves-nearby-dates__hint {
    margin: 0;
    color: var(--soves-muted, #667085);
    font-size: 12px;
    line-height: 1.5;
}

.soves-nearby-dates__results {
    margin-top: 0;
}

.soves-nearby-dates__progress {
    margin-bottom: 14px;
}

.soves-nearby-dates__status,
.soves-nearby-dates__summary {
    margin: 0 0 8px;
    color: var(--soves-text, #172033);
    font-size: 14px;
    font-weight: 600;
}

.soves-nearby-dates__bar {
    height: 6px;
    overflow: hidden;
    border-radius: 999px;
    background: color-mix(in srgb, var(--nd-accent) 14%, #ffffff);
}

.soves-nearby-dates__bar span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--nd-accent);
    transition: width 0.25s ease;
}

.soves-nearby-dates__empty,
.soves-nearby-dates__error {
    margin: 0;
    color: var(--soves-muted, #667085);
    font-size: 14px;
    line-height: 1.5;
}

.soves-nearby-dates__list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
    gap: 10px;
    max-height: 340px;
    overflow-y: auto;
    padding: 2px;
    text-align: center;
}

.soves-nearby-dates__option {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 12px 8px;
    border: 1px solid var(--soves-border, #e1e7ef);
    border-radius: 12px;
    background: #ffffff;
    color: var(--soves-text, #172033);
    text-decoration: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.soves-nearby-dates__option:hover,
.soves-nearby-dates__option:focus-visible {
    border-color: var(--nd-accent);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.1);
    transform: translateY(-1px);
}

.soves-nearby-dates__option small {
    color: var(--soves-muted, #667085);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.soves-nearby-dates__option strong {
    font-size: 14px;
    font-weight: 700;
}

.soves-nearby-dates__option span {
    margin-top: 2px;
    font-size: 14px;
    font-weight: 700;
    color: var(--nd-accent);
}

.soves-nearby-dates__option.is-cheapest {
    border-color: #1c9948;
    background: #f1faf4;
}

.soves-nearby-dates__option.is-cheapest span {
    color: #1c7a3d;
}

.soves-nearby-dates__option em {
    position: absolute;
    top: -9px;
    left: 50%;
    transform: translateX(-50%);
    padding: 2px 8px;
    border-radius: 999px;
    background: #1c9948;
    color: #ffffff;
    font-size: 10px;
    font-style: normal;
    font-weight: 700;
    white-space: nowrap;
}

@media (max-width: 520px) {
    .soves-nearby-dates {
        padding: 20px 16px;
    }

    .soves-nearby-dates__list {
        grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
    }
}

/* Inside the search popup the "other dates" box is the popup's own content, not a card within a card. */
.soves-hotel-search-overlay__panel .soves-nearby-dates {
    margin: 0;
    padding: 0;
    max-width: none;
    border: 0;
    background: transparent;
}

.soves-hotel-search-overlay__panel .soves-nearby-dates__prompt {
    font-size: 17px;
    font-weight: 700;
}

.soves-nearby-dates__progress {
    padding: 14px 16px;
    border: 1px solid var(--soves-border, #e1e7ef);
    border-radius: 12px;
    background: #ffffff;
    text-align: left;
}

.soves-nearby-dates__status,
.soves-nearby-dates__summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0 0 10px;
    font-size: 14px;
    font-weight: 600;
}

.soves-nearby-dates__bar {
    height: 8px;
}

/* Hover: a darker shade of the button's own colour (the theme's generic button:hover turned it red). */
.soves-nearby-dates .soves-nearby-dates__yes:hover,
.soves-nearby-dates .soves-nearby-dates__yes:focus-visible {
    background: color-mix(in srgb, var(--nd-accent) 82%, #000000);
    color: #ffffff;
    filter: none;
}

/* "Checking day 9 of 30": a roomy bordered box with a thick bar. */
.soves-hotel-search-overlay__panel .soves-nearby-dates__results {
    width: 100%;
}

.soves-nearby-dates__progress {
    margin: 0 auto 6px;
    padding: 22px 26px;
    border: 2px solid var(--soves-border, #dbe3ee);
    border-radius: 16px;
    background: #ffffff;
    text-align: center;
}

.soves-nearby-dates__status,
.soves-nearby-dates__summary {
    justify-content: center;
    margin: 0 0 14px;
    color: var(--soves-text, #172033);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.35;
}

.soves-nearby-dates__bar {
    height: 12px;
}

/* In the search popup the progress is part of the popup itself: no box around it. */
.soves-hotel-search-overlay__panel .soves-nearby-dates__progress {
    padding: 8px 0 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}
