/* ===== GLOBAL STYLES ===== */
@import url('https://fonts.googleapis.com/css2?family=Hind+Siliguri:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary: #1a1a2e;
    --secondary: #16213e;
    --accent: #0f3460;
    --gold: #e94560;
    --booked: #ef4444;
    --booked-hover: #dc2626;
    --available: #22c55e;
    --available-hover: #16a34a;
    --text-light: #f1f5f9;
    --text-muted: #94a3b8;
    --glass: rgba(255, 255, 255, 0.07);
    --glass-border: rgba(255, 255, 255, 0.12);
    --shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
    --radius: 14px;
    --radius-sm: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Hind Siliguri', 'Inter', sans-serif;
    background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    min-height: 100vh;
    color: var(--text-light);
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at 30% 20%, rgba(233, 69, 96, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 80%, rgba(15, 52, 96, 0.15) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* ===== HEADER ===== */
.site-header {
    background: linear-gradient(90deg, rgba(233, 69, 96, 0.15), rgba(15, 52, 96, 0.2));
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    padding: 15px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header .logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.site-header .logo .bus-icon {
    font-size: 32px;
    filter: drop-shadow(0 0 10px rgba(233, 69, 96, 0.5));
}

.site-header .logo h1 {
    font-size: 1.3rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff, #e94560);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.3;
}

.site-header .logo p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* ===== BUTTONS ===== */
.btn {
    padding: 9px 20px;
    border-radius: var(--radius-sm);
    border: none;
    font-family: 'Hind Siliguri', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-primary {
    background: linear-gradient(135deg, #e94560, #c41230);
    color: white;
    box-shadow: 0 4px 15px rgba(233, 69, 96, 0.35);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(233, 69, 96, 0.5);
}

.btn-success {
    background: linear-gradient(135deg, #22c55e, #15803d);
    color: white;
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.35);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(34, 197, 94, 0.5);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.35);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.5);
}

.btn-ghost {
    background: var(--glass);
    color: var(--text-light);
    border: 1px solid var(--glass-border);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.82rem;
}

/* ===== STATS BAR ===== */
.stats-bar {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 20px 30px;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.stat-card {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    border-radius: var(--radius);
    padding: 16px 28px;
    text-align: center;
    min-width: 130px;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
}

.stat-card .stat-num {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
}

.stat-card .stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.stat-card.total .stat-num {
    color: #60a5fa;
}

.stat-card.booked .stat-num {
    color: var(--booked);
}

.stat-card.available .stat-num {
    color: var(--available);
}

/* ===== MAIN CONTAINER ===== */
.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 30px 40px;
    position: relative;
    z-index: 1;
}

/* ===== BUS LAYOUT ===== */
.bus-wrapper {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 25px;
    box-shadow: var(--shadow);
}

.bus-top {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--glass-border);
}

.bus-top .driver-section {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.driver-box {
    background: linear-gradient(135deg, rgba(233, 69, 96, 0.2), rgba(233, 69, 96, 0.05));
    border: 2px solid rgba(233, 69, 96, 0.4);
    border-radius: var(--radius-sm);
    padding: 10px 18px;
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #fca5a5;
}

.bus-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-muted);
    text-align: center;
}

/* ===== SEAT GRID ===== */
.seat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 60px 1fr 1fr;
    gap: 10px;
    align-items: start;
}

.seat-aisle {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.aisle-label {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    color: var(--text-muted);
    font-size: 0.7rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    opacity: 0.5;
    margin: auto;
}

.seat-column {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ===== SEAT BUTTON ===== */
.seat-btn {
    width: 100%;
    min-height: 62px;
    height: 78px;
    border-radius: 10px;
    border: 2px solid transparent;
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    box-sizing: border-box;
}

.seat-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), transparent);
    pointer-events: none;
}

.seat-btn .seat-num {
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.seat-btn .seat-name {
    font-size: 0.6rem;
    font-weight: 400;
    opacity: 0.9;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 4px;
}

.seat-btn .seat-phone {
    font-size: 0.58rem;
    font-weight: 500;
    opacity: 0.85;
    max-width: 85px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 4px;
    letter-spacing: 0.3px;
    color: rgba(255, 255, 255, 0.9);
}

/* Available seat */
.seat-btn.available {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
    border-color: rgba(34, 197, 94, 0.3);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.seat-btn.available:hover {
    transform: scale(1.08) translateY(-3px);
    box-shadow: 0 10px 25px rgba(34, 197, 94, 0.5);
    border-color: rgba(34, 197, 94, 0.6);
}

/* Booked seat */
.seat-btn.booked {
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    color: white;
    border-color: rgba(239, 68, 68, 0.3);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
    cursor: pointer;
}

.seat-btn.booked:hover {
    transform: scale(1.08) translateY(-3px);
    box-shadow: 0 10px 25px rgba(239, 68, 68, 0.5);
    border-color: rgba(239, 68, 68, 0.6);
}

/* ===== LEGEND ===== */
.legend {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--glass-border);
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.legend-dot {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

.legend-dot.booked {
    background: var(--booked);
}

.legend-dot.available {
    background: var(--available);
}

/* ===== MODAL ===== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
    animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal {
    background: linear-gradient(135deg, #1e1b4b, #1a1a2e);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 35px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.6);
    animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff, #e94560);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-close {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.2);
    color: var(--booked);
}

/* ===== FORMS ===== */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 7px;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 11px 14px;
    color: var(--text-light);
    font-family: 'Hind Siliguri', 'Inter', sans-serif;
    font-size: 0.95rem;
    transition: all 0.2s;
    outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: rgba(233, 69, 96, 0.5);
    background: rgba(233, 69, 96, 0.06);
    box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 22px;
}

.form-actions .btn {
    flex: 1;
    justify-content: center;
}

/* ===== SEAT INFO (booked detail in modal) ===== */
.seat-info-card {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 18px;
}

.seat-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.9rem;
}

.seat-info-row:last-child {
    border-bottom: none;
}

.seat-info-row .label {
    color: var(--text-muted);
}

.seat-info-row .value {
    font-weight: 600;
    color: #fca5a5;
}

/* ===== LOGIN PAGE ===== */
.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 70px);
    padding: 30px;
}

.login-card {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 45px 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow);
    text-align: center;
}

.login-icon {
    font-size: 50px;
    margin-bottom: 15px;
    filter: drop-shadow(0 0 15px rgba(233, 69, 96, 0.4));
}

.login-card h2 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 6px;
    background: linear-gradient(135deg, #fff, #e94560);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 30px;
}

.login-card .form-group label {
    text-align: left;
}

.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 15px;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: left;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.alert-success {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #86efac;
}

/* ===== ADMIN TOP BAR ===== */
.admin-bar {
    background: rgba(233, 69, 96, 0.1);
    border: 1px solid rgba(233, 69, 96, 0.2);
    border-radius: var(--radius-sm);
    padding: 10px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.admin-bar .admin-info {
    color: #fca5a5;
    font-weight: 600;
}

/* ===== BOOKINGS LIST ===== */
.bookings-section {
    margin-top: 30px;
}

.section-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.bookings-table-wrapper {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    overflow: hidden;
    overflow-x: auto;
}

.bookings-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.bookings-table th {
    background: rgba(233, 69, 96, 0.15);
    padding: 13px 18px;
    text-align: left;
    font-weight: 700;
    color: #fca5a5;
    font-size: 0.83rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.bookings-table td {
    padding: 12px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-light);
    vertical-align: middle;
}

.bookings-table tr:last-child td {
    border-bottom: none;
}

.bookings-table tr:hover td {
    background: rgba(255, 255, 255, 0.03);
}

.seat-badge {
    background: rgba(233, 69, 96, 0.15);
    border: 1px solid rgba(233, 69, 96, 0.3);
    color: #fca5a5;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.85rem;
    display: inline-block;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .site-header {
        padding: 12px 15px;
    }

    .site-header .logo h1 {
        font-size: 1rem;
    }

    .main-container {
        padding: 12px;
    }

    .stats-bar {
        padding: 12px;
        gap: 8px;
    }

    .stat-card {
        padding: 10px 14px;
        min-width: 90px;
    }

    .stat-card .stat-num {
        font-size: 1.6rem;
    }

    .seat-grid {
        grid-template-columns: 1fr 1fr 24px 1fr 1fr;
        gap: 6px;
    }

    .seat-btn {
        min-height: 54px;
        height: 68px;
        font-size: 0.72rem;
    }

    .seat-btn .seat-num {
        font-size: 0.75rem;
    }

    .seat-btn .seat-name {
        font-size: 0.52rem;
    }

    .seat-btn .seat-phone {
        font-size: 0.5rem;
    }

    .modal {
        padding: 22px 18px;
    }

    .login-card {
        padding: 28px 18px;
    }

    .bus-wrapper {
        padding: 12px;
    }

    .admin-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .bookings-table th,
    .bookings-table td {
        padding: 10px 12px;
        font-size: 0.82rem;
    }
}

@media (max-width: 400px) {
    .seat-grid {
        grid-template-columns: 1fr 1fr 16px 1fr 1fr;
        gap: 4px;
    }

    .seat-btn {
        min-height: 42px;
        height: 50px;
        border-radius: 7px;
    }

    .seat-btn .seat-num {
        font-size: 0.68rem;
    }

    .seat-btn .seat-name {
        display: none;
    }

    .aisle-label {
        display: none;
    }

    .bus-wrapper {
        padding: 8px;
    }

    .stats-bar {
        gap: 6px;
    }

    .stat-card {
        padding: 8px 12px;
        min-width: 80px;
    }
}

/* ===== TOAST ===== */
.toast-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-sm);
    padding: 14px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    min-width: 250px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: toastIn 0.35s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(60px);
    }
}

.toast.success {
    border-left: 4px solid var(--available);
}

.toast.error {
    border-left: 4px solid var(--booked);
}

/* ===== PAYMENT SUMMARY ===== */
.payment-summary {
    display: flex;
    gap: 16px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.pay-sum-card {
    flex: 1;
    min-width: 160px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    backdrop-filter: blur(10px);
    transition: transform 0.2s ease;
}

.pay-sum-card:hover {
    transform: translateY(-3px);
}

.pay-sum-card.total-due {
    border-color: rgba(96, 165, 250, 0.3);
    background: rgba(96, 165, 250, 0.06);
}

.pay-sum-card.total-paid {
    border-color: rgba(74, 222, 128, 0.3);
    background: rgba(74, 222, 128, 0.06);
}

.pay-sum-card.total-baki {
    border-color: rgba(251, 191, 36, 0.3);
    background: rgba(251, 191, 36, 0.06);
}

.pay-sum-icon {
    font-size: 2rem;
    line-height: 1;
}

.pay-sum-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 4px;
}

.pay-sum-amount {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1;
}

.pay-sum-card.total-due .pay-sum-amount {
    color: #60a5fa;
}

.pay-sum-card.total-paid .pay-sum-amount {
    color: #4ade80;
}

.pay-sum-card.total-baki .pay-sum-amount {
    color: #fbbf24;
}

.pay-sum-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 3px;
}

@media (max-width: 600px) {
    .payment-summary {
        gap: 10px;
    }

    .pay-sum-card {
        padding: 12px 14px;
        min-width: 120px;
    }

    .pay-sum-amount {
        font-size: 1.2rem;
    }
}

/* Print styles */
@media print {
    body {
        background: white;
        color: black;
    }

    .site-header,
    .admin-bar,
    .btn {
        display: none !important;
    }

    .seat-btn.booked {
        background: #ef4444 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .seat-btn.available {
        background: #22c55e !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}