/* =======================================
   SkyFare - Custom Styles
   ======================================= */

/* Base */
* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navigation Links */
.nav-link {
    position: relative;
    font-weight: 500;
    color: #243b53;
    padding: 0.5rem 0;
    transition: color 0.3s;
}
.nav-link:hover,
.nav-link.active {
    color: #c49b3c;
}
.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: #c49b3c;
    transition: width 0.3s;
}
.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.mobile-nav-link {
    display: block;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    font-weight: 500;
    color: #243b53;
    transition: all 0.2s;
}
.mobile-nav-link:hover {
    background: #f0f4f8;
    color: #c49b3c;
}

/* Search Form Elements */
.search-select,
.search-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    color: #243b53;
    background: #f8fafc;
    transition: all 0.2s;
    appearance: auto;
}
.search-select:focus,
.search-input:focus {
    outline: none;
    border-color: #c49b3c;
    box-shadow: 0 0 0 3px rgba(196, 155, 60, 0.15);
    background: white;
}

/* Filter Elements */
.filter-select,
.filter-input {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 0.625rem;
    font-size: 0.8125rem;
    color: #243b53;
    transition: all 0.2s;
    appearance: auto;
}
.filter-select:focus,
.filter-input:focus {
    outline: none;
    border-color: #c49b3c;
    box-shadow: 0 0 0 2px rgba(196, 155, 60, 0.1);
}

/* Booking Form Elements */
.booking-input,
.booking-select {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 0.625rem;
    font-size: 0.875rem;
    color: #243b53;
    transition: all 0.2s;
    appearance: auto;
}
.booking-input:focus,
.booking-select:focus {
    outline: none;
    border-color: #c49b3c;
    box-shadow: 0 0 0 3px rgba(196, 155, 60, 0.15);
}

/* Flight Card Hover */
.flight-card {
    transition: all 0.3s ease;
}
.flight-card:hover {
    transform: translateY(-2px);
    border-color: #c49b3c;
}

/* Deal Card */
.deal-card {
    transition: all 0.3s ease;
}
.deal-card:hover {
    transform: translateY(-4px);
}

/* Step Indicators */
.step-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}
.step-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.4);
    border: 2px solid rgba(255,255,255,0.2);
    transition: all 0.3s;
}
.step-indicator.active .step-circle,
.step-indicator.completed .step-circle {
    background: #c49b3c;
    color: white;
    border-color: #c49b3c;
}
.step-indicator.completed .step-circle {
    background: #10b981;
    border-color: #10b981;
}
.step-label {
    font-size: 0.6875rem;
    color: rgba(255,255,255,0.4);
    font-weight: 500;
    white-space: nowrap;
}
.step-indicator.active .step-label,
.step-indicator.completed .step-label {
    color: white;
}
.step-line {
    flex: 1;
    height: 2px;
    background: rgba(255,255,255,0.15);
    margin-top: -1rem;
}

/* Booking Steps */
.booking-step {
    display: none;
    animation: fadeIn 0.4s ease;
}
.booking-step.active {
    display: block;
}

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

/* Line Clamp */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Hero */
.hero-section {
    position: relative;
    overflow: hidden;
}

/* Scroll Shadow for Nav */
#mainNav.scrolled {
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

/* Admin Sidebar */
.admin-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    color: #627d98;
    transition: all 0.2s;
}
.admin-link:hover,
.admin-link.active {
    background: #f0f4f8;
    color: #c49b3c;
}
.admin-link.active {
    background: linear-gradient(135deg, #c49b3c20, #c49b3c10);
    color: #c49b3c;
    font-weight: 600;
}
.admin-link i {
    width: 20px;
    text-align: center;
}

/* Responsive Table */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Toast */
.toast {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    color: white;
    font-weight: 500;
    z-index: 9990;
    animation: slideIn 0.3s ease, fadeOut 0.3s ease 3s forwards;
    max-width: 400px;
}
.toast.success { background: #10b981; }
.toast.error   { background: #ef4444; }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}
@keyframes fadeOut {
    to { opacity: 0; transform: translateY(-20px); }
}

/* Pulse phone animation */
@keyframes phonePulse {
    0%, 100% { transform: rotate(0deg); }
    25%      { transform: rotate(-5deg); }
    75%      { transform: rotate(5deg); }
}

/* =======================================
   WhatsApp Floating Button
   ======================================= */
.whatsapp-float {
    position: fixed;
    bottom: 108px;
    right: 28px;
    z-index: 9999;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    text-decoration: none;
}

.whatsapp-float .wa-label {
    background: #243b53;
    color: #fff;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: 20px;
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(0,0,0,0.2);
    opacity: 0;
    transform: translateX(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.whatsapp-float:hover .wa-label {
    opacity: 1;
    transform: translateX(0);
}

.whatsapp-float .wa-icon {
    position: relative;
    width: 58px;
    height: 58px;
    flex-shrink: 0;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(37, 211, 102, 0.45);
    animation: wa-entrance 2.5s ease-in-out 0.5s 1 both;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.whatsapp-float:hover .wa-icon {
    transform: scale(1.1);
    box-shadow: 0 6px 22px rgba(37, 211, 102, 0.6);
}

.whatsapp-float .wa-icon i {
    color: #fff;
    font-size: 28px;
}

/* Pulse ring */
.whatsapp-float .wa-icon::after {
    content: '';
    position: absolute;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: rgba(37, 211, 102, 0.35);
    animation: wa-pulse 2s ease-out 3.5s infinite;
}

/* Entrance bounce animation */
@keyframes wa-entrance {
    0%   { transform: scale(0.5);  opacity: 0; }
    40%  { transform: scale(1.5);  opacity: 1; }
    65%  { transform: scale(0.95); }
    80%  { transform: scale(1.3);  }
    90%  { transform: scale(0.98); }
    100% { transform: scale(1);    opacity: 1; }
}

/* Pulse ring animation */
@keyframes wa-pulse {
    0%   { transform: scale(1);   opacity: 1; }
    70%  { transform: scale(1.6); opacity: 0; }
    100% { transform: scale(1.6); opacity: 0; }
}

/* =======================================
   MOBILE RESPONSIVE FIXES
   ======================================= */

/* ---- Flight Card Mobile ---- */
@media (max-width: 768px) {

    /* Flight card — stack vertically on mobile */
    .flight-card .p-5,
    .flight-card .p-6 {
        padding: 1rem !important;
    }

    /* Search header on mobile */
    .search-header-title {
        font-size: 1.1rem !important;
    }

    /* WhatsApp button — smaller on mobile, move up more */
    .whatsapp-float {
        bottom: 90px;
        right: 16px;
    }
    .whatsapp-float .wa-icon {
        width: 48px;
        height: 48px;
    }
    .whatsapp-float .wa-icon i {
        font-size: 22px;
    }
    .whatsapp-float .wa-icon::after {
        width: 48px;
        height: 48px;
    }
    .whatsapp-float .wa-label {
        display: none; /* hide label on mobile */
    }

    /* Cookie banner — stack on mobile */
    #cookieBanner .flex {
        flex-direction: column;
        gap: 0.75rem;
    }

    /* Filter sidebar — make full width on mobile */
    .filter-select,
    .filter-input {
        font-size: 0.875rem;
        padding: 0.5rem 0.625rem;
    }

    /* Search inputs on homepage */
    .search-input,
    .search-select {
        font-size: 0.875rem;
        padding: 0.625rem 0.875rem;
    }

    /* Airport dropdown — full width on mobile */
    .airport-dropdown {
        left: 0 !important;
        right: 0 !important;
        font-size: 12px !important;
    }
    .airport-dropdown .airport-option {
        padding: 8px 10px !important;
        gap: 8px !important;
    }
    .airport-dropdown .airport-option span:first-child {
        font-size: 16px !important;
    }

    /* Package cards on multi-centre */
    .package-card {
        max-width: 100%;
    }

    /* Hero section text */
    h1 {
        word-break: break-word;
    }
}

/* ---- Flight card mobile specific layout ---- */
@media (max-width: 640px) {
    /* Flight route section — make it compact */
    .flight-card .flex.flex-col.lg\:flex-row {
        gap: 0.75rem;
    }

    /* Price section on mobile — horizontal layout */
    .flight-card .lg\:w-52 {
        width: 100%;
        border-top: 1px solid #f0f0f0;
        border-left: none !important;
        padding-top: 0.75rem;
        padding-left: 0 !important;
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
    }

    /* Price + CTAs side by side on mobile */
    .flight-card .lg\:w-52 > div:first-child {
        text-align: left !important;
    }

    .flight-card .lg\:w-52 .text-3xl {
        font-size: 1.5rem !important;
    }

    /* CTA buttons row on mobile */
    .flight-card .lg\:w-52 > div:last-child {
        flex-direction: row;
        gap: 0.5rem;
    }

    .flight-card .lg\:w-52 > div:last-child a {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
    }

    /* Airline name section on mobile */
    .flight-card .lg\:w-48 {
        width: 100%;
        flex-direction: row;
        align-items: center;
        gap: 0.75rem;
    }

    /* Route display on mobile — compact */
    .flight-card .flex-1 .text-xl {
        font-size: 1rem !important;
    }

    .flight-card .flex-1 .text-xs {
        font-size: 0.65rem !important;
    }

    /* "40 flights found" text */
    .flights-count {
        font-size: 0.875rem;
    }

    /* Search results header */
    .bg-gradient-to-r .text-2xl {
        font-size: 1.15rem !important;
    }

    /* Filter sidebar sticky — not sticky on mobile */
    .sticky {
        position: relative !important;
        top: auto !important;
    }

    /* Homepage search form */
    .search-form-grid {
        grid-template-columns: 1fr !important;
    }

    /* Nav Call Now button */
    .nav-call-btn {
        padding: 0.4rem 0.875rem !important;
        font-size: 0.8rem !important;
    }
}

/* ---- Tablet fixes (641px - 1023px) ---- */
@media (min-width: 641px) and (max-width: 1023px) {
    .flight-card .lg\:w-52 {
        width: 100%;
        border-top: 1px solid #f0f0f0;
        border-left: none !important;
        padding-top: 0.75rem;
        padding-left: 0 !important;
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
    .flight-card .lg\:w-52 > div:last-child {
        flex-direction: row;
        gap: 0.5rem;
    }
}

/* ---- Fix call me back widget on mobile ---- */
@media (max-width: 768px) {
    /* Push call me back widget up so it doesn't overlap cookie banner */
    [class*="responseiQ"],
    #responseiq-widget,
    .riq-widget {
        bottom: 90px !important;
    }
}