* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8fafc;
    color: #1e293b;
    line-height: 1.6;
}

/* Header Styles */
.header {
    background: linear-gradient(135deg, #1e40af 0%, #0ea5e9 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s;
}

.nav-links a:hover {
    opacity: 0.8;
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: white;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #1e40af 0%, #0ea5e9 100%);
    color: white;
    padding: 4rem 1rem;
    text-align: center;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    animation: fadeInUp 0.8s ease-out;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    animation: fadeInUp 0.8s ease-out 0.2s backwards;
}

/* Search Form */
.search-container {
    max-width: 1000px;
    margin: -3rem auto 3rem;
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    animation: fadeInUp 0.8s ease-out 0.4s backwards;
}

.search-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    align-items: end;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #475569;
    font-size: 0.9rem;
}

.form-group input,
.form-group select {
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #1e40af;
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group small {
    margin-top: 0.25rem;
    color: #64748b;
    font-size: 0.875rem;
}

.btn {
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(245, 158, 11, 0.3);
}

.btn-secondary {
    background: #e2e8f0;
    color: #475569;
}

.btn-secondary:hover {
    background: #cbd5e1;
}

/* Content Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 1rem;
}

/* Features Section */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.feature-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    transition: all 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    color: #1e40af;
    margin-bottom: 0.5rem;
}

/* Bus Results */
.bus-results {
    display: none;
}

.bus-results.active {
    display: block;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.sort-options {
    display: flex;
    gap: 0.5rem;
}

.bus-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s;
    animation: fadeIn 0.5s ease-out;
}

.bus-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.12);
}

.bus-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.bus-company {
    font-size: 1.3rem;
    font-weight: bold;
    color: #1e40af;
}

.bus-price {
    font-size: 1.5rem;
    font-weight: bold;
    color: #f59e0b;
}

.bus-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
}

.detail-label {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 0.25rem;
}

.detail-value {
    font-weight: 600;
    color: #1e293b;
}

.amenities {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.amenity {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.9rem;
    color: #64748b;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal[style*="display: flex"] {
    display: flex !important;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease-out;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.modal-header h2 {
    color: #1e40af;
}

.close-btn {
    font-size: 2rem;
    cursor: pointer;
    color: #64748b;
    background: none;
    border: none;
}

.close-btn:hover {
    color: #1e293b;
}

/* Seat Layout */
.seat-legend {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legend-seat {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: 2px solid #cbd5e1;
}

.legend-seat.available {
    background: #ffffff;
    border-color: #cbd5e1;
}

.legend-seat.selected {
    background: #22c55e;
    border-color: #16a34a;
}

.legend-seat.occupied {
    background: #e2e8f0;
    border-color: #94a3b8;
    opacity: 0.6;
}

.bus-layout {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 2rem;
    padding: 2rem;
    background: #f8fafc;
    border-radius: 12px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.seat-row {
    display: grid;
    grid-template-columns: 1fr 1fr 0.5fr 1fr 1fr;
    gap: 0.5rem;
    position: relative;
    align-items: center;
}

.bus-element-row {
    display: grid;
    grid-template-columns: 1fr 1fr 0.5fr 1fr 1fr;
    gap: 0.5rem;
    position: relative;
    align-items: center;
    margin: 0.5rem 0;
}

/* Pasillo invisible pero presente */
.aisle-space {
    width: 100%;
    height: 100%;
    min-height: 60px;
    /* Pasillo invisible - solo espacio de separación */
    background: transparent;
}

/* Elementos del bus */
.bus-element {
    width: 100%;
    aspect-ratio: 1;
    border: 2px solid #94a3b8;
    border-radius: 8px;
    background: #f1f5f9;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    min-width: 60px;
    min-height: 60px;
    position: relative;
}

/* Baño dentro de una fila de asientos */
.seat-row .bus-element.bathroom {
    width: 100%;
    aspect-ratio: 1;
    min-width: 60px;
    min-height: 60px;
}

.bus-element.empty {
    background: transparent;
    border: none;
    visibility: hidden;
}

.bus-element.driver {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-color: #1e40af;
    color: white;
}

.bus-element.stairs {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border-color: #b45309;
    color: white;
}

.bus-element.tv {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    border-color: #6d28d9;
    color: white;
}

.bus-element.bathroom {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    border-color: #0e7490;
    color: white;
}

.bus-icon {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.bus-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.2;
}

.seat {
    width: 100%;
    aspect-ratio: 1;
    border: 2px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    transition: all 0.2s ease;
    position: relative;
    min-width: 60px;
    min-height: 60px;
}

.seat-number {
    font-size: 1rem;
    font-weight: bold;
    color: #1e293b;
}

/* Estado: Disponible */
.seat.available {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #1e293b;
}

.seat.available:hover {
    transform: scale(1.05);
    border-color: #3b82f6;
    background: #eff6ff;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

/* Estado: Seleccionado */
.seat.selected {
    background: #22c55e;
    border-color: #16a34a;
    color: white;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
}

.seat.selected .seat-number {
    color: white;
    font-weight: 700;
}

.seat.selected:hover {
    transform: scale(1.05);
    background: #16a34a;
}

/* Estado: Ocupado */
.seat.occupied {
    background: #e2e8f0;
    border-color: #94a3b8;
    cursor: not-allowed;
    opacity: 0.6;
}

.seat.occupied .seat-number {
    color: #64748b;
    text-decoration: line-through;
}

.seat.occupied:hover {
    transform: none;
    cursor: not-allowed;
}

/* Estado: Bloqueado (siendo seleccionado por otro usuario) */
.seat.locked {
    background: #fef3c7;
    border-color: #fbbf24;
    cursor: not-allowed;
    opacity: 0.8;
    position: relative;
}

.seat.locked .seat-number {
    color: #92400e;
}

.seat.locked::after {
    content: "🔒";
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 0.7rem;
}

.seat.locked:hover {
    transform: none;
    cursor: not-allowed;
}

/* Asiento vacío */
.seat.empty-seat {
    background: transparent;
    border: none;
    cursor: default;
    visibility: hidden;
}

/* Estilos para tipo de asiento (opcional, más sutil) */
.seat.ventana {
    /* Puede tener un indicador visual sutil si se desea */
}

.seat.pasillo {
    /* Puede tener un indicador visual sutil si se desea */
}

.booking-summary {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.summary-total {
    font-size: 1.3rem;
    font-weight: bold;
    color: #1e40af;
    padding-top: 1rem;
    border-top: 2px solid #e2e8f0;
    margin-top: 1rem;
}

/* Footer */
.footer {
    background: #1e293b;
    color: white;
    padding: 3rem 1rem 1rem;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    margin-bottom: 1rem;
    color: #0ea5e9;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: #cbd5e1;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: #0ea5e9;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #334155;
    color: #94a3b8;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    display: none;
    align-items: center;
    gap: 1rem;
    z-index: 2000;
    animation: slideInRight 0.3s ease-out;
}

.toast.active {
    display: flex;
}

.toast.success {
    border-left: 4px solid #10b981;
}

.toast.error {
    border-left: 4px solid #ef4444;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }

    .search-form {
        grid-template-columns: 1fr;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    /* Mobile menu overlay */
    .mobile-menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
        z-index: 999;
    }

    .mobile-menu-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: linear-gradient(135deg, #1e40af 0%, #0ea5e9 100%);
        flex-direction: column;
        padding: 5rem 1.5rem 2rem;
        gap: 0;
        transition: right 0.3s ease;
        z-index: 1000;
        box-shadow: -2px 0 10px rgba(0,0,0,0.2);
        overflow-y: auto;
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links li {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .nav-links a {
        display: block;
        padding: 1rem;
        border-radius: 8px;
        width: 100%;
        text-align: left;
    }

    .nav-links a:hover {
        background: rgba(255, 255, 255, 0.1);
        opacity: 1;
    }

    .bus-layout {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.5rem;
        padding: 1rem;
    }

    .toast {
        right: 1rem;
        left: 1rem;
        bottom: 1rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}

