/**
 * Estilos Completos para el Modal de Reserva (Mapa Interactivo)
 * Archivo: public/css/map-modal.css
 */

/* 1. Fondo del Modal: Centrado total y bloqueo de scroll exterior */
#nc-map-modal {
    display: none; /* Se activa como 'flex' vía JS */
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    padding: 20px;
    box-sizing: border-box;
    align-items: center;
    justify-content: center;
}

/* Evita que la página de fondo se mueva cuando el modal está abierto */
body.nc-modal-open {
    overflow: hidden;
}

/* 2. Contenedor del Modal: Estructura de rejilla (Grid) */
.nc-modal-container {
    display: grid;
    grid-template-columns: 38% 62%; /* Proporción optimizada para el formulario */
    background-color: #fff;
    width: 95%;
    max-width: 950px;
    border-radius: 14px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    
    /* LIMITACIÓN DE ALTURA: Clave para que el scroll interno funcione */
    max-height: 90vh; 
    height: auto;
}

/* 3. Columna Izquierda: Imagen fija que no se mueve al hacer scroll */
#nc-modal-image {
    height: 100%;
    background-color: #f8f8f8;
    overflow: hidden;
    border-right: 1px solid #eee;
}

#nc-modal-image img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Mantiene la proporción sin estirarse */
    display: block;
}

/* 4. Columna Derecha: Contenido y Formulario con SCROLL INVISIBLE */
.nc-modal-content-inner {
    padding: 30px 40px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    background-color: #F9EDCC;

    /* CONFIGURACIÓN DE SCROLL: */
    overflow-y: auto; 
    max-height: 90vh; /* Obliga al contenido a quedarse dentro del contenedor */
    min-height: 0;    /* Permite que el contenedor colapse y active el scroll */

    /* Ocultar barra de scroll en navegadores (Firefox, IE, Edge) */
    scrollbar-width: none; 
    -ms-overflow-style: none; 
}

/* Ocultar barra de scroll en Chrome, Safari y Opera */
.nc-modal-content-inner::-webkit-scrollbar {
    display: none;
}

/* Título del Puesto Seleccionado */
#nc-modal-title {
    margin: 0 0 15px 0;
    font-size: 24px;
    font-weight: 800;
    color: #111;
    border-bottom: 3px solid #0073aa;
    padding-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: -0.5px;
}

/* 5. Compactación Intensiva del Formulario para evitar scroll infinito */
#nc-map-modal .nc-booking-form {
    box-shadow: none !important;
    padding: 0 !important;
    background: transparent !important;
}

/* Ocultamos la selección de lista porque ya elegimos desde el mapa */
#nc-map-modal .nc-space-selection {
    display: none !important;
}

/* Reducción de márgenes entre bloques */
#nc-map-modal .nc-form-section {
    margin-bottom: 12px !important;
    padding-bottom: 12px !important;
    border-bottom: 1px solid #f0f0f0 !important;
}

#nc-map-modal .nc-section-title {
    font-size: 17px !important;
    margin-bottom: 8px !important;
    font-weight: 600 !important;
}

#nc-map-modal .nc-field-label {
    font-size: 13px !important;
    margin-bottom: 4px !important;
    font-weight: 600 !important;
}

/* Inputs y Selects más delgados */
#nc-map-modal .nc-datepicker, 
#nc-map-modal .nc-time-select,
#nc-map-modal input[type="email"],
#nc-map-modal .nc-radio-label {
    padding: 8px 12px !important;
    font-size: 14px !important;
    height: auto !important;
}

/* Botón principal prominente pero sin márgenes gigantes */
#nc-map-modal .nc-button {
    padding: 14px 20px !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    width: 100% !important;
    margin-top: 10px !important;
    border-radius: 8px !important;
}

/* 6. Botón de Cerrar (X) Flotante */
.nc-map-modal-close {
    position: absolute;
    right: 15px;
    top: 12px;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
    z-index: 1000;
    color: #444;
    background: rgba(255, 255, 255, 0.95);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: all 0.2s ease;
}

.nc-map-modal-close:hover {
    color: #000;
    transform: scale(1.1);
    background: #fff;
}

#interactive-layer circle.interactive-point {
    cursor: pointer;
    fill: #454734 !important;
    stroke: #454734 !important;
    transition: all 0.2s ease-in-out;
    opacity: 0.8;
    animation: pulse-svg-circle 2s ease-in-out infinite;
}

@keyframes pulse-svg-circle {
    0% {
        r: 10;
        opacity: 0.7;
    }
    50% {
        r: 12;
        opacity: 1;
    }
    100% {
        r: 10;
        opacity: 0.7;
    }
}

/* 7. Ajustes para Pantallas Pequeñas y Móviles */
@media (max-width: 850px) {
    .nc-modal-container {
        grid-template-columns: 1fr; /* Una columna única */
        max-height: 92vh;
        width: 96%;
    }
    
    #nc-modal-image {
        height: 200px; /* Foto arriba, altura fija */
        border-right: none;
        border-bottom: 1px solid #eee;
    }
    
    .nc-modal-content-inner {
        padding: 20px 25px;
        max-height: calc(92vh - 200px); /* El scroll queda solo en el form */
    }

    #nc-modal-title {
        font-size: 20px;
    }
}