/* ============================================================
   Flight Itinerary Maker — custom styles
   (Tailwind via CDN handles the utility layer; this file adds
   the flight timeline, cards and print styles.)
   ============================================================ */

:root {
    --brand: #0284c7;
    --brand-dark: #0369a1;
}

body { font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Bengali", sans-serif; }

/* ---------- Airport autocomplete ---------- */
.ac-dropdown-item {
    padding: 0.6rem 0.9rem;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
}
.ac-dropdown-item:last-child { border-bottom: none; }
.ac-dropdown-item:hover,
.ac-dropdown-item.active { background: #f0f9ff; }
.ac-dropdown-item .ac-code { font-weight: 700; color: #0c4a6e; }
.ac-dropdown-item .ac-city { color: #64748b; font-size: 0.8rem; text-align: right; }
.ac-dropdown-item mark { background: #fef08a; padding: 0 2px; border-radius: 2px; }

/* ---------- Quick filter chips (stops / baggage checkboxes) ---------- */
.filter-chip { cursor: pointer; }
.filter-chip .chip-label {
    display: inline-flex; align-items: center;
    border: 1.5px solid #e2e8f0; background: #fff; color: #475569;
    border-radius: 999px; padding: 0.45rem 0.75rem;
    font-size: 0.78rem; font-weight: 600; line-height: 1;
    transition: all .15s ease;
    white-space: nowrap;
}
.filter-chip:hover .chip-label { border-color: #7dd3fc; color: #0369a1; }
.filter-chip input:checked + .chip-label {
    background: #0284c7; border-color: #0284c7; color: #fff;
    box-shadow: 0 2px 8px rgba(2, 132, 199, .35);
}

/* ---------- Flight option card ---------- */
.flight-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .06);
    transition: box-shadow .2s, transform .2s, border-color .2s;
}
.flight-card:hover {
    box-shadow: 0 12px 30px -12px rgba(2, 132, 199, .25);
    border-color: #bae6fd;
}
.flight-card.best-deal { border-color: #10b981; box-shadow: 0 0 0 1px #10b981; }

.price-badge {
    background: linear-gradient(135deg, #0ea5e9, #4f46e5);
    color: #fff;
    border-radius: 0.75rem;
    padding: 0.5rem 1rem;
    font-weight: 800;
    white-space: nowrap;
}
.stops-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    white-space: nowrap;
}
.stops-0 { background: #dcfce7; color: #166534; }
.stops-1 { background: #fef9c3; color: #854d0e; }
.stops-2 { background: #fee2e2; color: #991b1b; }

/* ---------- Layover timeline graphic ---------- */
.timeline {
    position: relative;
    margin: 0.4rem 0;
}
.timeline-line {
    position: relative;
    height: 3px;
    background: linear-gradient(90deg, #0ea5e9, #6366f1);
    border-radius: 3px;
    margin: 1.2rem 0.6rem;
}
.timeline-dot {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid #0ea5e9;
    z-index: 1;
}
.timeline-dot.layover { border-color: #f59e0b; }
.timeline-label {
    position: absolute;
    top: 1.1rem;
    transform: translateX(-50%);
    font-size: 0.7rem;
    font-weight: 700;
    color: #475569;
    white-space: nowrap;
}
.layover-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 0.6rem;
    padding: 0.25rem 0.65rem;
}

/* ---------- Skeleton loading ---------- */
.skeleton {
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
    border-radius: 0.75rem;
}
@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ---------- Deals table ---------- */
.deal-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.85rem 1.25rem; flex-wrap: wrap; }
.deal-row.is-best { background: #ecfdf5; }
.deal-rank {
    width: 1.6rem; height: 1.6rem; border-radius: 999px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.78rem; font-weight: 800; background: #e2e8f0; color: #475569;
}
.deal-rank.gold { background: #10b981; color: #fff; }

/* ---------- Print (itinerary) ---------- */
@media print {
    body { background: #fff; }
    header, footer, .print\:hidden { display: none !important; }
    .flight-card, .bg-white { box-shadow: none !important; }
}

/* ============================================================
   3D / dynamic interface elements
   ============================================================ */

/* Search card: floating 3D panel */
.search-3d {
    box-shadow:
        0 1px 0 rgba(255, 255, 255, .9) inset,
        0 30px 60px -20px rgba(2, 32, 71, .45),
        0 18px 36px -18px rgba(2, 132, 199, .35);
    transform-style: preserve-3d;
    transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s;
}

/* 3D push buttons */
.btn-3d {
    position: relative;
    transform: translateZ(0);
    box-shadow: 0 6px 0 #075985, 0 12px 20px -6px rgba(2, 132, 199, .55);
    transition: transform .08s ease, box-shadow .08s ease;
}
.btn-3d:active {
    transform: translateY(5px);
    box-shadow: 0 1px 0 #075985, 0 6px 10px -4px rgba(2, 132, 199, .5);
}
.btn-emerald-3d { box-shadow: 0 5px 0 #065f46, 0 12px 20px -8px rgba(5, 150, 105, .6); }
.btn-emerald-3d:active { box-shadow: 0 1px 0 #065f46; }

/* Trip type / mode segmented control with 3D indicator */
.seg-wrap { perspective: 600px; }
.seg-btn {
    transition: color .2s, transform .15s;
    border: 1px solid transparent;
}
.seg-btn.seg-active {
    background: linear-gradient(135deg, #0284c7, #4f46e5);
    color: #fff;
    box-shadow: 0 6px 14px -4px rgba(79, 70, 229, .6), 0 2px 0 #3730a3;
    transform: translateY(-1px);
}

/* Flight cards lift with a soft 3D tilt (JS adds .tilt on hover) */
.flight-card { transform: perspective(900px) rotateX(0) rotateY(0); }
.flight-card:hover { transform: translateY(-4px); }

/* Animated 3D plane in the hero */
@keyframes planeFloat {
    0%, 100% { transform: translate3d(0, 0, 0) rotate(-8deg); }
    50%      { transform: translate3d(14px, -18px, 0) rotate(-2deg); }
}
.plane-3d {
    font-size: 3.2rem;
    display: inline-block;
    animation: planeFloat 6s ease-in-out infinite;
    filter: drop-shadow(0 18px 14px rgba(0, 0, 20, .35));
}
@keyframes cloudDrift {
    from { transform: translateX(-10%); }
    to   { transform: translateX(110%); }
}
.cloud {
    position: absolute;
    font-size: 2rem;
    opacity: .5;
    animation: cloudDrift linear infinite;
    pointer-events: none;
}

/* Stat/result cards pop in */
@keyframes popIn {
    0%   { opacity: 0; transform: translateY(14px) scale(.98); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}
.pop-in { animation: popIn .4s cubic-bezier(.2,.8,.2,1) both; }

/* Passenger dropdown */
.pax-pop {
    box-shadow: 0 24px 50px -18px rgba(2, 32, 71, .4);
    transform-origin: top center;
    animation: popIn .18s ease both;
}

/* Rotating plane on loading */
@keyframes spin3d {
    from { transform: rotateY(0deg); }
    to   { transform: rotateY(360deg); }
}
.plane-spin { display: inline-block; animation: spin3d 1.4s linear infinite; }

/* Currency selector subtle 3D */
#currency-select:hover { transform: translateY(-1px); }

/* Floating "how it works" icons */
.feature-icon {
    transition: transform .3s cubic-bezier(.2,.8,.2,1);
}
.group:hover .feature-icon { transform: translateY(-6px) rotate(-6deg) scale(1.06); }

/* Mobile: keep a light 3D so it feels snappy */
@media (max-width: 640px) {
    .search-3d { box-shadow: 0 18px 40px -18px rgba(2, 32, 71, .4); }
}
@media (prefers-reduced-motion: reduce) {
    .plane-3d, .cloud, .pop-in, .plane-spin { animation: none !important; }
    .flight-card:hover { transform: none; }
}

/* ============================================================
   Visual date-range calendar (search box)
   ============================================================ */
.date-field .date-trigger {
    -webkit-appearance: none;
    appearance: none;
}
.date-field .date-trigger::-webkit-calendar-picker-indicator {
    display: none !important;
}
.date-field .date-icon {
    position: absolute;
    right: 12px;
    bottom: 11px;
    pointer-events: none;
    font-size: 0.95rem;
    opacity: .6;
}
.date-trigger.is-open {
    border-color: #0ea5e9 !important;
    box-shadow: 0 0 0 4px #e0f2fe;
}
.cal-pop {
    position: absolute;
    z-index: 40;
    margin-top: 6px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 24px 60px -18px rgba(2, 32, 71, .45);
    padding: 14px;
    width: 300px;
    animation: popIn .18s ease both;
}
.cal-pop.cal-align-end { right: 0; left: auto; }
.cal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.cal-head .cal-title { font-weight: 700; color: #0f172a; font-size: .85rem; text-transform: capitalize; }
.cal-nav {
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 8px;
    width: 28px; height: 28px;
    font-weight: 700;
    color: #475569;
    cursor: pointer;
}
.cal-nav:hover { background: #e0f2fe; color: #0369a1; }
.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    text-align: center;
}
.cal-dow {
    font-size: 10px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    padding: 4px 0;
}
.cal-day {
    border: none;
    background: none;
    font-size: 12px;
    font-weight: 600;
    color: #334155;
    padding: 7px 0;
    border-radius: 8px;
    cursor: pointer;
    position: relative;
}
.cal-day:hover { background: #e0f2fe; }
.cal-day.is-disabled { color: #cbd5e1; cursor: not-allowed; pointer-events: none; }
.cal-day.is-outside { visibility: hidden; }
.cal-day.in-range { background: #e0f2fe; border-radius: 0; color: #075985; }
.cal-day.range-start { background: #0284c7; color: #fff; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.cal-day.range-end { background: #0284c7; color: #fff; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.cal-day.range-start.range-end { border-radius: 8px; }
.cal-day.single-pick { background: #0284c7; color: #fff; }
.cal-hint {
    margin-top: 10px;
    font-size: 11px;
    color: #64748b;
    text-align: center;
    border-top: 1px solid #f1f5f9;
    padding-top: 8px;
}
.cal-clear {
    margin-top: 6px;
    width: 100%;
    font-size: 11px;
    font-weight: 700;
    color: #0369a1;
    background: #f0f9ff;
    border: none;
    border-radius: 8px;
    padding: 6px;
    cursor: pointer;
}
.cal-clear:hover { background: #e0f2fe; }

/* ============================================================
   3D pointer tilt + glare (flight cards, search box, features)
   ============================================================ */
.tilt-card {
    transform-style: preserve-3d;
    transition: transform .18s cubic-bezier(.2,.8,.2,1), box-shadow .25s ease;
    position: relative;
    will-change: transform;
}
.tilt-card::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: radial-gradient(
        260px circle at var(--glare-x, 50%) var(--glare-y, 0%),
        rgba(255, 255, 255, .35),
        rgba(255, 255, 255, 0) 60%
    );
    opacity: 0;
    transition: opacity .25s ease;
}
.tilt-card:hover::after { opacity: 1; }
.flight-card.tilt-card:hover {
    box-shadow: 0 26px 55px -22px rgba(2, 32, 71, .55);
}
.card-press { transform: scale(.985) !important; }

/* Keep inner controls above the glare layer and un-tilted text */
.tilt-card > * { transform: translateZ(0); }

/* 3D search button sheen sweep on hover */
.btn-3d {
    position: relative;
    overflow: hidden;
    transition: transform .15s cubic-bezier(.2,.8,.2,1), box-shadow .2s ease;
}
.btn-3d::before {
    content: "";
    position: absolute;
    top: 0; left: -120%;
    width: 60%; height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255,255,255,.45), transparent);
    transform: skewX(-20deg);
    transition: left .6s ease;
}
.btn-3d:hover::before { left: 130%; }
.btn-3d:active { transform: translateY(2px) scale(.99); }

/* Price badge subtle 3D pop on card hover */
.flight-card:hover .price-badge {
    transform: translateZ(30px) scale(1.05);
    display: inline-block;
}
.price-badge { transition: transform .2s ease; }

/* ============================================================
   PWA install banner
   ============================================================ */
.pwa-banner {
    position: fixed;
    left: 50%;
    bottom: 18px;
    transform: translate(-50%, 140%);
    z-index: 60;
    width: calc(100% - 24px);
    max-width: 560px;
    transition: transform .45s cubic-bezier(.2,.9,.25,1.1);
    pointer-events: none;
}
.pwa-banner.pwa-banner-show {
    transform: translate(-50%, 0);
    pointer-events: auto;
}
.pwa-banner-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #075985, #4338ca);
    color: #fff;
    border-radius: 18px;
    padding: 12px 14px;
    box-shadow: 0 24px 60px -18px rgba(2, 32, 71, .7);
    border: 1px solid rgba(255,255,255,.15);
}
.pwa-banner-icon {
    width: 44px; height: 44px;
    border-radius: 12px;
    background: #fff;
    padding: 4px;
    flex-shrink: 0;
    box-shadow: 0 6px 16px -6px rgba(0,0,0,.5);
}
.pwa-banner-text { flex: 1; min-width: 0; }
.pwa-banner-title { font-weight: 800; font-size: .92rem; margin: 0; }
.pwa-banner-sub { font-size: .76rem; opacity: .92; margin: 2px 0 0; line-height: 1.35; }
.pwa-btn {
    background: #fff;
    color: #0c4a6e;
    font-weight: 800;
    font-size: .82rem;
    border: none;
    border-radius: 999px;
    padding: 9px 16px;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 6px 14px -6px rgba(0,0,0,.5);
    transition: transform .15s ease;
}
.pwa-btn:hover { transform: translateY(-2px) scale(1.04); }
.pwa-close {
    background: rgba(255,255,255,.15);
    border: none;
    color: #fff;
    width: 28px; height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: .8rem;
    flex-shrink: 0;
}
.pwa-close:hover { background: rgba(255,255,255,.3); }
@media (max-width: 480px) {
    .pwa-banner-card { flex-wrap: wrap; }
    .pwa-banner-text { flex-basis: calc(100% - 56px); }
    .pwa-btn { margin-left: auto; }
}

@media (prefers-reduced-motion: reduce) {
    .tilt-card, .btn-3d, .pwa-banner { transition: none !important; }
    .tilt-card::after { display: none; }
}
