/* css/style.css - Estilos para el frontend (index.html) */

/* General body and container styling for background and layout */
body {
    font-family: 'Inter', sans-serif;
    background-color: transparent; /* Fondo transparente para el body */
    background-image: url('https://elnacionalpty.com/reserva/img/FR.webp'); /* CAMBIO: Imagen de fondo */
    background-size: cover; /* Cubrir todo el área */
    background-position: center; /* Centrar la imagen */
    background-attachment: fixed; /* Fondo fijo al hacer scroll */
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Alineado al inicio para dar espacio arriba */
    min-height: 100vh;
    padding: 5px 10px; /* Reducido drásticamente el padding superior/inferior */
    overflow-y: auto; /* Allow vertical scrolling if content overflows */
    box-sizing: border-box;
}
.container {
    background-color: rgba(0, 0, 0, 0.6); /* CAMBIO: Fondo oscuro semi-transparente para el contenedor */
    padding: 15px; /* Reducido el padding general del contenedor */
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5); /* CAMBIO: Sombra más pronunciada para profundidad */
    max-width: 600px;
    width: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 10px; /* Reducido el espacio entre elementos */
    color: #FFFFFF; /* Color de texto general a blanco */
    box-sizing: border-box;
    margin-top: 5px; /* Margen superior reducido para pegar más arriba */
    margin-bottom: 10px; /* Mantener un poco de espacio abajo */
}

/* Títulos más pegados arriba y tamaño reducido 10% */
h1 {
    margin-top: 0; /* Pegado arriba */
    margin-bottom: 10px; /* Espacio reducido */
    font-size: 2.7rem; /* Aproximadamente 10% menos de 3rem (3rem * 0.9 = 2.7rem) */
    color: #FFFFFF; /* Color de título a blanco */
    text-shadow: 1px 1px 3px rgba(0,0,0,0.7); /* CAMBIO: Sombra para mejorar legibilidad sobre fondo */
}

h2 {
    margin-top: 0; /* Pegado arriba */
    margin-bottom: 10px; /* Espacio reducido */
    font-size: 1.8rem; /* Aproximadamente 10% menos de 2rem (2rem * 0.9 = 1.8rem) */
    color: #FFFFFF; /* Color de subtítulo a blanco */
    text-shadow: 1px 1px 3px rgba(0,0,0,0.7); /* CAMBIO: Sombra para mejorar legibilidad sobre fondo */
}

/* Estilo para párrafos dentro del contenedor para mejorar legibilidad */
.container p {
    color: #FFFFFF; /* Asegurar que los párrafos sean blancos */
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7); /* Sombra para mejorar legibilidad */
    line-height: 1.5; /* Mejorar espaciado de línea */
    font-weight: 400; /* CAMBIO: Volver a peso normal si se había puesto negrita */
    font-size: 1.08rem; /* CAMBIO: Volver al tamaño original si se había aumentado */
}


/* Form group styling */
.form-group {
    margin-bottom: 10px; /* Reducido el margen */
    text-align: left;
}
.form-group label {
    display: block;
    margin-bottom: 5px; /* Reducido el margen */
    font-weight: 600;
    color: #FFFFFF; /* Color de etiquetas a blanco */
    background-color: transparent; /* Fondo transparente para etiquetas */
    padding: 0; /* Eliminar padding si el fondo es transparente */
    border-radius: 0; /* Eliminar border-radius si el fondo es transparente */
    font-size: 0.9em; /* Reducido 10% */
    display: inline-block; /* Para que el fondo se ajuste al texto */
    line-height: 1.2; /* Ajustar altura de línea */
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5); /* CAMBIO: Añadir sombra sutil a etiquetas */
}
/* Estilos específicos para las etiquetas de los radio buttons */
.form-group .flex label {
    background-color: transparent; /* Fondo transparente para radio/checkbox */
    padding: 0; /* Eliminar padding */
    border-radius: 0; /* Eliminar border-radius */
    margin-left: 5px; /* Espacio entre el radio y la etiqueta */
    color: #FFFFFF; /* Color de texto a blanco */
    cursor: pointer; /* Indicar que es interactivo */
    transition: none; /* Eliminar transición de fondo */
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5); /* CAMBIO: Añadir sombra sutil a etiquetas de radio/checkbox */
}
.form-group .flex label:hover {
    background-color: transparent; /* Eliminar oscurecimiento al pasar el ratón */
}


.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="date"],
.form-group select {
    width: 100%;
    padding: 10px; /* Reducido el padding */
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.9rem; /* Reducido 10% */
    box-sizing: border-box; /* Include padding and border in the element's total width and height */
    background-color: #FFFFFF; /* Mantener fondo blanco para inputs */
    color: #363636; /* Mantener texto oscuro en inputs para legibilidad */
}
.form-group input[type="checkbox"],
.form-group input[type="radio"] {
    margin-right: 8px; /* Reducido el margen */
    transform: scale(1.1); /* Ligeramente más pequeños */
    accent-color: #B4914C; /* Gold accent color for checkboxes */
}

/* Button styling */
.button {
    padding: 10px 20px; /* Reducido el padding */
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    margin-top: 10px; /* Reducido el margen */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    text-transform: uppercase; /* Uppercase text for buttons */
    font-size: 0.95em; /* Reducido 10% */
}
.button-primary {
    background-color: #B4914C; /* Gold primary button color */
    color: #ffffff;
}
.button-primary:hover {
    background-color: #E3C279; /* Lighter gold on hover */
    transform: translateY(-2px); /* Slight lift effect */
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2); /* Larger shadow on hover */
}
.button-secondary {
    background-color: #6b7280; /* Dark grey for secondary buttons */
    color: #ffffff;
}
.button-secondary:hover {
    background-color: #4b5563; /* Even darker grey on hover */
    transform: translateY(-2px);
}
.button-back {
    background-color: #D32F2F; /* Darker red for back buttons */
    color: #ffffff;
}
.button-back:hover {
    background-color: #B71C1C; /* Even darker red on hover */
    transform: translateY(-2px);
}

/* Confirmation message styling */
.confirmation-message {
    margin-top: 15px; /* Reducido el margen */
    padding: 12px; /* Reducido el padding */
    background-color: #4A4A4A; /* Fondo oscuro para el mensaje de confirmación */
    border-radius: 10px;
    border: 2px solid #E3C279; /* Gold border */
    color: #FFFFFF; /* Texto blanco para el mensaje de confirmación */
}
.confirmation-message h2 {
    font-size: 2.25rem; /* Reducido 10% */
    color: #E3C279; /* Título de confirmación a color dorado */
    margin-bottom: 8px; /* Reducido el margen */
}
.confirmation-message p {
    font-size: 1.08rem; /* Reducido 10% */
    color: #FFFFFF; /* Párrafos a blanco */
    margin-top: 8px; /* Reducido el margen */
}
.confirmation-message .code {
    font-size: 1.8rem; /* Reducido 10% */
    font-weight: bold;
    color: #D97706; /* Orange for the reservation code */
    letter-spacing: 1px; /* Reducido el espaciado */
    margin-top: 8px; /* Reducido el margen */
}

/* Utility class to hide elements */
.hidden {
    display: none !important;
}

/* Button group for side-by-side buttons */
.button-group {
    display: flex;
    flex-wrap: wrap; /* Allow buttons to wrap on smaller screens */
    gap: 8px; /* Reducido el espacio entre botones */
    justify-content: center;
    margin-top: 10px; /* Reducido el margen */
}
.button-group .button {
    flex-grow: 1; /* Buttons expand to fill available space */
    margin-top: 0; /* Override default button margin-top */
}

/* Phone input group with custom select */
.phone-input-group {
    display: flex;
    align-items: center;
    gap: 8px; /* Reducido el espacio */
    position: relative; /* Needed for absolute positioning of custom dropdown */
    flex-wrap: wrap; /* Allow items to wrap onto the next line on small screens */
}
.phone-input-group input[type="text"] {
    flex-grow: 1; /* Phone number input takes available space */
    min-width: 100px; /* Ajustado el min-width */
}

/* WhatsApp specific options styling */
.whatsapp-options {
    margin-top: 8px; /* Reducido el margen */
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 8px; /* Reducido el padding */
    background-color: rgba(0, 0, 0, 0.5); /* Mantener fondo oscuro semi-transparente para el grupo de WhatsApp */
    color: #FFFFFF; /* Texto blanco para el grupo de WhatsApp */
}
.whatsapp-options .flex {
    margin-bottom: 6px; /* Reducido el margen */
}
.whatsapp-options .flex:last-child {
    margin-bottom: 0;
}

/* Confirmation message for sending status */
#sendingConfirmationMessage {
    margin-top: 10px; /* Reducido el margen */
    color: #10B981; /* Green color for success status */
    font-weight: 600;
    font-size: 0.9em; /* Reducido 10% */
}

/* Custom Dropdown for Country Codes */
.custom-select-wrapper {
    position: relative;
    flex-shrink: 0;
    width: 110px; /* Ajustado el ancho */
    min-width: 80px; /* Ajustado el min-width */
    max-width: 110px; /* Ajustado el max-width */
}
@media (max-width: 400px) { /* Adjust for very small phone screens if necessary */
    .custom-select-wrapper {
        width: 100%; /* Take full width if wrapped */
        max-width: none;
    }
}

.custom-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px; /* Reducido el padding */
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background-color: white;
    cursor: pointer;
    font-size: 0.9rem; /* Reducido 10% */
    color: #363636;
    user-select: none; /* Prevent text selection on click */
}

.custom-options {
    display: none; /* Hidden by default, controlled by JS adding/removing 'open' class */
    position: absolute;
    top: 100%; /* Position right below the trigger */
    left: 0;
    right: 0;
    background-color: white;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    max-height: 180px; /* Reducido el max-height */
    overflow-y: auto; /* Enable vertical scrolling */
    z-index: 10; /* Ensure dropdown appears above other elements */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-top: 3px; /* Reducido el margen */
}

.custom-options.open {
    display: block; /* Show when open class is present */
}

.custom-option {
    padding: 8px 10px; /* Reducido el padding */
    display: flex;
    align-items: center;
    gap: 8px; /* Reducido el espacio */
    cursor: pointer;
    font-size: 0.8em; /* Reducido 10% */
    color: #363636;
}

.custom-option:hover {
    background-color: #f3f4f6; /* Light grey background on hover */
}

.custom-option.selected {
    background-color: #e0f2f7; /* Light blue for selected option */
    font-weight: 600;
}

.custom-option .flag-emoji {
    font-size: 1.1em; /* Reducido el tamaño */
    line-height: 1; /* Align emoji vertically */
}

/* Responsive adjustments */
@media (max-width: 800px) { /* CAMBIO: Max-width a 800px */
    body {
        padding: 5px; /* Reducido aún más el padding del body */
    }
    .container {
        padding: 10px; /* Reducido aún más el padding del contenedor */
        margin: 5px; /* Reducido el margen */
        gap: 8px; /* Reducido el espacio entre elementos */
    }

    h1 {
        font-size: 2rem; /* Ajuste para móviles */
        margin-bottom: 8px;
    }
    h2 {
        font-size: 1.5rem; /* Ajuste para móviles */
        margin-bottom: 8px;
    }

    .button {
        padding: 8px 12px; /* Ajuste para móviles */
        font-size: 0.8em; /* Ajuste para móviles */
        margin: 3px;
    }

    .form-group label {
        font-size: 0.8em; /* Ajuste para móviles */
    }
    .form-group input[type="text"],
    .form-group input[type="email"],
    .form-group input[type="date"],
    .form-group select {
        font-size: 0.8em; /* Ajuste para móviles */
        padding: 6px;
    }

    .confirmation-message {
        padding: 8px; /* Ajuste para móviles */
        margin-top: 10px;
    }
    .confirmation-message h2 {
        font-size: 1.8rem; /* Ajuste para móviles */
    }
    .confirmation-message p {
        font-size: 0.9em; /* Ajuste para móviles */
    }
    .confirmation-message .code {
        font-size: 1.4rem; /* Ajuste para móviles */
    }

    .button-group {
        gap: 6px; /* Ajuste para móviles */
    }

    .phone-input-group {
        flex-direction: column;
        gap: 0;
    }

    .custom-select-wrapper {
        min-width: 70px; /* Ajuste para móviles */
    }
    .custom-select-trigger {
        font-size: 0.8em; /* Ajuste para móviles */
        padding: 6px;
    }
    .custom-option {
        font-size: 0.7em; /* Ajuste para móviles */
    }
    .custom-option .flag-emoji {
        font-size: 1em; /* Ajuste para móviles */
    }
}

@media (max-width: 480px) {
    /* Ajustes adicionales para pantallas muy pequeñas */
    body {
        padding: 2px;
    }
    .container {
        padding: 8px;
        margin: 2px;
        gap: 5px;
    }
    h1 {
        font-size: 1.5rem;
    }
    h2 {
        font-size: 1.2rem;
    }
    .button {
        padding: 6px 10px;
        font-size: 0.7em;
        margin: 2px;
    }
    .form-group label {
        font-size: 0.75em;
    }
    .form-group input[type="text"],
    .form-group input[type="email"],
    .form-group input[type="date"],
    .form-group select {
        font-size: 0.75em;
        padding: 5px;
    }
    .confirmation-message h2 {
        font-size: 1.5rem;
    }
    .confirmation-message p {
        font-size: 0.8em;
    }
    .confirmation-message .code {
        font-size: 1.2rem;
    }
}

/* ===== Fondo adaptable a cualquier dispositivo ===== */
/* En móviles el background-attachment: fixed da problemas (salto / no cubre),
   por eso lo cambiamos a scroll y reforzamos que cubra toda la pantalla. */
@media (max-width: 800px) {
    body {
        background-attachment: scroll;
        min-height: 100vh;
        min-height: 100dvh; /* cubre bien en navegadores móviles modernos */
    }
}

/* ============================================================ */
/* MEJORAS ESTÉTICAS 2026 — sutiles, manteniendo la esencia     */
/* (dorado #B4914C / fondo oscuro translúcido)                  */
/* ============================================================ */

/* Contenedor con efecto vidrio más refinado */
.container {
    background-color: rgba(15, 15, 18, 0.62);
    backdrop-filter: blur(12px) saturate(120%);
    -webkit-backdrop-filter: blur(12px) saturate(120%);
    border: 1px solid rgba(227, 194, 121, 0.18);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
    animation: containerIn 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes containerIn {
    from { opacity: 0; transform: translateY(14px) scale(0.99); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Inputs y selects con foco dorado */
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="date"],
.form-group select {
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus,
.form-group input[type="date"]:focus,
.form-group select:focus {
    outline: none;
    border-color: #E3C279;
    box-shadow: 0 0 0 3px rgba(227, 194, 121, 0.25);
}

/* Botones: brillo sutil al pasar el cursor */
.button {
    position: relative;
    overflow: hidden;
    letter-spacing: 0.03em;
}
.button:active { transform: translateY(0) scale(0.98); }
.button-primary {
    background-image: linear-gradient(135deg, #B4914C 0%, #C9A65E 100%);
}
.button-primary:hover {
    background-image: linear-gradient(135deg, #C9A65E 0%, #E3C279 100%);
}

/* Cuadros de hora: transición y selección más marcada */
.time-slot-btn {
    border-radius: 10px !important;
}
.time-slot-btn:active { transform: scale(0.96); }

/* Foco visible para accesibilidad (teclado) */
.button:focus-visible,
.time-slot-btn:focus-visible {
    outline: 2px solid #E3C279;
    outline-offset: 2px;
}

/* Respeto a usuarios que prefieren menos movimiento */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        transition-duration: 0.001ms !important;
    }
    .button:hover { transform: none; }
}
