/* Estilos específicos para la página de tours públicos */

/* Secciones de tours */
.tour-section {
    display: block;
    margin-bottom: 40px;
}

.tour-section h2 {
    color: var(--primary-dark);
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
    display: flex;
    align-items: center;
}

.tour-section h2 i {
    margin-right: 10px;
}

/* Contenedor de tours */
.tours-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 10px;
}

/* Tarjeta de tour */
.tour-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.tour-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
}

.tour-card-image {
    height: 350px; /* Aumenta el tamaño del flyer */
    overflow: hidden;
    position: relative;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tour-card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Muestra el flyer completo, sin recortar */
    transition: transform 0.5s ease;
    background: #fff;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.10);
}

.tour-card:hover .tour-card-image img {
    transform: scale(1.08);
}

.tour-status-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    z-index: 2;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.tour-status-badge.disponible {
    background: #4caf50;
    color: #fff;
}

.tour-status-badge.en-curso {
    background: #ff9800;
    color: #fff;
}

.tour-status-badge.finalizado {
    background: #757575;
    color: #fff;
}

.tour-status-badge.agotado {
    background: #f44336;
    color: #fff;
    font-weight: bold;
    letter-spacing: 1px;
    border: 1.5px solid #b71c1c;
    box-shadow: 0 2px 8px rgba(244,67,54,0.12);
}

.tour-card-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: linear-gradient(to bottom, #f9f9f9, #fff);
}

.tour-card-title {
    font-size: 1.4rem;
    font-weight: bold;
    margin-bottom: 12px;
    color: var(--primary-dark);
}

.tour-card-details {
    list-style: none;
    padding: 0;
    margin: 0 0 10px 0;
    flex-grow: 1;
}

.tour-card-details li {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
    color: #666;
}

.tour-card-details i {
    margin-right: 8px;
    color: var(--primary-color);
}

.tour-card-price {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--primary-dark);
    margin-top: 10px;
    display: flex;
    align-items: center;
}

.tour-card-price i {
    margin-right: 8px;
}

.seats-availability {
    background-color: #f5f5f5;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 15px;
    text-align: center;
}

.progress-bar {
    height: 10px;
    background-color: #e0e0e0;
    border-radius: 5px;
    margin-top: 8px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 5px;
    transition: width 0.3s ease;
}

.progress-bar-fill.good {
    background-color: var(--secondary-color);
}

.progress-bar-fill.medium {
    background-color: var(--accent-color);
}

.progress-bar-fill.low {
    background-color: var(--danger-color);
}

/* Cargando indicador */
.loading-indicator {
    text-align: center;
    padding: 30px;
    grid-column: 1 / -1;
    color: var(--primary-dark);
    font-size: 1.2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.loading-indicator i {
    font-size: 2rem;
}

/* Mensaje de no tours */
.no-tours-message {
    text-align: center;
    padding: 30px;
    grid-column: 1 / -1;
    color: #666;
    font-size: 1.2rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

/* Estilos para el mapa de asientos */
.seat-selection-modal .modal-content {
    max-width: 800px;
}

.bus-selector {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.bus-btn {
    background-color: #f5f5f5;
    border: 2px solid var(--border-color);
    border-radius: 30px;
    padding: 8px 16px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
}

.bus-btn:hover {
    background-color: #e8f5e9;
    color: var(--primary-dark);
    border-color: var(--primary-color);
}

.bus-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-dark);
}

.tour-info-container {
    background-color: #f5f5f5;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 25px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: space-between;
    align-items: center;
}

.tour-info-container img {
    max-width: 200px;
    max-height: 150px;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    transition: transform 0.3s ease;
}

.tour-info-container img:hover {
    transform: scale(1.05);
}

.tour-info-details {
    flex-grow: 1;
}

.tour-info-details h3 {
    font-size: 1.2rem;
    margin-bottom: 5px;
    color: var(--primary-dark);
}

.seat-map-container {
    background-color: #f8f8f8;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    position: relative;
}

.bus-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 20px;
}

.bus-front {
    background-color: #333;
    color: #fff;
    padding: 10px;
    text-align: center;
    width: 100%;
    font-weight: bold;
    margin-bottom: 10px;
}

.seats-grid {
    display: grid;
    grid-template-columns: repeat(5, auto); /* 2 asientos + pasillo + 2 asientos */
    gap: 10px;
}

.seat {
    width: 40px;
    height: 40px;
    background-color: #4caf50;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    cursor: pointer;
}

.seat.occupied {
    background-color: #f44336;
    cursor: not-allowed;
}

.seat.selected {
    background-color: #ff9800;
}

/* Información de asientos seleccionados */
.selected-seats-info {
    background-color: #e8f5e9;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    border: 1px solid var(--border-color);
}

.selected-seats-info p {
    margin: 5px 0;
}

#totalPrice {
    font-weight: bold;
    color: var(--primary-dark);
}

/* Modal de confirmación */
.confirmation-modal .modal-content {
    max-width: 500px;
    text-align: center;
}

.confirmation-message {
    margin-bottom: 20px;
}

.confirmation-message p {
    font-size: 1.1rem;
    margin-bottom: 20px;
}

.reservation-details {
    background-color: #f5f5f5;
    padding: 15px;
    border-radius: 8px;
    text-align: left;
    margin: 20px 0;
}

.reservation-details p {
    margin: 10px 0;
    font-size: 1rem;
}

/* Estilos para el croquis visual de asientos */
.seat-btn {
    width: var(--seat-btn-size, 70px) !important;
    height: var(--seat-btn-size, 70px) !important;
    background-color: #4caf50;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    cursor: pointer;
    border: 1px solid #ccc;
    font-weight: bold;
    font-size: 1.3rem !important;
    transition: all 0.2s ease-in-out;
    margin: 8px !important;
    position: relative !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12) !important;
}

.seat-btn.occupied {
    background-color: #f44336;
    color: #fff;
    cursor: not-allowed;
}

.seat-btn.selected {
    background-color: #ff9800;
    color: #fff;
    transform: scale(1.1);
}

.seat-btn:hover:not(.occupied):not(.selected) {
    background-color: #45a049;
    transform: scale(1.05);
}

/* Estilos adicionales para el croquis de asientos */
.seat-croquis-table {
    border-spacing: 4px;
    border-collapse: separate;
    margin: 20px auto;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.seat-pasillo {
    width: 20px !important;
    background: #eee;
    border-radius: 15px;
}

.driver-area {
    font-size: 0.9rem;
    color: #666;
    font-weight: bold;
}

/* Ajustar tamaño y espaciado de los asientos */
.seat-btn {
    width: 40px !important;
    height: 40px !important;
    margin: 4px !important;
    font-size: 0.9rem !important;
    transition: all 0.2s ease-in-out !important;
    position: relative !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
}

/* Ajuste para el pasillo de bus */
.seat-pasillo,
td:nth-child(3) {
    width: 40px !important;
    min-width: 40px !important;
}

/* Media queries */
@media (max-width: 768px) {
    .tours-container {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
    
    .tour-card-image {
        height: 220px;
    }
    
    .tour-info-container {
        flex-direction: column;
        text-align: center;
        padding: 15px;
    }
    
    .tour-info-container img {
        margin: 0 auto;
        max-width: 180px;
    }
}

@media (max-width: 480px) {
    .tour-card-image {
        height: 160px;
    }
    
    .tours-container {
        grid-template-columns: 1fr;
    }
    
    .tour-info-container img {
        max-width: 100%;
        height: auto;
    }
}

#reservationForm {
    display: flex;
    justify-content: center;
}
#reserveButton {
    display: block;
    margin: 30px auto 0 auto;
    width: max-content;
    font-size: 1.3rem;
    padding: 20px 40px;
}
