/* Bus Container Styling */
.bus-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border: 3px solid #2c3e50;
    position: relative;
    overflow: hidden;
}

.bus-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #e74c3c, #c0392b);
    z-index: 1;
}

.bus-container::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #e74c3c, #c0392b);
    z-index: 1;
}

/* Driver Section */
.driver-section {
    text-align: center;
    margin-bottom: 25px;
    padding: 15px;
    background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%);
    border-radius: 10px;
    color: white;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    border: 2px solid #e74c3c;
    position: relative;
}

.driver-section::before {
    content: '🚌';
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5em;
}

/* Grid Bus Layout */
.bus-grid {
    display: grid;
    grid-template-columns: 0.2fr 1fr 1fr 1fr 1fr 1fr; /* 6 columns */
    grid-template-rows: auto;
    gap: 12px;
    padding: 25px;
    background: #ecf0f1;
    border-radius: 15px;
    border: 3px solid #bdc3c7;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.1);
    position: relative;
    min-height: 600px;
}

/* Grid Areas Definition */
.grid-row {
    display: contents;
}

/* Row Labels */
.row-label {
    grid-column: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%);
    color: white;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.2);
    border: 2px solid #e74c3c;
    font-size: 0.9em;
    margin-right: 10px;
}

/* Seat Styling */
.seat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 75px;
    border-radius: 10px 10px 5px 5px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    font-size: 0.85em;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    position: relative;
    transform: perspective(100px) rotateX(5deg);
    overflow: hidden;
    text-align: center;
    padding: 5px;
}

.seat::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255,255,255,0.3);
    border-radius: 10px 10px 0 0;
}

.seat:hover:not(.booked) {
    transform: perspective(100px) rotateX(5deg) translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

/* Seat Colors */
.seat.available {
    background: linear-gradient(135deg, #c0c0c0 0%, #95a5a6 100%);
    color: #2c3e50;
    border: 2px solid #7f8c8d;
}

.seat.available::after {
    content: '';
    position: absolute;
    top: 5px;
    right: 5px;
    width: 8px;
    height: 8px;
    background: #27ae60;
    border-radius: 50%;
    border: 1px solid white;
}

.seat.male {
    background: linear-gradient(135deg, #4d79ff 0%, #3498db 100%) !important;
    color: white;
    border: 2px solid #2980b9;
}

.seat.female {
    background: linear-gradient(135deg, #ff66b2 0%, #e84393 100%) !important;
    color: white;
    border: 2px solid #c0392b;
}

.seat.booked {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: white;
    cursor: not-allowed;
    opacity: 0.8;
    border: 2px solid #343a40;
}

.seat.booked::after {
    content: '🔒';
    position: absolute;
    top: 3px;
    right: 3px;
    font-size: 0.7em;
}

/* Selected seat */
.seat.selected {
    border: 3px solid #27ae60;
    box-shadow: 0 0 20px rgba(39, 174, 96, 0.6);
    animation: pulse 2s infinite;
    transform: perspective(100px) rotateX(5deg) scale(1.05);
}

@keyframes pulse {
    0% { 
        box-shadow: 0 0 15px rgba(39, 174, 96, 0.5);
        transform: perspective(100px) rotateX(5deg) scale(1.05);
    }
    50% { 
        box-shadow: 0 0 25px rgba(39, 174, 96, 0.8);
        transform: perspective(100px) rotateX(5deg) scale(1.08);
    }
    100% { 
        box-shadow: 0 0 15px rgba(39, 174, 96, 0.5);
        transform: perspective(100px) rotateX(5deg) scale(1.05);
    }
}

/* Special Grid Items */
.driver-area {
    grid-column: 4 / span 3;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-weight: bold;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    border: 2px solid #2c3e50;
    padding: 10px;
}

.door-area {
    grid-column: 2 / span 2;
    background: linear-gradient(135deg, #8B4513 0%, #654321 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-weight: bold;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    border: 2px solid #5D4037;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    position: relative;
    overflow: hidden;
}

.door-area::before {
    content: '';
    position: absolute;
    top: 15px;
    bottom: 15px;
    left: 15px;
    right: 15px;
    background: rgba(205, 133, 63, 0.2);
    border-radius: 5px;
    border: 2px dashed rgba(205, 133, 63, 0.5);
}

.walking-area {
    grid-column: 3;
    background: linear-gradient(135deg, #dfe6e9, #b2bec3);
    border-radius: 8px;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.1);
    border: 1px dashed #95a5a6;
    position: relative;
}

.walking-area::before {
    content: '';
    position: absolute;
    top: 10px;
    bottom: 10px;
    left: 50%;
    width: 2px;
    background: linear-gradient(to bottom, 
        transparent 0%, 
        #95a5a6 20%, 
        #95a5a6 80%, 
        transparent 100%);
    transform: translateX(-50%);
}

/* Passenger Name */
.passenger-name {
    font-size: 0.65em !important;
    margin-top: 4px !important;
    line-height: 1.1;
    text-align: center;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.3);
}

/* Legend */
.legend {
    display: flex;
    justify-content: center;
    margin-top: 30px;
    flex-wrap: wrap;
    gap: 20px;
    padding: 20px;
    background: rgba(255,255,255,0.9);
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border: 2px solid #bdc3c7;
}

.legend-item {
    display: flex;
    align-items: center;
    background: white;
    padding: 12px 20px;
    border-radius: 25px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    border: 2px solid #e9ecef;
    transition: transform 0.2s ease;
}

.legend-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
}

.legend-color {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    margin-right: 12px;
    border: 2px solid rgba(0,0,0,0.1);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Student Info */
.student-info {
    background: linear-gradient(135deg, #e7f3ff 0%, #d6eaf8 100%);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    border: 3px solid #3498db;
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.15);
    position: relative;
    overflow: hidden;
}

.student-info::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background: linear-gradient(to bottom, #3498db, #2980b9);
}

/* Fee Status */
.fee-status {
    display: flex;
    gap: 15px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.fee-month {
    text-align: center;
    background: white;
    padding: 10px 15px;
    border-radius: 10px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.1);
    border: 2px solid #e9ecef;
    min-width: 80px;
    transition: transform 0.2s ease;
}

.fee-month:hover {
    transform: translateY(-2px);
}

.fee-badge {
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 0.75em;
    display: block;
    margin-top: 8px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.badge-submitted {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
    color: white;
    box-shadow: 0 2px 5px rgba(40, 167, 69, 0.3);
}

.badge-pending {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    box-shadow: 0 2px 5px rgba(220, 53, 69, 0.3);
}

/* Booking Form */
#booking-section .card {
    border: 3px solid #27ae60;
    box-shadow: 0 8px 25px rgba(39, 174, 96, 0.2);
    border-radius: 15px;
    overflow: hidden;
}

#booking-section .card-header {
    background: linear-gradient(135deg, #27ae60 0%, #219653 100%);
    color: white;
    border-bottom: 3px solid #1e8449;
    padding: 20px;
}

#booking-section .card-body {
    padding: 30px;
    background: linear-gradient(135deg, #f8fff9 0%, #e8f5e8 100%);
}

/* Alert Styling */
.alert {
    border-radius: 12px;
    border: 2px solid transparent;
    padding: 15px 20px;
    font-weight: 500;
}

.alert-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-color: #28a745;
    color: #155724;
}

.alert-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border-color: #ffc107;
    color: #856404;
}

.alert-danger {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border-color: #dc3545;
    color: #721c24;
}

/* Responsive Design */
@media (max-width: 768px) {
    .bus-grid {
        grid-template-columns: 1fr 1fr 0.8fr 1fr 1fr;
        gap: 8px;
        padding: 15px;
    }
    
    .seat {
        height: 60px;
        font-size: 0.75em;
    }
    
    .row-label {
        width: 30px;
        height: 30px;
        font-size: 0.8em;
    }
    
    .legend {
        gap: 10px;
        padding: 15px;
    }
    
    .legend-item {
        padding: 8px 12px;
        font-size: 0.9em;
    }
}

@media (max-width: 480px) {
    .bus-grid {
        grid-template-columns: 1fr 1fr 0.5fr 1fr 1fr;
        gap: 5px;
    }
    
    .seat {
        height: 50px;
        font-size: 0.7em;
    }
    
    .row-label {
        width: 25px;
        height: 25px;
        font-size: 0.75em;
    }
    
    .legend {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }
}


/* Row 1: Driver row */
.grid-row-1 .seat:nth-child(2) { grid-column: 2 / span 1.5; }
.grid-row-1 .seat:nth-child(3) { grid-column: 3.5 / span 1.5; }

/* Rows 2-7: 4 seats + walking area */
.grid-row-2 .seat:nth-child(2) { grid-column: 2; } /* 1st left seat */
.grid-row-2 .seat:nth-child(3) { grid-column: 3; } /* 2nd left seat */
.grid-row-2 .walking-area { grid-column: 4; }      /* walking area */
.grid-row-2 .seat:nth-child(5) { grid-column: 5; } /* 1st right seat */
.grid-row-2 .seat:nth-child(6) { grid-column: 6; } /* 2nd right seat */

.grid-row-3 .seat:nth-child(2) { grid-column: 2; }
.grid-row-3 .seat:nth-child(3) { grid-column: 3; }
.grid-row-3 .seat:nth-child(4) { grid-column: 5; }
.grid-row-3 .seat:nth-child(5) { grid-column: 6; }
.grid-row-3 .walking-area { grid-column: 4; }

.grid-row-4 .seat:nth-child(2) { grid-column: 2; }
.grid-row-4 .seat:nth-child(3) { grid-column: 3; }
.grid-row-4 .walking-area { grid-column: 4; }
.grid-row-4 .seat:nth-child(5) { grid-column: 5; }
.grid-row-4 .seat:nth-child(6) { grid-column: 6; }

.grid-row-5 .seat:nth-child(2) { grid-column: 2; }
.grid-row-5 .seat:nth-child(3) { grid-column: 3; }
.grid-row-5 .walking-area { grid-column: 4; }
.grid-row-5 .seat:nth-child(5) { grid-column: 5; }
.grid-row-5 .seat:nth-child(6) { grid-column: 6; }

.grid-row-6 .seat:nth-child(2) { grid-column: 2; }
.grid-row-6 .seat:nth-child(3) { grid-column: 3; }
.grid-row-6 .walking-area { grid-column: 4; }
.grid-row-6 .seat:nth-child(5) { grid-column: 5; }
.grid-row-6 .seat:nth-child(6) { grid-column: 6; }

.grid-row-7 .seat:nth-child(2) { grid-column: 2; }
.grid-row-7 .seat:nth-child(3) { grid-column: 3; }
.grid-row-7 .walking-area { grid-column: 4; }
.grid-row-7 .seat:nth-child(5) { grid-column: 5; }
.grid-row-7 .seat:nth-child(6) { grid-column: 6; }

/* Row 8: Back row with 5 seats */
.grid-row-8 .seat:nth-child(2) { grid-column: 2; }
.grid-row-8 .seat:nth-child(3) { grid-column: 3; }
.grid-row-8 .walking-area { grid-column: 4; }
.grid-row-8 .seat:nth-child(5) { grid-column: 5; }
.grid-row-8 .seat:nth-child(6) { grid-column: 6; }


/* Row 9: Back row with 5 seats */
.grid-row-9 .seat:nth-child(2) { grid-column: 2; }
.grid-row-9 .seat:nth-child(3) { grid-column: 3; }
.grid-row-9 .seat:nth-child(4) { grid-column: 4; }
.grid-row-9 .seat:nth-child(5) { grid-column: 5; }
.grid-row-9 .seat:nth-child(6) { grid-column: 6; }



/* New fee status badges */
.badge-delay-requested {
    background-color: #ffc107;
    color: #000;
}

.badge-delay-approved {
    background-color: #20c997;
    color: #fff;
}

.badge-delay-rejected {
    background-color: #dc3545;
    color: #fff;
}

.badge-delay-under-review {
    background-color: #0dcaf0;
    color: #000;
}

.badge-delay-transport-review {
    background-color: #6f42c1;
    color: #fff;
}

/* Delay section styling */
.delay-section .month-checkbox {
    border: 2px solid transparent;
    border-radius: 5px;
    padding: 10px;
    margin-bottom: 5px;
    transition: all 0.3s;
}

.delay-section .month-checkbox.selected {
    border-color: #ffc107;
    background-color: #fff3cd;
}

/* Application status cards */
.application-status-card {
    border-left: 4px solid #6c757d;
    margin-bottom: 10px;
}

.application-status-card.approved {
    border-left-color: #20c997;
}

.application-status-card.pending {
    border-left-color: #ffc107;
}

.application-status-card.forwarded {
    border-left-color: #0d6efd;
}

.application-status-card.disapproved {
    border-left-color: #dc3545;
}
