/* ============================================================
   BUS BOOKING SYSTEM — GLOBAL STYLES
   ============================================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { min-height: 100%; }
body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: #f5f7fa;
    color: #2c3e50;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
}
.container { max-width: 1180px; margin: 0 auto; padding: 0 1px; width: 100%; }

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: white;
    padding: 14px 0;
    box-shadow: 0 4px 16px rgba(0,0,0,.15);
    position: sticky;      /* स्क्रॉल करते समय top पर टिका रहे */
    top: 0;
    z-index: 1000;         /* content के ऊपर रहे */
    backdrop-filter: blur(10px);  /* modern look (optional) */
    border-bottom: 1px solid rgba(255,255,255,.06);
    width: 100%;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    position: relative;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    font-size: 1.35rem;
    font-weight: 800;
    text-decoration: none;
    letter-spacing: -.3px;
}
.logo-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    font-size: 1.1rem;
}
.logo span:last-child {
    background: linear-gradient(135deg, #a5b4fc, #f0abfc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.nav-links a {
    color: #cbd5e1;
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: .92rem;
    font-weight: 600;
    transition: .2s;
}
.nav-links a:hover { background: rgba(102,126,234,.18); color: white; }
.nav-links a.btn-primary { background: linear-gradient(135deg, #667eea, #764ba2); color: white !important; }
.nav-links a.btn-primary:hover { background: linear-gradient(135deg, #5568d3, #653f8f); }

.user-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px 4px 4px;
    background: rgba(255,255,255,.06);
    border-radius: 30px;
    margin-left: 4px;
}
.user-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    font-size: .78rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.user-info { color: #cbd5e1; font-size: .85rem; font-weight: 600; white-space: nowrap; }
.btn-logout { background: #ef4444; color: white !important; padding: 8px 16px; border-radius: 8px; }
.btn-logout:hover { background: #dc2626 !important; }

/* Hamburger toggle (mobile) */
.nav-toggle-checkbox { display: none; }
.nav-toggle-label {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 30px;
    height: 30px;
    cursor: pointer;
    z-index: 1100;
}
.nav-toggle-label span {
    display: block;
    width: 100%;
    height: 2.5px;
    border-radius: 2px;
    background: white;
    transition: .25s;
}
.nav-toggle-checkbox:checked ~ .nav-toggle-label span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle-checkbox:checked ~ .nav-toggle-label span:nth-child(2) { opacity: 0; }
.nav-toggle-checkbox:checked ~ .nav-toggle-label span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 860px) {
    .nav-toggle-label { display: flex; }
    .nav-links {
        position: absolute;
        top: calc(100% + 14px);
        left: 0;
        right: 0;
        background: #111827;
        border-radius: 14px;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        padding: 14px;
        box-shadow: 0 16px 32px rgba(0,0,0,.3);
        border: 1px solid rgba(255,255,255,.08);
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        pointer-events: none;
        transition: opacity .2s;
    }
    .nav-toggle-checkbox:checked ~ .nav-links {
        max-height: 80vh;
        opacity: 1;
        pointer-events: auto;
        overflow-y: auto;
    }
    .nav-links a { padding: 12px 14px; width: 100%; }
    .user-chip { margin: 4px 0 0; width: 100%; }
    .btn-logout, .nav-links a.btn-primary { text-align: center; }
}

/* ============================================================
   LAYOUT
   ============================================================ */
main { flex: 1 0 auto; padding: 30px 0; width: 100%; }
.section-title { margin: 20px 0; color: #1e293b; }
.text-center { text-align: center; }

/* ============================================================
   HERO
   ============================================================ */
.hero { background: linear-gradient(135deg, #3b82f6, #8b5cf6); color: white; padding: 50px 20px; border-radius: 12px; text-align: center; margin-bottom: 30px; }
.hero h1 { font-size: 2.2rem; margin-bottom: 10px; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-primary, .btn-danger, .btn-small {
    display: inline-block; padding: 10px 20px; border-radius: 8px;
    border: none; cursor: pointer; text-decoration: none;
    font-weight: 600; transition: .2s;
}
.btn-primary { background: #3b82f6; color: white; }
.btn-primary:hover { background: #2563eb; }
.btn-danger { background: #ef4444; color: white; }
.btn-danger:hover { background: #dc2626; }
.btn-block { width: 100%; }
.btn-large { padding: 14px 30px; font-size: 1.05rem; }
.btn-small { padding: 6px 12px; font-size: .85rem; }

/* ============================================================
   BUS CARDS (home + search)
   ============================================================ */
.bus-list { display: grid; gap: 20px; }
.bus-card { background: white; padding: 20px; border-radius: 12px; display: flex; justify-content: space-between; align-items: center; gap: 20px; box-shadow: 0 2px 8px rgba(0,0,0,.06); flex-wrap: wrap; }
.bus-card h3 small { color: #64748b; font-weight: 400; }
.route { font-size: 1.2rem; font-weight: 600; margin: 8px 0; }
.route .arrow { color: #3b82f6; margin: 0 10px; }
.prices { color: #475569; margin-top: 6px; }

/* ============================================================
   FORMS (auth + generic)
   ============================================================ */
.auth-form { max-width: 420px; margin: 40px auto; background: white; padding: 30px; border-radius: 12px; box-shadow: 0 4px 20px rgba(0,0,0,.08); }
.auth-form h2 { margin-bottom: 20px; text-align: center; }
.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 600; color: #334155; }
.form-group input, .form-grid input, .form-grid label { width: 100%; padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 1rem; }
.form-group input:focus { outline: none; border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,.1); }

/* ============================================================
   ALERTS
   ============================================================ */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 20px; }
.alert-error { background: #fee2e2; color: #991b1b; border-left: 4px solid #ef4444; }
.alert-success { background: #dcfce7; color: #166534; border-left: 4px solid #22c55e; }

/* ============================================================
   SEAT MAP (booking page)
   ============================================================ */
.booking-header { background: white; padding: 20px; border-radius: 12px; margin-bottom: 20px; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.seat-legend { display: flex; flex-wrap: wrap; gap: 15px; background: white; padding: 15px; border-radius: 10px; margin-bottom: 20px; }
.seat-legend span { display: flex; align-items: center; gap: 6px; font-size: .9rem; }
.seat-box { width: 22px; height: 22px; border-radius: 4px; display: inline-block; }
.seat-box.available { background: #dbeafe; border: 2px solid #3b82f6; }
.seat-box.selected { background: #22c55e; border: 2px solid #16a34a; }
.seat-box.booked { background: #e2e8f0; border: 2px solid #94a3b8; }
.seat-box.seating-tag { background: #fef3c7; border: 2px solid #f59e0b; }
.seat-box.sleeper-tag { background: #ede9fe; border: 2px solid #8b5cf6; }

.seat-section { background: white; padding: 20px; border-radius: 12px; margin-bottom: 20px; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.seat-section h3 { margin-bottom: 15px; color: #1e293b; }
.seat-section h3 small { color: #64748b; font-weight: 400; }
.seat-grid { display: grid; gap: 10px; }
.seating-grid { grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); }
.sleeper-grid { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); }

.seat {
    padding: 10px 6px; border-radius: 8px; text-align: center;
    cursor: pointer; transition: .2s; user-select: none;
    display: flex; flex-direction: column; align-items: center;
    gap: 4px; border: 2px solid transparent;
}
.seat.available { background: #dbeafe; border-color: #3b82f6; }
.seat.available:hover { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(59,130,246,.3); }
.seat.selected { background: #22c55e; border-color: #16a34a; color: white; }
.seat.booked { background: #e2e8f0; border-color: #94a3b8; color: #94a3b8; cursor: not-allowed; }
.seat.sleeper { border-radius: 12px 12px 4px 4px; }
.seat-icon { font-size: 1.1rem; }
.seat-num { font-size: .8rem; font-weight: 600; }

/* Booking summary (sticky) */
.booking-summary { background: white; padding: 20px; border-radius: 12px; position: sticky; bottom: 20px; box-shadow: 0 -2px 12px rgba(0,0,0,.1); }
.booking-summary ul { list-style: none; padding-left: 0; margin: 10px 0; }
.booking-summary li { padding: 5px 0; border-bottom: 1px dashed #e2e8f0; }
.booking-summary .total { font-size: 1.3rem; font-weight: 700; color: #1e293b; margin: 15px 0; }

/* ============================================================
   BOOKING CARD (generic — used in user area)
   ============================================================ */
.booking-card { background: white; padding: 20px; border-radius: 12px; margin-bottom: 15px; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.booking-card.cancelled { opacity: .7; }
.booking-header-row { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; flex-wrap: wrap; gap: 10px; }
.booking-status { display: flex; gap: 6px; flex-wrap: wrap; }

/* Badges */
.badge { padding: 4px 10px; border-radius: 20px; font-size: .78rem; font-weight: 600; text-transform: uppercase; }
.badge-confirmed, .badge-paid { background: #dcfce7; color: #166534; }
.badge-cancelled, .badge-refunded { background: #fee2e2; color: #991b1b; }
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-past { background: #e2e8f0; color: #475569; font-size: .75rem; }

/* Seat type badges */
.seats-info { margin: 10px 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.seat-type-badge { padding: 4px 10px; border-radius: 6px; font-size: .8rem; display: inline-block; }
.seat-type-badge.seating { background: #fef3c7; color: #92400e; }
.seat-type-badge.sleeper { background: #ede9fe; color: #5b21b6; }
.note { color: #92400e; margin-top: 10px; font-size: .9rem; }

/* ============================================================
   PAYMENT PAGE
   ============================================================ */
.payment-container { max-width: 700px; margin: 0 auto; }
.payment-summary, .payment-form { background: white; padding: 25px; border-radius: 12px; margin-bottom: 20px; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.payment-summary h3, .payment-form h3 { margin-bottom: 15px; }
.seat-list { list-style: none; margin: 15px 0; }
.seat-list li { padding: 8px 0; border-bottom: 1px solid #f1f5f9; display: flex; align-items: center; gap: 10px; }
.total-amount { font-size: 1.4rem; font-weight: 700; color: #1e293b; padding-top: 15px; border-top: 2px solid #e2e8f0; }
.payment-options { display: flex; flex-direction: column; gap: 10px; margin: 15px 0; }
.payment-options label { padding: 12px; border: 2px solid #e2e8f0; border-radius: 8px; cursor: pointer; transition: .2s; }
.payment-options label:hover { border-color: #3b82f6; background: #f0f9ff; }

/* ============================================================
   ADMIN — STATS + TABLES + FORMS
   ============================================================ */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin: 20px 0; }
.stat-card { background: white; padding: 25px; border-radius: 12px; text-align: center; box-shadow: 0 2px 8px rgba(0,0,0,.06); border-left: 4px solid #3b82f6; }
.stat-card h3 { font-size: 2rem; color: #1e293b; }
.stat-card p { color: #64748b; }

.data-table { width: 100%; background: white; border-collapse: collapse; border-radius: 12px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,.06); margin-top: 20px; }
.data-table th, .data-table td { padding: 12px; text-align: left; border-bottom: 1px solid #f1f5f9; }
.data-table th { background: #f8fafc; font-weight: 600; color: #475569; }
.data-table tr:hover { background: #f8fafc; }

.add-form { margin: 20px 0; }
.add-form summary { cursor: pointer; list-style: none; display: inline-block; }
.add-form summary::-webkit-details-marker { display: none; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; padding: 20px; background: white; border-radius: 12px; margin-top: 12px; }
.form-grid label { display: flex; flex-direction: column; font-size: .85rem; font-weight: 600; color: #475569; gap: 5px; }

/* ============================================================
   ADMIN — QUICK ACTIONS (dashboard)
   ============================================================ */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin: 20px 0 30px;
}

.action-card {
    background: white;
    padding: 22px;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    border-left: 4px solid #3b82f6;
    transition: .2s;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.action-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(59,130,246,.15);
    background: #f8fafc;
}

.action-icon { font-size: 2rem; margin-bottom: 6px; }
.action-title { font-weight: 700; color: #1e293b; font-size: 1.05rem; }
.action-desc { color: #64748b; font-size: .85rem; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer { background: #1e293b; color: #94a3b8; padding: 20px 0; text-align: center; margin-top: 40px; flex-shrink: 0; width: 100%; }

/* ============================================================
   STOP PICKER (book.php — choose from/to)
   ============================================================ */
.stop-picker { max-width: 550px; margin: 40px auto; background: white; padding: 30px; border-radius: 14px; box-shadow: 0 4px 20px rgba(0,0,0,.08); }
.stop-picker-form .form-group { margin-bottom: 18px; }
.stop-picker-form select { width: 100%; padding: 12px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 1rem; }

/* ============================================================
   JOURNEY BANNER (book page)
   ============================================================ */
.journey-banner {
    display: flex; align-items: center; gap: 16px;
    background: #f0f9ff; padding: 14px 20px; border-radius: 10px;
    margin: 12px 0; font-size: 1.05rem;
}
.journey-banner .label { color: #64748b; font-size: .8rem; text-transform: uppercase; font-weight: 600; }
.journey-banner strong { color: #1e293b; }
.journey-banner .arrow { color: #3b82f6; font-size: 1.4rem; }

.route-name { color: #64748b; font-size: .9rem; margin-top: 4px; }

/* ============================================================
   ADMIN — STOP ROWS + FARE TABLE (routes.php)
   ============================================================ */
.stop-row {
    display: flex; align-items: center; gap: 10px;
    padding: 10px; background: #f8fafc; border-radius: 8px; margin-bottom: 8px;
}
.stop-row .stop-index { font-weight: 700; color: #3b82f6; width: 40px; }
.stop-row input[type="text"] { flex: 1; padding: 10px; border: 1px solid #cbd5e1; border-radius: 6px; }

.fare-table { width: 100%; border-collapse: collapse; margin-top: 12px; background: white; }
.fare-table th, .fare-table td { padding: 8px; border: 1px solid #e2e8f0; text-align: center; font-size: .85rem; }
.fare-table th { background: #f1f5f9; }
.fare-table td.disabled { background: #f8fafc; color: #cbd5e1; }
.fare-table input { width: 100%; padding: 4px; border: 1px solid #e2e8f0; border-radius: 4px; font-size: .8rem; margin: 2px 0; }

.inline-form { display: flex; gap: 10px; margin: 20px 0; }
.inline-form input { flex: 1; padding: 12px; border: 1px solid #cbd5e1; border-radius: 8px; }

/* ============================================================
   USER BOOKINGS PAGE
   ============================================================ */
.booking-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
    margin: 20px 0 30px;
}

.stat-tile {
    background: white;
    padding: 18px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    border-left: 4px solid #3b82f6;
}

.stat-tile-value { font-size: 1.6rem; font-weight: 700; color: #1e293b; }
.stat-tile-label {
    font-size: .85rem; color: #64748b; margin-top: 4px;
    text-transform: uppercase; letter-spacing: .5px; font-weight: 600;
}

/* Bookings list */
.bookings-list { display: flex; flex-direction: column; gap: 18px; }

/* Enhanced booking card (user side) */
.booking-card {
    background: white;
    border-radius: 14px;
    box-shadow: 0 2px 10px rgba(0,0,0,.06);
    padding: 22px;
    border-left: 5px solid #3b82f6;
    transition: box-shadow .2s;
}
.booking-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,.1); }
.booking-card.cancelled { border-left-color: #ef4444; opacity: .85; background: #fefefe; }
.booking-card.past-trip { border-left-color: #94a3b8; }
.booking-card.past-trip.cancelled { border-left-color: #ef4444; }

/* Card header */
.booking-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid #f1f5f9;
}
.booking-card-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.booking-card-title h3 { font-size: 1.15rem; color: #1e293b; margin: 0; }

/* Booking reference row */
.booking-ref-row { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; font-size: .9rem; }
.ref-label { color: #64748b; font-weight: 600; }
.ref-code {
    background: #f1f5f9;
    padding: 4px 10px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    color: #1e293b;
    font-weight: 700;
    letter-spacing: .5px;
}
.copy-btn {
    background: none; border: 1px solid #e2e8f0; padding: 3px 8px;
    border-radius: 6px; cursor: pointer; font-size: .85rem; transition: .2s;
}
.copy-btn:hover { background: #f1f5f9; }
.copy-btn.copied { background: #dcfce7; border-color: #22c55e; color: #166534; }

/* Journey details (user card) */
.journey-details { background: #f8fafc; padding: 14px 18px; border-radius: 10px; margin-bottom: 16px; }
.route-name-label {
    display: inline-block;
    background: #e0e7ff;
    color: #3730a3;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: .78rem;
    font-weight: 600;
    margin-bottom: 12px;
}
.route-timeline-compact { display: flex; align-items: center; gap: 16px; margin-bottom: 10px; }
.route-point-compact .time-compact { font-size: 1rem; font-weight: 700; color: #1e293b; }
.route-point-compact .city-compact { font-size: .85rem; color: #475569; margin-top: 2px; }
.route-connector { flex: 1; display: flex; align-items: center; position: relative; min-width: 80px; }
.connector-line {
    flex: 1; height: 2px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    border-radius: 2px;
}
.connector-icon {
    position: absolute; left: 50%; top: 50%;
    transform: translate(-50%, -50%);
    background: #f8fafc; padding: 0 6px; font-size: .9rem;
}
.travel-date-line { color: #475569; font-size: .9rem; margin-top: 8px; }

/* Seats section */
.booking-seats-section { margin-bottom: 14px; }
.seats-header {
    font-size: .9rem; color: #475569; margin-bottom: 10px;
    text-transform: uppercase; letter-spacing: .5px; font-weight: 700;
}
.seats-list { display: flex; flex-direction: column; gap: 10px; }
.seat-group { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.seat-group-label { font-size: .85rem; color: #64748b; font-weight: 600; min-width: 90px; }
.seat-chips { display: flex; flex-wrap: wrap; gap: 6px; }

.seat-chip {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 5px 10px; border-radius: 8px;
    font-size: .85rem; font-weight: 700; cursor: help;
}
.seat-chip small { font-weight: 500; opacity: .75; font-size: .75rem; }
.seating-chip { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.sleeper-chip { background: #ede9fe; color: #5b21b6; border: 1px solid #ddd6fe; }

/* Payment row */
.booking-payment-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 0;
    border-top: 1px solid #f1f5f9;
    border-bottom: 1px solid #f1f5f9;
    flex-wrap: wrap; gap: 10px;
}
.payment-info { display: flex; align-items: baseline; gap: 10px; }
.payment-label {
    font-size: .85rem; color: #64748b; font-weight: 600;
    text-transform: uppercase; letter-spacing: .5px;
}
.payment-amount { font-size: 1.4rem; font-weight: 700; color: #16a34a; }
.booking-date-info { font-size: .82rem; color: #94a3b8; }

/* Booking actions */
.booking-actions {
    display: flex; justify-content: space-between; align-items: center;
    gap: 12px; margin-top: 16px; flex-wrap: wrap;
}
.cancel-timer {
    background: #fef3c7; color: #92400e;
    padding: 8px 14px; border-radius: 8px; font-size: .88rem;
}
.cancel-expired {
    background: #fee2e2; color: #991b1b;
    padding: 8px 14px; border-radius: 8px;
    font-size: .88rem; flex: 1;
}
.cancelled-info {
    color: #dc2626; font-size: .9rem; font-weight: 600;
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.refund-tag {
    background: #dcfce7; color: #166534;
    padding: 2px 8px; border-radius: 12px;
    font-size: .75rem; font-weight: 700;
}
.completed-info { color: #16a34a; font-size: .9rem; font-weight: 600; }

/* ============================================================
   ADMIN BOOKINGS PAGE
   ============================================================ */
.filter-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    background: white;
    padding: 18px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    margin: 20px 0;
    align-items: end;
}

.filter-field { display: flex; flex-direction: column; gap: 6px; }
.filter-field label {
    font-size: .78rem; font-weight: 700; color: #475569;
    text-transform: uppercase; letter-spacing: .5px;
}
.filter-field input,
.filter-field select {
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: .9rem;
    background: white;
}
.filter-field input:focus,
.filter-field select:focus {
    outline: none; border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,.1);
}
.filter-bar .btn-primary { align-self: end; height: 42px; }
.filter-bar .btn-small {
    align-self: end; height: 42px;
    display: inline-flex; align-items: center;
}

/* Bookings table cells */
.bookings-table code.ref-code { font-size: .75rem; white-space: nowrap; }
.journey-cell { display: flex; align-items: center; gap: 6px; font-size: .9rem; flex-wrap: wrap; }
.journey-cell .stop-name { font-weight: 600; color: #1e293b; }
.journey-cell .arrow { color: #3b82f6; font-weight: 700; }

.seat-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 4px; }
.seat-badges .seat-type-badge { font-size: .72rem; padding: 3px 7px; }

.text-muted { color: #94a3b8; }
.text-danger { color: #dc2626; font-weight: 600; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .hero h1 { font-size: 1.5rem; }
    .bus-card { flex-direction: column; align-items: flex-start; }
    .seating-grid, .sleeper-grid { grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); }
    .search-widget { grid-template-columns: 1fr; }
    .bus-card-search { flex-direction: column; align-items: stretch; }
}

@media (max-width: 640px) {
    .booking-stats { grid-template-columns: repeat(2, 1fr); }
    .route-timeline-compact { flex-direction: column; align-items: flex-start; gap: 8px; }
    .route-connector { width: 100%; min-height: 20px; }
    .booking-actions { flex-direction: column; align-items: stretch; }
    .booking-actions .btn-danger { text-align: center; }
    .booking-payment-row { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 900px) {
    .bookings-table { display: block; overflow-x: auto; white-space: nowrap; }
    .bookings-table thead,
    .bookings-table tbody,
    .bookings-table tr,
    .bookings-table th,
    .bookings-table td { display: revert; }
}

/* ============================================================
   SEARCH WIDGET
   ============================================================ */

/* Base widget (used on homepage inside hero) */
.search-widget {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 12px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 14px;
    margin-top: 25px;
    align-items: end;
}

/* Inline variant (used on search.php — white card on light background) */
.search-widget-inline {
    background: white;
    box-shadow: 0 4px 20px rgba(0,0,0,.08);
    margin: 20px 0 30px;
    backdrop-filter: none;
}

.search-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
}

.search-field label {
    font-size: .8rem;
    font-weight: 700;
    color: #1e293b;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.search-field input {
    padding: 12px 14px;
    border: 2px solid transparent;
    border-radius: 10px;
    font-size: 1rem;
    background: white;
    color: #1e293b;
    transition: .2s;
    width: 100%;
}

.search-widget-inline .search-field input {
    border: 1px solid #cbd5e1;
    background: #f8fafc;
}

.search-field input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59,130,246,.15);
    background: white;
}

.btn-search {
    padding: 12px 24px;
    white-space: nowrap;
    height: 48px;
    font-size: 1rem;
}

/* Popular routes chips inside hero */
.popular-routes {
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: center;
}

.popular-label {
    font-size: .9rem;
    opacity: .9;
    font-weight: 600;
}

.route-chip {
    background: rgba(255,255,255,.25);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: .85rem;
    text-decoration: none;
    transition: .2s;
    border: 1px solid rgba(255,255,255,.3);
}

.route-chip:hover {
    background: white;
    color: #3b82f6;
}

/* ============================================================
   SEARCH RESULTS PAGE
   ============================================================ */

.search-page {
    padding-bottom: 40px;
}

.search-page h2 {
    margin-bottom: 20px;
    color: #1e293b;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.results-header h3 {
    font-size: 1.15rem;
    color: #1e293b;
    font-weight: 500;
}

.results-header h3 strong {
    color: #3b82f6;
    font-weight: 700;
}

.results-count {
    background: #dbeafe;
    color: #1e40af;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: .85rem;
    font-weight: 600;
}

/* Enhanced bus card used on search page */
.bus-card-search {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    padding: 22px;
    border-left: 4px solid #3b82f6;
    align-items: stretch;
}

.bus-card-search .bus-info {
    flex: 1;
    min-width: 0;
}

.bus-title-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.bus-title-row h3 {
    color: #1e293b;
    font-size: 1.15rem;
    margin: 0;
}

.bus-num {
    background: #f1f5f9;
    color: #64748b;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: .78rem;
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

.bus-card-search .route-name {
    color: #64748b;
    font-size: .85rem;
    margin: 4px 0 14px;
}

/* Route timeline — from → to */
.route-timeline {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 16px 0;
}

.route-point {
    display: flex;
    flex-direction: column;
}

.route-point .time {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
}

.route-point .city {
    font-size: .85rem;
    color: #64748b;
    margin-top: 2px;
}

.route-duration {
    flex: 1;
    min-width: 100px;
}

.duration-line {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.duration-line .line {
    flex: 1;
    height: 2px;
    background: linear-gradient(90deg, #3b82f6 0%, #cbd5e1 50%, #8b5cf6 100%);
    border-radius: 2px;
    position: relative;
    display: block;
}

.duration-line .line::before,
.duration-line .line::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
}

.duration-line .line::before {
    left: -4px;
    background: #3b82f6;
}

.duration-line .line::after {
    right: -4px;
    background: #8b5cf6;
}

.travel-date {
    color: #475569;
    font-size: .9rem;
    margin: 10px 0 14px;
}

/* Seat availability row (two items: seating + sleeper) */
.seat-availability-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 14px;
}

.avail-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 10px;
}

.avail-item.sold-out {
    background: #fef2f2;
    border-color: #fecaca;
    opacity: .85;
}

.avail-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
}

.avail-type {
    font-size: .72rem;
    color: #64748b;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: .5px;
}

.avail-count {
    font-size: .85rem;
    color: #475569;
    margin-top: 2px;
}

.avail-count strong {
    color: #16a34a;
    font-size: 1rem;
}

.avail-item.sold-out .avail-count strong {
    color: #dc2626;
}

.avail-price {
    margin-left: auto;
    font-weight: 700;
    color: #1e293b;
    font-size: 1.05rem;
    white-space: nowrap;
}

/* Action column on the right of the card */
.bus-action {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-end;
    gap: 10px;
    min-width: 170px;
}

.bus-action-search {
    border-left: 1px dashed #e2e8f0;
    padding-left: 22px;
}

.bus-action .btn-large {
    width: 100%;
    text-align: center;
    white-space: nowrap;
}

.avail-note {
    font-size: .8rem;
    color: #16a34a;
    font-weight: 600;
}

.avail-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: .78rem;
    font-weight: 600;
    text-transform: uppercase;
}

.avail-yes { background: #dcfce7; color: #166534; }
.avail-no { background: #fee2e2; color: #991b1b; }

/* Empty state (no results) */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 15px;
    opacity: .5;
}

.empty-state h3 {
    color: #1e293b;
    margin-bottom: 8px;
}

.empty-state p {
    color: #64748b;
    margin-bottom: 20px;
}

/* Responsive — stack the search widget and card on small screens */
@media (max-width: 768px) {
    .search-widget,
    .search-widget-inline {
        grid-template-columns: 1fr;
    }
    .btn-search {
        width: 100%;
    }
    .bus-card-search {
        flex-direction: column;
        align-items: stretch;
    }
    .bus-action-search {
        border-left: none;
        border-top: 1px dashed #e2e8f0;
        padding-left: 0;
        padding-top: 16px;
        align-items: stretch;
        min-width: 0;
    }
    .seat-availability-row {
        grid-template-columns: 1fr;
    }
    .route-timeline {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .route-duration {
        width: 100%;
    }
    .results-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

.stop-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.stop-suggestion {
    display: inline-block;
    padding: 4px 10px;
    background: #f1f5f9;
    color: #334155;
    border-radius: 20px;
    font-size: .8rem;
    text-decoration: none;
    transition: .2s;
    border: 1px solid #e2e8f0;
}

.stop-suggestion:hover {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.empty-state .alert {
    margin-bottom: 15px;
}

.empty-state .btn-small {
    display: inline-block;
    margin-top: 8px;
}

/* ============================================================
   PASSENGER DETAILS FORM
   ============================================================ */
.passenger-section {
    background: white;
    padding: 22px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    border-left: 4px solid #8b5cf6;
}

.passenger-section h3 {
    color: #1e293b;
    margin-bottom: 6px;
}

.passenger-section .hint {
    color: #64748b;
    font-size: .85rem;
    margin-bottom: 16px;
}

#passengerForms {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.passenger-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px;
    transition: border-color .2s;
}

.passenger-card.invalid {
    border-color: #ef4444;
    background: #fef2f2;
}

.passenger-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px dashed #cbd5e1;
}

.passenger-number {
    font-weight: 700;
    color: #1e293b;
    font-size: .95rem;
}

.passenger-fields {
    display: grid;
    grid-template-columns: 2fr 1fr 1.2fr;
    gap: 12px;
}

.passenger-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.passenger-field span {
    font-size: .78rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: .3px;
}

.passenger-field input,
.passenger-field select {
    padding: 9px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: .92rem;
    background: white;
    transition: .2s;
}

.passenger-field input:focus,
.passenger-field select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}

@media (max-width: 640px) {
    .passenger-fields {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   HOMEPAGE — MODERN LOOK
   ============================================================ */

/* Hero */
.hero {
    background: linear-gradient(135deg, #e70bca 0%, #08af1e 100%);
    color: white;
    padding: 60px 30px;
    border-radius: 20px;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.25);
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    border-radius: 50%;
}

.hero-content { 
    position: relative; z-index: 1; text-align: center; 
     margin-top: -6%;
     margin-bottom: 1%;
}
.hero h1 { font-size: 2.4rem; margin-bottom: -5px; font-weight: 800; letter-spacing: -.5px; }
.hero-subtitle { font-size: 1.05rem; opacity: .9; margin-bottom: 10px; }

/* Search widget inside hero */
.hero .search-widget {
    margin-top: -5px;
    background: rgba(255, 255, 255, 0.98);
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,.15);
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 12px;
    align-items: end;
    max-width: 950px;
    margin-left: auto;
    margin-right: auto;
}

.hero .search-field { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.hero .search-field label {
    font-size: .75rem; font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.hero .search-field input {
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: .95rem;
    background: #f8fafc;
    color: #1e293b;
    transition: .2s;
}
.hero .search-field input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, .15);
}
.btn-search {
    padding: 12px 24px;
    height: 46px;
    white-space: nowrap;
    font-size: .95rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 10px;
}
.btn-search:hover { background: linear-gradient(135deg, #5568d3, #653f8f); }

/* Popular routes */
.popular-routes {
    margin-top: 25px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: center;
}
.popular-label {
    font-size: .85rem;
    font-weight: 700;
    opacity: .95;
    margin-right: 4px;
}
.route-chip {
    background: rgba(255,255,255,.2);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: .82rem;
    text-decoration: none;
    transition: .2s;
    border: 1px solid rgba(255,255,255,.3);
    backdrop-filter: blur(4px);
}
.route-chip:hover { background: white; color: #667eea; transform: translateY(-1px); }

/* ============================================================
   FEATURES STRIP
   ============================================================ */
.features-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 1px;
}

.feature-item {
    background: white;
    padding: 18px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,.05);
    border-left: 4px solid #667eea;
    transition: .2s;
}
.feature-item:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(102,126,234,.15); }

.feature-icon {
    font-size: 1.8rem;
    background: #f0f4ff;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.feature-title { font-weight: 700; color: #1e293b; font-size: .95rem; }
.feature-desc { font-size: .8rem; color: #64748b; margin-top: 2px; }

/* ============================================================
   DEPARTURES SECTION
   ============================================================ */
.departures-section {
    margin-bottom: 40px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
    flex-wrap: wrap;
    gap: 10px;
}

.section-header .section-title {
    margin: 0;
    font-size: 1.4rem;
    color: #1e293b;
}

.scroll-hint {
    font-size: .8rem;
    color: #64748b;
    background: #f1f5f9;
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: 600;
}

/* Scrollable container */
.departures-scroll {
    max-height: 620px;
    overflow-y: auto;
    padding-right: 8px;
    scroll-behavior: smooth;
}

/* Custom scrollbar */
.departures-scroll::-webkit-scrollbar { width: 8px; }
.departures-scroll::-webkit-scrollbar-track { background: #f1f5f9; border-radius: 10px; }
.departures-scroll::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 10px;
}
.departures-scroll::-webkit-scrollbar-thumb:hover { background: #5568d3; }

/* ============================================================
   DEPARTURE CARD
   ============================================================ */
.departure-card {
    background: white;
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 14px;
    display: flex;
    gap: 20px;
    align-items: stretch;
    box-shadow: 0 2px 10px rgba(0,0,0,.05);
    border: 1px solid #e2e8f0;
    transition: .25s;
    position: relative;
    overflow: hidden;
}

.departure-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, #667eea, #764ba2);
}

.departure-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(102,126,234,.15);
    border-color: #c7d2fe;
}

.departure-card.sold-out {
    opacity: .75;
    filter: grayscale(.3);
}
.departure-card.sold-out::before { background: #94a3b8; }

/* Main area */
.departure-main { flex: 1; min-width: 0; }

/* Header row */
.departure-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.bus-name-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.bus-name-row h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.bus-num {
    background: #f1f5f9;
    color: #64748b;
    padding: 3px 9px;
    border-radius: 6px;
    font-size: .75rem;
    font-weight: 600;
    font-family: 'Courier New', monospace;
    letter-spacing: .3px;
}

.departure-date {
    font-size: .85rem;
    color: #475569;
    font-weight: 600;
    background: #f8fafc;
    padding: 4px 10px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

/* Route display */
.departure-route {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 14px;
}

.departure-stop {
    min-width: 90px;
    text-align: left;
}

.departure-time {
    font-size: 1.1rem;
    font-weight: 800;
    color: #1e293b;
    line-height: 1.2;
}

.departure-city {
    font-size: .85rem;
    color: #64748b;
    margin-top: 2px;
    font-weight: 600;
    text-transform: capitalize;
}

.departure-connector {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 100px;
}

.connector-dots {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 4px;
}

.connector-dots .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #667eea;
    flex-shrink: 0;
}
.connector-dots .line {
    flex: 1;
    height: 2px;
    background: linear-gradient(90deg, #667eea, #c7d2fe);
    border-radius: 2px;
}
.connector-dots .bus-icon {
    font-size: 1rem;
    background: white;
    padding: 0 4px;
    border-radius: 50%;
}

.connector-label {
    font-size: .72rem;
    color: #94a3b8;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .3px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Price & availability meta */
.departure-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.price-tag {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    font-size: .85rem;
}

.price-label { color: #64748b; font-weight: 600; }

.price-value {
    color: #1e293b;
    font-weight: 800;
    font-size: 1rem;
}

.avail-count {
    font-size: .75rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 20px;
    background: #dcfce7;
    color: #166534;
}
.avail-count.sold {
    background: #fee2e2;
    color: #991b1b;
}

/* Action column */
.departure-action {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 10px;
    min-width: 130px;
    border-left: 1px dashed #e2e8f0;
    padding-left: 20px;
}

.seats-left {
    text-align: center;
    line-height: 1.1;
}

.seats-num {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    color: #16a34a;
}

.seats-lbl {
    display: block;
    font-size: .72rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .5px;
    font-weight: 700;
}

.btn-book {
    padding: 10px 18px;
    font-size: .9rem;
    white-space: nowrap;
    width: 100%;
    text-align: center;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 10px;
}
.btn-book:hover { background: linear-gradient(135deg, #5568d3, #653f8f); }

.soldout-badge {
    background: #fee2e2;
    color: #991b1b;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: .8rem;
    font-weight: 800;
    letter-spacing: .5px;
    border: 1px solid #fecaca;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
    .hero .search-widget {
        grid-template-columns: 1fr 1fr;
    }
    .btn-search { grid-column: 1 / -1; }
}

@media (max-width: 700px) {
    .hero { padding: 40px 20px; }
    .hero h1 { font-size: 1.6rem; }
    .hero .search-widget { grid-template-columns: 1fr; }
    .departure-card { flex-direction: column; }
    .departure-action {
        border-left: none;
        border-top: 1px dashed #e2e8f0;
        padding-left: 0;
        padding-top: 14px;
        flex-direction: row;
        justify-content: space-between;
        min-width: 0;
    }
    .departure-route { flex-wrap: wrap; }
    .departure-connector { min-width: 60px; }
    .feature-item { padding: 14px; }
    .feature-icon { width: 40px; height: 40px; font-size: 1.4rem; }
}

/* ============================================================
   DOWNLOAD TICKET BUTTON
   ============================================================ */
.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 600;
    font-size: .9rem;
    text-decoration: none;
    transition: .2s;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(16, 185, 129, .25);
}

.btn-download:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, .35);
    color: white;
}

.btn-download:active { transform: translateY(0); }

.btn-small.btn-download {
    padding: 6px 10px;
    font-size: .85rem;
}

/* ============================================================
   TICKET ACTION BUTTONS (View + Download)
   ============================================================ */
.ticket-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-view {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f1f5f9;
    color: #334155;
    padding: 9px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: .88rem;
    text-decoration: none;
    transition: .2s;
    border: 1px solid #cbd5e1;
}

.btn-view:hover {
    background: #e2e8f0;
    color: #1e293b;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0,0,0,.06);
}

.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 9px 18px;
    border-radius: 8px;
    font-weight: 600;
    font-size: .88rem;
    text-decoration: none;
    transition: .2s;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(16, 185, 129, .25);
}

.btn-download:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, .35);
    color: white;
}

.btn-download:active,
.btn-view:active {
    transform: translateY(0);
}

/* Mobile — stack buttons */
@media (max-width: 640px) {
    .ticket-actions {
        flex-direction: column;
        width: 100%;
    }
    .ticket-actions .btn-view,
    .ticket-actions .btn-download {
        justify-content: center;
        width: 100%;
    }
    .booking-actions {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ============================================================
   BOOKING PAGE — TWO-COLUMN LAYOUT
   Left: seats + passenger details
   Right: sticky booking summary
   ============================================================ */

.booking-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 24px;
    align-items: start;
    margin-top: 20px;
}

.booking-left {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;   /* prevents overflow in grid */
}

/* ---- Sticky right column ---- */
.booking-right {
    position: sticky;
    top: 20px;
    align-self: start;
    max-height: calc(100vh - 40px);
}

/* ---- Booking Summary card ---- */
.booking-summary {
    background: white;
    padding: 22px;
    border-radius: 14px;
    box-shadow: 0 4px 16px rgba(0,0,0,.08);
    border: 1px solid #e2e8f0;
    position: static;              /* override old sticky bottom */
}

.booking-summary h3 {
    font-size: 1.1rem;
    color: #1e293b;
    margin: 0 0 14px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f1f5f9;
    display: flex;
    align-items: center;
    gap: 8px;
}

.booking-summary h3::before {
    content: '🎫';
    font-size: 1.2rem;
}

/* Journey summary block */
.journey-summary {
    background: #f8fafc;
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 14px;
    font-size: .9rem;
    color: #334155;
    line-height: 1.5;
    border-left: 3px solid #3b82f6;
}

.journey-summary strong {
    color: #1e293b;
    font-size: .95rem;
}

.journey-summary small {
    color: #64748b;
    font-size: .8rem;
}

/* Selected seats list */
#selectedSeatsList {
    margin: 12px 0;
    max-height: 240px;
    overflow-y: auto;
}

#selectedSeatsList .no-seats {
    color: #94a3b8;
    font-size: .85rem;
    font-style: italic;
    text-align: center;
    padding: 18px 10px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px dashed #cbd5e1;
    margin: 0;
}

#selectedSeatsList ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

#selectedSeatsList li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 6px;
    font-size: .85rem;
    border-left: 3px solid #22c55e;
}

#selectedSeatsList li .seat-label {
    color: #475569;
    font-weight: 500;
}

#selectedSeatsList li .seat-price {
    color: #16a34a;
    font-weight: 700;
}

/* Total row */
.booking-summary .total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 14px 0;
    margin: 12px 0;
    border-top: 2px dashed #e2e8f0;
    border-bottom: 2px dashed #e2e8f0;
    font-size: .95rem;
    font-weight: 600;
    color: #475569;
}

.booking-summary .total span:last-child {
    font-size: 1.5rem;
    font-weight: 800;
    color: #16a34a;
}

/* Proceed button */
.booking-summary .btn-large {
    width: 100%;
    text-align: center;
    padding: 14px;
    font-size: 1rem;
    border-radius: 10px;
}

.booking-summary .btn-large:disabled {
    background: #cbd5e1;
    color: #94a3b8;
    cursor: not-allowed;
    box-shadow: none;
}

.booking-summary .btn-large:not(:disabled):hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(59,130,246,.3);
}

.summary-hint {
    text-align: center;
    font-size: .78rem;
    color: #94a3b8;
    margin: 10px 0 0;
}

/* ============================================================
   RESPONSIVE — Mobile: summary bottom sticky
   ============================================================ */
@media (max-width: 900px) {
    .booking-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .booking-right {
        position: sticky;
        bottom: 0;
        top: auto;
        z-index: 100;
        max-height: none;
    }

    .booking-summary {
        border-radius: 14px 14px 0 0;
        box-shadow: 0 -4px 20px rgba(0,0,0,.12);
        max-height: 55vh;
        overflow-y: auto;
    }

    .booking-summary .journey-summary {
        display: none;      /* mobile में space बचाएँ */
    }

    #selectedSeatsList {
        max-height: 120px;
    }

    .booking-summary .total {
        padding: 10px 0;
        margin: 8px 0;
    }

    .booking-summary .total span:last-child {
        font-size: 1.3rem;
    }
}

/* ============================================================
   BOOKING CLOSED STATE
   ============================================================ */

/* Dim + grayscale the card */
.bus-card-search.booking-closed {
    opacity: 0.75;
    filter: grayscale(0.35);
    border-left-color: #94a3b8 !important;
    background: #f8fafc;
}

/* Prevent clickable areas inside, EXCEPT the action button (disabled anyway) */
.bus-card-search.booking-closed .bus-info {
    pointer-events: none;
    user-select: none;
}

/* Small "Closed" badge next to bus name */
.badge-closed {
    background: #fee2e2;
    color: #991b1b;
    font-size: .72rem;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: .5px;
    border: 1px solid #fecaca;
}

/* Big closed badge in the action area */
.booking-closed-badge {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: .85rem;
    font-weight: 700;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 3px;
    align-items: center;
    min-width: 150px;
}

.booking-closed-badge small {
    font-weight: 500;
    font-size: .72rem;
    color: #b91c1c;
    opacity: .85;
}

/* Disabled button look */
.bus-card-search.booking-closed .btn-large:disabled {
    background: #e2e8f0;
    color: #94a3b8;
    cursor: not-allowed;
    box-shadow: none;
}

/* Countdown warning (when within 2 hours) */
.booking-countdown {
    display: inline-block;
    margin-top: 10px;
    padding: 5px 12px;
    background: #fef3c7;
    color: #92400e;
    border-radius: 20px;
    font-size: .78rem;
    font-weight: 600;
    border: 1px solid #fde68a;
    animation: pulse-countdown 2s ease-in-out infinite;
}

.booking-countdown strong {
    color: #78350f;
    font-weight: 800;
}

@keyframes pulse-countdown {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.75; }
}

/* Mobile — keep closed badge readable */
@media (max-width: 640px) {
    .booking-closed-badge {
        min-width: 0;
        width: 100%;
    }
}

/* ============================================================
   TRUST / STATS BAR (homepage)
   ============================================================ */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin: -34px 0 0px;
    position: relative;
    z-index: 2;
}

.stat-pill {
    background: white;
    border-radius: 14px;
    padding: 18px 12px;
    text-align: center;
    box-shadow: 0 8px 24px rgba(30,41,59,.08);
    border: 1px solid #eef1f8;
    transition: transform .2s, box-shadow .2s;
}
.stat-pill:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(102,126,234,.15); }

.stat-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.2;
}

.stat-label {
    display: block;
    font-size: .75rem;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .3px;
    margin-top: 4px;
}

/* ============================================================
   TESTIMONIALS (homepage)
   ============================================================ */
.testimonials-section { margin-bottom: 40px; }
.testimonials-section .section-title { margin-bottom: 24px; }

.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

.testimonial-card {
    background: white;
    border-radius: 14px;
    padding: 22px;
    box-shadow: 0 2px 10px rgba(0,0,0,.05);
    border: 1px solid #eef1f8;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: transform .2s, box-shadow .2s;
}
.testimonial-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(102,126,234,.12); }

.testimonial-stars { color: #f59e0b; font-size: 1rem; letter-spacing: 2px; }

.testimonial-text {
    color: #475569;
    font-size: .92rem;
    line-height: 1.6;
    flex: 1;
}

.testimonial-author { display: flex; align-items: center; gap: 10px; }

.author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .85rem;
    flex-shrink: 0;
}

.author-name { font-weight: 700; color: #1e293b; font-size: .88rem; }
.author-route { font-size: .78rem; color: #94a3b8; }

/* ============================================================
   APP CTA BANNER (homepage)
   ============================================================ */
.app-cta {
    background: linear-gradient(135deg, #1e293b, #334155);
    color: white;
    border-radius: 16px;
    padding: 36px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 40px;
    flex-wrap: wrap;
    position: relative;
    overflow: hidden;
}
.app-cta::before {
    content: '';
    position: absolute;
    right: -60px;
    top: -60px;
    width: 220px;
    height: 220px;
    background: radial-gradient(circle, rgba(102,126,234,.35) 0%, transparent 70%);
    border-radius: 50%;
}
.app-cta-text { position: relative; z-index: 1; max-width: 520px; }
.app-cta-text h2 { font-size: 1.5rem; margin-bottom: 6px; font-weight: 800; }
.app-cta-text p { color: #cbd5e1; font-size: .92rem; }
.app-cta-btn {
    position: relative;
    z-index: 1;
    background: linear-gradient(135deg, #667eea, #764ba2);
    white-space: nowrap;
}
.app-cta-btn:hover { background: linear-gradient(135deg, #5568d3, #653f8f); }

/* ============================================================
   HOMEPAGE — EXTRA RESPONSIVE REFINEMENT
   ============================================================ */
@media (max-width: 900px) {
    .stats-bar { grid-template-columns: repeat(2, 1fr); margin-top: -20px; }
    .testimonials-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
    .app-cta { padding: 28px; }
}

@media (max-width: 700px) {
    .stats-bar { margin: 16px 0 30px; }
    .app-cta { flex-direction: column; align-items: stretch; text-align: center; }
    .app-cta-text { max-width: none; }
    .app-cta-btn { text-align: center; }
}

@media (max-width: 480px) {
    .hero { padding: 32px 16px; border-radius: 8px; }
    .hero h1 { font-size: 1.35rem; }
    .hero-subtitle { font-size: .9rem; }
    .stats-bar { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .stat-pill { padding: 14px 8px; }
    .stat-number { font-size: 1.2rem; }
    .stat-label { font-size: .68rem; }
    .features-strip { grid-template-columns: 1fr; }
    .section-header .section-title { font-size: 1.2rem; }
    .departure-card { padding: 14px; }
    .bus-name-row h3 { font-size: 1rem; }
    .departure-stop { min-width: 70px; }
    .departure-time { font-size: .95rem; }
    .price-tag { padding: 6px 10px; font-size: .78rem; }
    .testimonial-card { padding: 16px; }
    .app-cta-text h2 { font-size: 1.2rem; }
    .container { padding: 0 1px; }
}

/* ============================================================
   NAVBAR — small phone refinement
   ============================================================ */
@media (max-width: 400px) {
    .logo { font-size: 1.15rem; }
    .logo-icon { width: 28px; height: 28px; font-size: .95rem; }
}

/* ============================================================
   SEARCH FIELD — mobile: label + input in one line
   (home hero widget + search.php inline widget)
   ============================================================ */
@media (max-width: 700px) {
    .search-field,
    .hero .search-field {
        flex-direction: row;
        align-items: center;
        gap: 10px;
        text-align: left;
    }

    .search-field label,
    .hero .search-field label {
        flex: 0 0 84px;
        margin-bottom: 0;
        line-height: 1.2;
    }

    .search-field input,
    .hero .search-field input {
        flex: 1;
        min-width: 0;
       
    }
}

@media (max-width: 380px) {
    .search-field label,
    .hero .search-field label {
        flex: 0 0 68px;
        font-size: .68rem;
    }
}


/* ============================================================
   AUTH PAGES — LOGIN / REGISTER / FORGOT / RESET
   ============================================================ */

.auth-wrapper {
    min-height: calc(100vh - 140px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
}

.auth-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-width: 950px;
    width: 100%;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,.15);
}

/* ---------- Left: branding panel ---------- */
.auth-brand {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 50px 40px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.auth-brand::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -30%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255,255,255,.15) 0%, transparent 70%);
    border-radius: 50%;
}

.auth-brand::after {
    content: '';
    position: absolute;
    bottom: -20%;
    left: -20%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255,255,255,.08) 0%, transparent 70%);
    border-radius: 50%;
}

.auth-brand-content {
    position: relative;
    z-index: 1;
    width: 100%;
}

.auth-logo {
    font-size: 3.5rem;
    margin-bottom: 20px;
    display: inline-block;
    background: rgba(255,255,255,.15);
    width: 80px;
    height: 80px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,.2);
}

.auth-brand h2 {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 12px;
    letter-spacing: -.5px;
}

.auth-brand > .auth-brand-content > p {
    font-size: 1rem;
    opacity: .9;
    margin-bottom: 30px;
    line-height: 1.5;
}

.auth-features {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-features li {
    font-size: .95rem;
    opacity: .95;
    padding: 10px 14px;
    background: rgba(255,255,255,.12);
    border-radius: 10px;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,.1);
}

/* ---------- Right: form panel ---------- */
.auth-form-side {
    padding: 50px 45px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-form-side h2 {
    font-size: 1.8rem;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 6px;
    letter-spacing: -.5px;
}

.auth-subtitle {
    color: #64748b;
    font-size: .95rem;
    margin-bottom: 28px;
}

.auth-form-inner {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Form groups within auth */
.auth-form-side .form-group {
    margin-bottom: 16px;
}

.auth-form-side .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #334155;
    font-size: .9rem;
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon .input-icon {
    position: absolute;
    left: 14px;
    font-size: 1.05rem;
    pointer-events: none;
    z-index: 1;
    opacity: .7;
}

.input-with-icon input {
    width: 100%;
    padding: 13px 44px 13px 44px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: .95rem;
    background: #f8fafc;
    color: #1e293b;
    transition: .2s;
    font-family: inherit;
}

.input-with-icon input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 4px rgba(102,126,234,.12);
}

.toggle-password {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: 6px 10px;
    border-radius: 6px;
    opacity: .6;
    transition: .2s;
    z-index: 1;
}

.toggle-password:hover {
    opacity: 1;
    background: #f1f5f9;
}

/* Row with checkbox + forgot link */
.auth-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
    flex-wrap: wrap;
    gap: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .88rem;
    color: #475569;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    accent-color: #667eea;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.forgot-link {
    color: #667eea;
    font-size: .88rem;
    font-weight: 600;
    text-decoration: none;
    transition: .2s;
}

.forgot-link:hover {
    color: #4c51bf;
    text-decoration: underline;
}

/* Auth button */
.btn-auth {
    background: linear-gradient(135deg, #667eea, #764ba2);
    padding: 14px;
    font-size: 1rem;
    border-radius: 12px;
    color: white;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: .2s;
    box-shadow: 0 6px 20px rgba(102,126,234,.3);
    margin-top: 6px;
}

.btn-auth:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102,126,234,.4);
    background: linear-gradient(135deg, #5568d3, #653f8f);
}

.btn-auth:active {
    transform: translateY(0);
}

/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 24px 0 18px;
    color: #94a3b8;
    font-size: .82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

/* Outline button */
.btn-outline {
    display: block;
    text-align: center;
    padding: 13px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    color: #1e293b;
    font-weight: 700;
    text-decoration: none;
    font-size: .95rem;
    transition: .2s;
    background: white;
}

.btn-outline:hover {
    border-color: #667eea;
    color: #667eea;
    background: #f8faff;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .auth-card {
        grid-template-columns: 1fr;
        max-width: 480px;
    }

    .auth-brand {
        padding: 35px 30px;
        text-align: center;
    }

    .auth-brand h2 {
        font-size: 1.5rem;
    }

    .auth-brand > .auth-brand-content > p {
        font-size: .9rem;
        margin-bottom: 20px;
    }

    .auth-features {
        display: none;      /* Mobile पर features छिपाएँ */
    }

    .auth-logo {
        margin: 0 auto 15px;
        display: flex;
    }

    .auth-form-side {
        padding: 35px 28px;
    }

    .auth-form-side h2 {
        font-size: 1.5rem;
        text-align: center;
    }

    .auth-subtitle {
        text-align: center;
    }
}

@media (max-width: 400px) {
    .auth-form-side {
        padding: 25px 20px;
    }

    .auth-row {
        flex-direction: column;
        align-items: flex-start;
    }
}