* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --success-color: #48bb78;
    --warning-color: #ed8936;
    --danger-color: #f56565;
    --text-primary: #2d3748;
    --text-secondary: #4a5568;
    --bg-light: #f7fafc;
    --border-color: #e2e8f0;
    --shadow: 0 10px 30px rgba(0,0,0,0.1);
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 15px;
}

/* Navbar Styles */
.navbar {
    background: white;
    padding: 1rem 2rem;
    border-radius: 15px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    position: relative;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.logo i {
    font-size: 2rem;
}

.nav-links {
    display: flex;
    gap: 10px;
    align-items: center;
}

.hamburger {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-primary);
}

.user-email {
    color: var(--text-secondary);
    font-size: 0.9rem;
    padding: 5px 10px;
    background: var(--bg-light);
    border-radius: 20px;
}

/* Button Styles */
.btn-login, .btn-signup, .btn-logout, .btn-primary, .btn-warning, .btn-danger {
    padding: 8px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem;
}

.btn-login {
    background: var(--primary-color);
    color: white;
}

.btn-login:hover {
    background: #5a67d8;
    transform: translateY(-2px);
}

.btn-signup {
    background: var(--success-color);
    color: white;
}

.btn-signup:hover {
    background: #38a169;
    transform: translateY(-2px);
}

.btn-logout {
    background: var(--danger-color);
    color: white;
}

.btn-logout:hover {
    background: #e53e3e;
    transform: translateY(-2px);
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    padding: 12px 25px;
    width: 100%;
    justify-content: center;
}

.btn-primary:hover {
    background: #5a67d8;
    transform: translateY(-2px);
}

.btn-warning {
    background: var(--warning-color);
    color: white;
    padding: 12px 25px;
    width: 100%;
    justify-content: center;
    margin-bottom: 10px;
}

.btn-warning:hover {
    background: #dd6b20;
    transform: translateY(-2px);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
    padding: 12px 25px;
    width: 100%;
    justify-content: center;
}

.btn-danger:hover {
    background: #e53e3e;
    transform: translateY(-2px);
}

.btn-book, .btn-cancel {
    background: var(--success-color);
    color: white;
    padding: 14px 30px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.btn-book:hover, .btn-cancel:hover {
    background: #38a169;
    transform: translateY(-2px);
}

/* Bus Info Card */
.bus-info-card {
    background: white;
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

.bus-info-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.bus-info-header i {
    font-size: 2rem;
    color: var(--primary-color);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: var(--bg-light);
    border-radius: 10px;
    transition: transform 0.3s ease;
}

.info-item:hover {
    transform: translateY(-5px);
}

.info-item i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.info-details {
    display: flex;
    flex-direction: column;
}

.info-details label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Bus Layout Card */
.bus-layout-card {
    background: white;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

.bus-layout-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
}

.legend {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.legend-color {
    width: 25px;
    height: 25px;
    border-radius: 5px;
}

.legend-color.available {
    background: #fc8181;
    border: 2px solid #c53030;
}

.legend-color.booked {
    background: #9ae6b4;
    border: 2px solid #276749;
}

.legend-color.selected {
    background: #fbd38d;
    border: 2px solid #b7791f;
}

.bus-front {
    background: var(--bg-light);
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    margin-bottom: 20px;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.bus-front i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.seats-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    padding: 20px;
    background: var(--bg-light);
    border-radius: 15px;
    margin-bottom: 20px;
}

.seat {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: white;
    border: 2px solid;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 10px;
    font-size: 0.9rem;
    position: relative;
    min-height: 80px;
}

.seat.available {
    background: #fc8181;
    border-color: #c53030;
}

.seat.booked {
    background: #9ae6b4;
    border-color: #276749;
}

.seat:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    z-index: 1;
}

.seat-number {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.passenger-name {
    font-size: 0.7rem;
    text-align: center;
    word-break: break-word;
    max-width: 100%;
    background: rgba(255,255,255,0.3);
    padding: 2px 4px;
    border-radius: 3px;
}

.bus-exit {
    text-align: center;
    padding: 10px;
    background: var(--bg-light);
    border-radius: 10px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* Cancel Booking Card */
.cancel-booking-card {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: var(--shadow);
}

.cancel-booking-card h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.cancel-form {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 15px;
}

.input-group {
    display: flex;
    align-items: center;
    background: var(--bg-light);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 0 12px;
}

.input-group i {
    color: var(--text-secondary);
    font-size: 1rem;
}

.input-group input {
    width: 100%;
    padding: 12px;
    border: none;
    background: transparent;
    font-size: 0.95rem;
    outline: none;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
    overflow-y: auto;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 20px 30px;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    color: var(--text-primary);
    font-size: 1.5rem;
}

.close, .close-auth {
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.close:hover, .close-auth:hover {
    color: var(--danger-color);
}

/* Form Styles */
.form-group {
    padding: 15px 30px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 5px;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

#authSwitch {
    text-align: center;
    padding: 20px 30px;
    border-top: 2px solid var(--border-color);
    color: var(--text-secondary);
}

#authSwitch span {
    color: var(--primary-color);
    cursor: pointer;
    font-weight: 600;
    text-decoration: underline;
}

/* Admin Panel Styles */
.admin-container {
    background: linear-gradient(135deg, #f6f9fc 0%, #e6f0f7 100%);
}

.admin-panel {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: var(--shadow);
}

.admin-panel h1 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 30px;
    color: var(--text-primary);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    padding: 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 20px;
    color: white;
}

.stat-card i {
    font-size: 2.5rem;
    opacity: 0.9;
}

.stat-info h3 {
    font-size: 0.9rem;
    font-weight: 400;
    opacity: 0.9;
    margin-bottom: 5px;
}

.stat-info p {
    font-size: 2rem;
    font-weight: 700;
}

.admin-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin: 30px 0;
}

.control-section {
    padding: 25px;
    background: var(--bg-light);
    border-radius: 12px;
}

.control-section h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.control-section h3 i {
    color: var(--primary-color);
}

.control-section .form-group {
    padding: 0;
    margin-bottom: 15px;
}

/* Bus Preview */
.bus-preview {
    margin: 30px 0;
    padding: 20px;
    background: var(--bg-light);
    border-radius: 12px;
}

.bus-preview h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.admin-seats-container {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 8px;
}

.admin-seat {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 2px solid;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
}

.admin-seat.available {
    background: #fc8181;
    border-color: #c53030;
    color: white;
}

.admin-seat.booked {
    background: #9ae6b4;
    border-color: #276749;
}

/* Bookings Table */
.bookings-list {
    margin-top: 30px;
}

.bookings-list h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.table-responsive {
    overflow-x: auto;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    min-width: 600px;
}

th {
    background: var(--primary-color);
    color: white;
    padding: 15px;
    text-align: left;
    font-weight: 500;
}

td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
}

tr:hover {
    background: var(--bg-light);
}

.btn-small {
    padding: 5px 10px;
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.btn-small:hover {
    background: #e53e3e;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: white;
    color: var(--text-primary);
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    display: none;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s ease;
    z-index: 2000;
}

.toast.show {
    display: flex;
}

.toast.success {
    border-left: 4px solid var(--success-color);
}

.toast.error {
    border-left: 4px solid var(--danger-color);
}

.toast.warning {
    border-left: 4px solid var(--warning-color);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media screen and (max-width: 1024px) {
    .seats-container {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .admin-seats-container {
        grid-template-columns: repeat(6, 1fr);
    }
}

@media screen and (max-width: 768px) {
    .navbar {
        padding: 1rem;
    }
    
    .hamburger {
        display: block;
    }
    
    .nav-links {
        display: none;
        width: 100%;
        flex-direction: column;
        padding: 20px 0;
    }
    
    .nav-links.show {
        display: flex;
    }
    
    .cancel-form {
        grid-template-columns: 1fr;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .seats-container {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    
    .seat {
        min-height: 70px;
        font-size: 0.8rem;
    }
    
    .modal-content {
        margin: 10% auto;
        width: 95%;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .admin-controls {
        grid-template-columns: 1fr;
    }
    
    .admin-seats-container {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media screen and (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    .logo span {
        font-size: 1.2rem;
    }
    
    .bus-layout-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .legend {
        width: 100%;
        justify-content: space-between;
    }
    
    .seats-container {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .seat {
        min-height: 60px;
    }
    
    .seat-number {
        font-size: 0.9rem;
    }
    
    .passenger-name {
        display: none;
    }
    
    .modal-header h2 {
        font-size: 1.2rem;
    }
    
    .form-group {
        padding: 10px 20px;
    }
    
    .toast {
        left: 20px;
        right: 20px;
        bottom: 20px;
    }
    
    .admin-seats-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Loading States */
.loading {
    opacity: 0.7;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Print Styles */
@media print {
    .navbar,
    .cancel-booking-card,
    .btn-book,
    .btn-cancel,
    .modal {
        display: none !important;
    }
}