/* style.css */

/* ==========================================================================
   1. GLOBAL RESET & BASE SETTINGS
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', 'Segoe UI', sans-serif;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden; /* Task 10: Failsafe against horizontal scrolls on browsers */
}

body {
    min-height: 100vh;
    background: black no-repeat center center fixed;
    background-size: cover;
    color: white;
    overflow-x: hidden;
}

/* GLOBAL OVERLAY FOR DARK LUXURY THEME */
.global-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    z-index: -1;
}

/* ==========================================================================
   2. HEADER & NAVIGATION (TASK 5: PERFECT ALIGNMENT & SCREEN SAFETY)
   ========================================================================== */
.header {
    position: absolute;
    top: 25px;
    left: 0;
    width: 100%;
    padding: 18px 4%; /* Task 5: Fluid padding avoids edge collisions on any screen size */
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
}

.logo-area {
    flex: 0 1 auto;
    text-align: left;
}

.logo-area h2 {
    margin: 0;
    color: #fff;
    font-size: clamp(15px, 2vw, 25px); /* Fluid title prevents header overlaps on foldable/small viewports */
    font-weight: 500;
    line-height: 1.15;
    white-space: nowrap;
}

.logo-area .highlight {
    color: #FFC107;
    font-weight: 700;
}

.tagline {
    color: #ddd;
    font-family: "Trebuchet MS", sans-serif;
    font-style: italic;
    font-size: clamp(18px, 2.2vw, 28px); /* Task 3: Tagline increased by ~20% */
    margin-top: 6px;
    letter-spacing: .10px;
    text-align: center;
}

.top-nav {
    display: flex;
    gap: clamp(12px, 2vw, 35px); /* Task 5: Keeps links perfectly aligned & prevents overlaps */
    align-items: center;
    margin-left: 20px;
}

.top-nav a {
    color: #fff;
    text-decoration: none;
    font-size: clamp(13px, 1.2vw, 15px);
    font-weight: 400;
    letter-spacing: 1px;
    transition: .3s;
    white-space: nowrap;
}

.top-nav a:hover {
    color: #FFC107;
}

/* ==========================================================================
   3. HERO SECTION (TASK 2 & 4: OVERFLOW & COMPACT SPACING PREVENTIONS)
   ========================================================================== */
.hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 160px 8% 100px 8%;
    flex-wrap: wrap;
    min-height: 90vh;
    gap: 40px;
}

.left {
    max-width: 550px;
    flex: 1 1 450px; /* Tasks 2: Keeps Left block highly responsive so text never slips behind form */
    min-width: 280px;
    display: flex;
    flex-direction: column;
    align-items: center; /* Task 2: Keeps all nested text aligned to parent center */
    text-align: center;
}

.left h1 {
    margin: 0;
    line-height: 1.08;
    font-size: clamp(22px, 2.3vw, 38px); /* Task 2: Fluid clamp ensures no side/card overlaps on laptops */
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.left h1 span {
    color: #FFC107; /* Task 1: Color locked to gold */
    text-shadow: 0 0 20px rgba(255, 193, 7, .5); /* Task 1: Preserves premium glow */
    white-space: nowrap; /* Enforces single-line down to safety width of 340px */
    display: inline-block;
    max-width: 100%;
}

.highlight {
    color: #ffc107;
    font-weight: 600;
}
.hero-text {
    font-size: clamp(13px, 1.2vw, 16px);
    color: #ccc;
    line-height: 1.6;

    width: 100%;
    max-width: 520px;

    margin: clamp(20px,4vw,40px) auto 5px;
    padding: 0 12px;

    text-align: center;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: normal;
    box-sizing: border-box;

}
/* ==========================================================================
   4. BOOKING FORM & TRIP TOGGLE (TASK 6 & 7: LUXURY GLASSMORPHISM)
   ========================================================================== */
.form-box {
    padding: 35px;
    border-radius: 24px;
    width: min(100%, 390px);
    margin-inline: auto; /* Task 6: Centers perfectly horizontally when layout wraps to stacked view */
    box-sizing: border-box;
    flex: 0 0 390px;
}

/* TASK 7: PREMIUM LUXURY GLASS CARDS THAT STAND OUT SEAMLESSLY */
.form-box,
.fleet-card,
.why-card,
.routes-table {
    background: rgba(40, 40, 40, 0.72);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow:
        0 15px 45px rgba(0, 0, 0, 0.55),
        0 0 20px rgba(255, 255, 255, 0.05);
}

.form-box input, 
.form-box select {
    width: 100%;
    padding: 14px;
    margin: 10px 0;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08); /* Task 7: Lighter input glass visibility */
    color: white;
    outline: none;
    transition: 0.3s;
}

.form-box input::placeholder {
    color: white !important;
    opacity: 1;
}    

.form-box input:focus {
    border-color: #ffc107;
}

.label {
    font-size: 12px;
    color: #ffc107;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 10px;
}

.time-row {
    display: flex;
    gap: 10px;
}

.cars {
    display: flex;
    gap: 8px;
    margin: 15px 0;
}

.cars button {
    flex: 1;
    padding: 12px 5px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: transparent;
    color: white;
    cursor: pointer;
    font-size: 13px;
    transition: 0.3s;
}

.cars button.active {
    background: #ffc107;
    color: black;
    border-color: #ffc107;
    font-weight: 600;
}

.btn {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 12px;
    background: #ffc107;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: 0.3s;
    margin-top: 10px;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(255, 193, 7, 0.3);
}

.tag {
    text-align: center;
    margin-top: 15px;
    font-size: 13px;
    color: #888;
}

/* ========= TRIP TOGGLE ========= */
.trip-toggle {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 35px;
    margin-bottom: 22px;
}

.trip-btn {
    background: none;
    border: none;
    color: #FFC107;
    font-size: 15px;
    font-weight: 300;
    letter-spacing: .6px;
    cursor: pointer;
    padding-bottom: 6px;
    transition: .35s;
    border-bottom: 2px solid transparent;
}

.trip-btn:hover {
    color: #FFD54F;
}

.trip-btn.active {
    border-bottom: 2px solid #FFC107;
}

.return-trip-fields {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: .45s ease;
}

.return-trip-fields.show {
    max-height: 250px;
    opacity: 1;
    margin-top: 18px;
}

.return-trip-fields label {
    display: block;
    color: #fff;
    margin: 15px 0 8px;
    font-size: 14px;
}

.return-trip-fields input {
    width: 100%;
}

/* ==========================================================================
   5. SECTION COMMONS
   ========================================================================== */
.section {
    padding: 100px 8%;
}

.section-title {
    text-align: center;
    font-size: 42px;
    margin-bottom: 50px;
    font-weight: 700;
}

.section-title span {
    color: #ffc107;
}

/* ==========================================================================
   6. POPULAR ROUTES TABLE & CARDS (TASK 5 & 8: REBUILT CSS GRID ROWS)
   ========================================================================== */
.routes-glass {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

.routes-table {
    width: 95%;
    max-width: 1000px;
    margin: 50px auto;
    border-collapse: collapse;
    overflow: hidden;
    border-radius: 22px;
    animation: fadeUp .8s ease;
    overflow-x: auto;
}

/* TASK 5: Rebuilt internal tr rows using CSS Grid for perfect single-line scaling */
.routes-table tbody tr.route-item-row {
    display: grid;
    grid-template-columns: 1fr auto auto; /* Column 1: Snug route name, Column 2: Price, Column 3: Button */
    align-items: center;
    gap: clamp(10px, 2.5vw, 24px);
    padding: 14px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    transition: 0.35s ease;
    width: 100%;
}

/* Table header tr remains display: block for clean formatting across full width */
.routes-table tbody tr.route-header-row {
    display: block;
    width: 100%;
    padding: 0;
    border-bottom: none;
}

.routes-table tbody tr.route-header-row td {
    display: block;
    width: 100%;
}

/* Reset default tabular td structures so grid layout rules apply flawlessly */
.routes-table td {
    padding: 0 !important;
    border-bottom: none !important;
    width: auto !important;
    display: block;
}

/* TASK 5: Column 1 alignment (Route Name) */
.routes-table tbody tr.route-item-row td:nth-child(1) {
    text-align: left;
    font-size: clamp(14px, 1.4vw, 18px);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* TASK 8: Ellipsis fallback guarantees no overflows on foldable screen edges */
    min-width: 0;
}

/* TASK 5: Column 2 alignment (Price) */
.routes-table tbody tr.route-item-row td:nth-child(2) {
    color: #FFC107;
    font-weight: 700;
    font-size: clamp(14px, 1.4vw, 18px);
    white-space: nowrap;
    text-align: right;
    justify-self: end;
}

/* TASK 5: Column 3 alignment (Button wrapper) */
.routes-table tbody tr.route-item-row td:nth-child(3) {
    justify-self: end;
    text-align: right;
}

.table-heading {
    background: rgba(255, 193, 7, .12);
    color: #FFC107;
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    letter-spacing: 1px;
    padding: 16px !important;
}

.routes-table button {
    width: clamp(100px, 10vw, 130px);
    height: 38px;
    border: none;
    border-radius: 999px;
    background: #fff;
    color: #111;
    font-weight: 700;
    font-size: clamp(12px, 1vw, 14px);
    cursor: pointer;
    transition: 0.3s ease;
    white-space: nowrap;
}

.routes-table button:hover {
    background: #fff;
    box-shadow: 0 0 20px #FFC107;
    transform: translateY(-2px);
}

.routes-table button:active {
    transform: scale(.95);
    box-shadow: 0 0 12px #FFC107, 0 0 30px #FFC107;
}

/* TASK 9: Popular Routes subtitle styling */
.route-subtitle {
    color: rgba(255, 255, 255, 0.75);
    font-size: 14px;
    font-weight: 400;
    text-align: center;
    margin-top: 6px;
    margin-bottom: 18px;
    letter-spacing: .3px;
    text-transform: none;
    clear: both;
}

/* ==========================================================================
   7. FLEET Grid & CARDS
   ========================================================================== */
.fleet-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.fleet-card {
    border-radius: 24px;
    overflow: hidden;
    transition: 0.4s;
}

.fleet-card:hover {
    transform: translateY(-10px);
    border-color: rgba(255, 193, 7, 0.4);
}

.fleet-card img {
    width: 100%;
    height: 200px;
    object-fit: contain;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
}

.fleet-content {
    padding: 25px;
}

.fleet-content h3 {
    font-size: 20px;
    margin-bottom: 10px;
}

.fleet-tags {
    margin-bottom: 15px;
}

.fleet-tags span {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(255, 193, 7, 0.1);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.2);
    border-radius: 6px;
    font-size: 12px;
    margin-right: 5px;
}

.fleet-content p {
    font-size: 14px;
    color: #ccc;
    line-height: 1.6;
    margin-bottom: 20px;
}

.fleet-btn {
    width: 100%;
    padding: 14px;
    background: transparent;
    border: 1px solid #ffc107;
    color: #ffc107;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
}

.fleet-btn:hover {
    background: #ffc107;
    color: black;
}

/* ==========================================================================
   8. WHY CHOOSE US Grid & CARDS
   ========================================================================== */
.why-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

.why-card {
    text-align: center;
    padding: 40px;
    border-radius: 24px;
}

.why-card .icon {
    font-size: 40px;
    margin-bottom: 20px;
}

.why-card h3 {
    margin-bottom: 10px;
    color: #ffc107;
}

.why-card p {
    color: #aaa;
    font-size: 15px;
}

/* ==========================================================================
   9. FLOATING CALL BUTTON & MEDIA SAFETY
   ========================================================================== */
.call-float {
    position: fixed;
    right: 30px;
    bottom: 30px;
    background: #222;
    color: #ffc107;
    padding: 15px 25px;
    border-radius: 50px;
    border: 2px solid #ffc107;
    text-decoration: none;
    font-weight: 700;
    z-index: 100;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    transition: 0.3s;
}

.call-float:hover {
    transform: scale(1.1);
    background: #ffc107;
    color: black;
}

img {
    max-width: 100%;
    height: auto;
}

/* ==========================================================================
   10. ANIMATIONS
   ========================================================================== */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(25px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   11. SYSTEM RESPONSE & BREAKPOINT CONSOLIDATION (TASK 1: REMOVED DUPLICATIONS)
   ========================================================================== */

/* Tablet & Medium Laptop Adaptations */
@media (max-width: 1024px) {
    .fleet-grid, .why-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile & Small Tablet Adaptations (Stacked viewports spacing reduction) */
@media (max-width: 820px) {
    .hero {
        flex-direction: column;
        text-align: center;
        padding-top: 135px;
    }

    .left {
        max-width: 100%;
        width: 100%;
        margin: 0 auto;
    }

    .form-box {
        margin-top: 10px !important; /* TASK 4: Move booking card about 30px closer to the description */
        width: min(100%, 390px);
        margin-left: auto !important;
        margin-right: auto !important;
        float: none !important;
    }

    .routes-grid {
        grid-template-columns: 1fr;
    }

    .route-card {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .fleet-grid, .why-grid {
        grid-template-columns: 1fr;
    }

    .section-title {
        font-size: 32px;
    }

    .section {
        padding: 60px 5%;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 12px 20px;
    }

    .top-nav {
        gap: 20px;
    }

    .top-nav a {
        font-size: 14px;
    }

    .left h1 {
        font-size: clamp(16px, 5.2vw, 24px) !important; /* TASK 2: Scaled safely to avoid clipping on screens like iPhone SE */
        margin-top: 20px;
        text-align: center;
    }

    .tagline {
        font-size: clamp(14px, 3.5vw, 18px) !important; /* TASK 3: Fluid subtitle size scaling */
        text-align: center;
    }

    .form-box {
        margin-top: 10px !important; /* TASK 4: Reduced vertical gap by 30px to sit snug to description text */
        width: min(100%, 390px);
        padding: 25px;
    }

    .routes-table {
        width: 95%;
    }

    .routes-table th,
    .routes-table td {
        padding: 12px 8px;
        font-size: 15px;
    }

    /* --- TASK 5 & 8: POPULAR ROUTES MOBILE SINGLE-LINE WRAP FIX --- */
    .routes-table tbody tr.route-item-row {
        grid-template-columns: 1.8fr 0.6fr 1.2fr !important;
        padding: 12px 14px;
    }

    .routes-table tbody tr.route-item-row td:nth-child(1),
    .routes-table tbody tr.route-item-row td:nth-child(2) {
        font-size: clamp(12px, 3vw, 15px) !important;
    }

    .routes-table button {
        width: 90px;
        height: 34px;
        font-size: 12px;
    }

    .route-section-title {
        font-size: 18px;
    }

    .hero-text {
        margin-inline: auto;
    }
}

/* Extra Small Mobile Adaptations */
@media (max-width: 430px) {
    .header {
        padding-inline: 18px;
    }

    .top-nav {
        gap: 12px;
    }

    .top-nav a {
        font-size: 13px;
    }

    .left h1 {
        font-size: clamp(16px, 5.2vw, 22px) !important; /* TASK 2: Prevent text viewport collision */
    }

    .tagline {
        font-size: clamp(14px, 4.5vw, 18px) !important;
    }

    .hero-text {
        font-size: 13px;
    }

    .form-box {
        padding: 24px;
        width: 100%;
        max-width: 360px;
        margin-top: 10px !important;
    }

    /* --- TASK 5 & 8: POPULAR ROUTES HORIZONTAL SPACING --- */
    .routes-table tbody tr.route-item-row {
        grid-template-columns: 2fr 0.5fr 1.2fr !important; /* Max columns width allocation for route name column */
        padding: 10px 10px;
        gap: 8px;
    }

    .routes-table tbody tr.route-item-row td:nth-child(1),
    .routes-table tbody tr.route-item-row td:nth-child(2) {
        font-size: clamp(11px, 3.2vw, 13px) !important;
    }

    .routes-table button {
        width: 75px;
        height: 28px;
        font-size: 10px;
    }
}

@media (max-width: 360px) {
    .top-nav {
        gap: 10px;
    }

    .top-nav a {
        font-size: 12px;
    }

    .tagline {
        font-size: 13px !important;
    }

    .form-box {
        padding: 18px;
    }
}

/* Safe Wrapping below 340px strictly as defined */
@media (max-width: 340px) {
    .left h1 span {
        white-space: normal !important;
    }
    .hero-text {
        white-space: normal !important;
    }
}

/* ---------- GENERAL COHESIVE FIXES ---------- */
.hero {
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}

.left {
    flex: 1;
    min-width: 280px;
}

.form-box {
    flex: 0 0 390px;
    width: min(100%, 390px);
    margin-inline: auto;
}

/* ---------- HERO TITLE ---------- */
.left h1 {
    font-size: clamp(20px, 2.2vw, 36px); /* TASK 2: Scaled down safely to never extend behind booking card */
    line-height: 1.08;
    word-break: normal;
    overflow-wrap: normal;
}

/* ---------- HERO TEXT ---------- */
.hero-text {
    max-width: 520px;
    line-height: 1.6;
}

/* ---------- INPUTS ---------- */
.form-box input,
.form-box select {
    background: rgba(255, 255, 255, 0.08); /* TASK 7: Transparent glass background */
    border: 1px solid rgba(255, 255, 255, 0.14);
}

/* ---------- TABLE ---------- */
.routes-table {
    max-width: 100%;
    overflow-x: auto;
}