/* ???????????????????????????????????????????????????????????????????????????????
   GMT2 ONLINE BOOKING PORTAL - CUSTOM STYLES
   Modern, responsive design with M-Pesa branding
   ??????????????????????????????????????????????????????????????????????????????? */

/* ???????????????????????????????????????????????????????????????????????????????
   GLOBAL STYLES
   ??????????????????????????????????????????????????????????????????????????????? */

:root {
    --gmt2-primary: #1e3a8a;
    --gmt2-secondary: #059669;
    --mpesa-green: #00a550;
    --warning-orange: #f59e0b;
    --danger-red: #dc2626;
    --light-gray: #f3f4f6;
    --dark-gray: #374151;
}

html, body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    height: 100%;
    margin: 0;
}

.page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
    padding: 20px 0;
    background-color: var(--light-gray);
}

/* ???????????????????????????????????????????????????????????????????????????????
   NAVBAR STYLES
   ??????????????????????????????????????????????????????????????????????????????? */

.navbar {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: bold;
}

.navbar-brand i {
    margin-right: 10px;
}

.nav-link {
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-link:hover {
    transform: translateY(-2px);
}

/* ???????????????????????????????????????????????????????????????????????????????
   CARD STYLES
   ??????????????????????????????????????????????????????????????????????????????? */

.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

.card:hover {
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12);
    transform: translateY(-5px);
}

.card-header {
    background: linear-gradient(135deg, var(--gmt2-primary) 0%, #3b82f6 100%);
    color: white;
    border-radius: 12px 12px 0 0 !important;
    font-weight: 600;
    padding: 15px 20px;
}

.card-body {
    padding: 25px;
}

/* ???????????????????????????????????????????????????????????????????????????????
   BUTTON STYLES
   ??????????????????????????????????????????????????????????????????????????????? */

.btn {
    border-radius: 8px;
    padding: 12px 24px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-primary {
    background: linear-gradient(135deg, var(--gmt2-primary) 0%, #3b82f6 100%);
}

.btn-success {
    background: linear-gradient(135deg, var(--mpesa-green) 0%, #10b981 100%);
}

.btn-lg {
    padding: 15px 40px;
    font-size: 1.1rem;
}

.btn i {
    margin-right: 8px;
}

/* ???????????????????????????????????????????????????????????????????????????????
   FORM STYLES
   ??????????????????????????????????????????????????????????????????????????????? */

.form-control {
    border-radius: 8px;
    border: 2px solid #e5e7eb;
    padding: 12px 16px;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--gmt2-primary);
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

.form-group label {
    font-weight: 600;
    color: var(--dark-gray);
    margin-bottom: 8px;
}

/* ???????????????????????????????????????????????????????????????????????????????
   SEAT MAP STYLES
   ??????????????????????????????????????????????????????????????????????????????? */

/* ERP-style 3-column matatu seat layout */

.seat-panel {
    background: #fff;
    border-radius: 8px;
    padding: 16px;
    max-width: 240px;
    margin: 20px auto;
    border: 1px solid #e2e8f0;
}

.seat-front-label {
    text-align: center;
    font-weight: 700;
    font-size: 0.75rem;
    color: #64748b;
    padding: 8px 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

/* Bus layout: 5 columns (2 + aisle + 2) */
.seat-grid.bus-layout {
    grid-template-columns: repeat(5, 1fr);
    max-width: 320px;
}

/* Flat 3-column grid - matches ERP exactly */
.seat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    justify-content: center;
    max-width: 200px;
    margin: 0 auto;
}

.seat {
    height: 52px;
    width: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    border: 2px solid #cbd5e1;
    background: #f0fdf4;
    color: #15803d;
    transition: transform 0.1s;
}

.seat:hover:not(.booked):not(.driver) {
    transform: scale(1.05);
}

.spacer {
    height: 52px;
    width: 52px;
    visibility: hidden;
}

.seat.available {
    background: #f0fdf4;
    color: #15803d;
    border-color: #22c55e;
}

.seat.selected {
    background: #fdba74;
    color: #7c2d12;
    border-color: #ea580c;
    transform: scale(1.05);
}

.seat.booked {
    background: #fecaca;
    color: #7f1d1d;
    border-color: #dc2626;
    cursor: not-allowed;
}

.seat.booked-online {
    background: #fef3c7;
    color: #92400e;
    border-color: #fcd34d;
    cursor: not-allowed;
}

.seat.driver {
    background: #1e40af;
    border-color: #1e3a8a;
    color: white;
    cursor: default;
    font-size: 10px;
    font-weight: 600;
}

/* Seat legend */
.seat-legend {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
}

.seat-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
    color: #374151;
    font-weight: 500;
}

.seat-legend-box {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    display: inline-block;
    border: 2px solid transparent;
}

.available-legend {
    background: #f0fdf4;
    border-color: #22c55e;
}

.booked-legend {
    background: #fecaca;
    border-color: #dc2626;
}

.selected-legend {
    background: #fdba74;
    border-color: #ea580c;
}

.online-legend {
    background: #fef3c7;
    border-color: #fcd34d;
}

/* ???????????????????????????????????????????????????????????????????????????????
   LOADING & SPINNER STYLES
   ??????????????????????????????????????????????????????????????????????????????? */

.spinner-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px 20px;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* ???????????????????????????????????????????????????????????????????????????????
   ALERT STYLES
   ??????????????????????????????????????????????????????????????????????????????? */

.alert {
    border-radius: 10px;
    border: none;
    padding: 16px 20px;
    margin-bottom: 20px;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
}

/* ???????????????????????????????????????????????????????????????????????????????
   BADGE STYLES
   ??????????????????????????????????????????????????????????????????????????????? */

.badge {
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.875rem;
}

.bg-success {
    background-color: var(--mpesa-green) !important;
}

.bg-warning {
    background-color: var(--warning-orange) !important;
}

.bg-danger {
    background-color: var(--danger-red) !important;
}

/* ???????????????????????????????????????????????????????????????????????????????
   BOOKING CONFIRMATION STYLES
   ??????????????????????????????????????????????????????????????????????????????? */

.fa-mobile-alt,
.fa-check-circle,
.fa-times-circle {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* ???????????????????????????????????????????????????????????????????????????????
   FOOTER STYLES
   ??????????????????????????????????????????????????????????????????????????????? */

.footer {
    background-color: #1f2937;
    color: #9ca3af;
    padding: 30px 0;
    margin-top: auto;
}

.footer a {
    color: #60a5fa;
    text-decoration: none;
}

.footer a:hover {
    color: #93c5fd;
}

/* ???????????????????????????????????????????????????????????????????????????????
   RESPONSIVE DESIGN
   ??????????????????????????????????????????????????????????????????????????????? */

@media (max-width: 768px) {
    .seat-map {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        padding: 15px;
    }

    .card-body {
        padding: 20px;
    }

    .btn-lg {
        padding: 12px 30px;
        font-size: 1rem;
    }

    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.5rem;
    }
}

@media (max-width: 576px) {
    .seat-map {
        grid-template-columns: repeat(2, 1fr);
    }

    .navbar-brand {
        font-size: 1.25rem;
    }

    .btn {
        width: 100%;
        margin-bottom: 10px;
    }
}

/* ???????????????????????????????????????????????????????????????????????????????
   HOME PAGE FEATURE CARDS
   ??????????????????????????????????????????????????????????????????????????????? */

.feature-card {
    transition: all 0.3s ease;
    cursor: pointer;
}

.feature-card:hover {
    transform: translateY(-10px);
}

.feature-card i {
    transition: all 0.3s ease;
}

.feature-card:hover i {
    transform: scale(1.1) rotate(5deg);
}

/* ???????????????????????????????????????????????????????????????????????????????
   PROGRESS STEPS
   ??????????????????????????????????????????????????????????????????????????????? */

.step-indicator {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    position: relative;
}

.step-indicator::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    height: 2px;
    background: #e5e7eb;
    z-index: -1;
}

.step {
    background: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    border: 2px solid #e5e7eb;
    position: relative;
}

.step.active {
    background: var(--gmt2-primary);
    color: white;
    border-color: var(--gmt2-primary);
}

.step.completed {
    background: var(--mpesa-green);
    color: white;
    border-color: var(--mpesa-green);
}

/* ???????????????????????????????????????????????????????????????????????????????
   ANIMATIONS
   ??????????????????????????????????????????????????????????????????????????????? */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease;
}

/* ???????????????????????????????????????????????????????????????????????????????
   UTILITY CLASSES
   ??????????????????????????????????????????????????????????????????????????????? */

.text-mpesa {
    color: var(--mpesa-green);
}

.bg-mpesa {
    background-color: var(--mpesa-green);
}

.shadow-lg {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.rounded-lg {
    border-radius: 12px;
}

.mt-5 {
    margin-top: 3rem;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

.p-4 {
    padding: 1.5rem;
}

/* Blazor Error UI - hidden by default, shown by blazor.server.js when circuit errors */
#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}
