/* Estilos globales del cuerpo para centrar formularios (no se aplica al admin) */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #212529;
    /* Fondo oscuro por defecto */
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

/* --- Estilos para el Panel de Administración --- */

/* Anula los estilos globales del body para la página del admin */
body.admin-body {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    background-color: #f4f7f6;
    min-height: 100vh;
}

.admin-header {
    background-color: #212529;
    /* Gris oscuro corporativo */
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 10;
}

.admin-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: white;
}

/* Layout principal con menú lateral */
.admin-layout {
    display: flex;
    flex-grow: 1;
}

.admin-nav {
    width: 220px;
    background-color: #212529;
    /* Gris oscuro corporativo */
    padding: 2rem 0;
    flex-shrink: 0;
}

.admin-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.admin-nav ul li a {
    display: block;
    padding: 1rem 2rem;
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.3s;
}

.admin-nav ul li a:hover {
    background-color: #343a40;
}

.admin-nav ul li a.active {
    background-color: rgba(204, 119, 34, 1);
    /* Naranja corporativo */
    font-weight: 700;
}

.admin-main {
    flex-grow: 1;
    padding: 2rem;
    box-sizing: border-box;
    overflow-y: auto;
}

.admin-panel-container {
    width: 100%;
    padding: 40px;
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
}

/* Estilos de las secciones */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h3 {
    margin: 0;
    font-size: 1.8rem;
    color: #333;
}

.section-actions {
    display: flex;
    gap: 15px;
}

/* --- Dashboard --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 20px;
}

.chart-container {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.kpi-container {
    background: linear-gradient(135deg, #212529, #343a40);
    color: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.kpi-container h4 {
    margin: 0 0 10px 0;
    font-size: 1.2rem;
    font-weight: 500;
}

.kpi-value {
    margin: 0;
    font-size: 3rem;
    font-weight: 700;
    color: rgba(204, 119, 34, 1);
    /* Naranja corporativo */
}

.admin-footer {
    background-color: #212529;
    /* Gris oscuro corporativo */
    color: white;
    text-align: center;
    padding: 1rem;
    font-size: 0.9rem;
}

/* --- Estilos para Formularios (Reserva y Login) --- */

.form-container,
.login-container {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 500px;
    box-sizing: border-box;
}

h2 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="date"],
input[type="time"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
    transition: border-color 0.3s, box-shadow 0.3s;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #cc7722;
    box-shadow: 0 0 5px rgba(204, 119, 34, 0.25);
    outline: none;
}

button {
    width: 100%;
    padding: 12px;
    background-color: #cc7722;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #b3681d;
}

button:disabled {
    background-color: #343a40;
    color: #cc7722;
    cursor: not-allowed;
}

/* --- Mensajes de Feedback --- */
.feedback {
    text-align: center;
    padding: 10px;
    margin-top: 15px;
    border-radius: 5px;
    font-weight: 500;
}

.feedback.success {
    background-color: #d4edda;
    color: #155724;
}

.feedback.error {
    background-color: #f8d7da;
    color: #721c24;
}

/* --- Tabla de Reservas (Admin) --- */
#reservasTable {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

#reservasTable th,
#reservasTable td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
}

#reservasTable th {
    background-color: #f8f9fa;
    color: #333;
    font-weight: 600;
}

#reservasTable tbody tr:nth-child(even) {
    background-color: #fdfdfd;
}

#reservasTable tbody tr:hover {
    background-color: #f1f1f1;
}

/* --- Botones Específicos (Admin) --- */

#refreshButton,
#deleteTodayButton,
#exportPdfButton,
#logoutButton {
    width: auto;
    padding: 10px 20px;
    margin: 0;
    display: inline-block;
    border: none;
    border-radius: 5px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: transform 0.2s, background-color 0.3s;
}

#refreshButton:hover,
#deleteTodayButton:hover,
#exportPdfButton:hover,
#logoutButton:hover {
    transform: translateY(-2px);
}

#refreshButton {
    background-color: #6c757d;
    /* Gris neutro */
    color: white;
}

#refreshButton:hover {
    background-color: #5a6268;
}

#deleteTodayButton {
    background-color: #c82333;
    /* Rojo peligro */
    color: white;
}

#deleteTodayButton:hover {
    background-color: #a71d2a;
}

#logoutButton {
    background-color: rgba(204, 119, 34, 1);
    /* Naranja corporativo */
    color: white;
}

#logoutButton:hover {
    background-color: rgba(184, 107, 30, 1);
}

#exportPdfButton {
    background-color: #cc7722;
    /* Ocre corporativo */
    color: white;
}

#exportPdfButton:hover {
    background-color: #b3681d;
}

/* --- Estilos de Paginación --- */
#pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
}

#pagination-container button {
    background-color: transparent;
    border: 1px solid #212529;
    color: #212529;
    padding: 8px 16px;
    /* Ajuste de padding */
    margin: 0 5px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
    font-size: 14px;
    font-weight: 600;
    width: auto;
    /* Ancho automático */
    height: auto;
    /* Alto automático */
}

#pagination-container button:hover {
    background-color: #212529;
    color: white;
}

#pagination-container button:disabled {
    border-color: #ccc;
    color: #ccc;
    cursor: not-allowed;
    background-color: transparent;
}

#pagination-container span {
    margin: 0 10px;
    color: #555;
    font-size: 15px;
}

/* Iconos eliminados para usar texto completo */

/* --- Estilos del Calendario (Dashboard) --- */
#calendar-container {
    margin-top: 20px;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* Estilo para el estado de carga */
#calendar.loading {
    text-align: center;
    padding: 50px;
    font-style: italic;
    color: #888;
    min-height: 400px;
    /* Altura mínima mientras carga */
}

/* Ajustes en la barra de herramientas de FullCalendar */
.fc .fc-toolbar.fc-header-toolbar {
    margin-bottom: 1.5em;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.fc .fc-toolbar-chunk {
    display: flex;
    align-items: center;
    gap: 5px;
    /* Añade un pequeño espacio entre los botones */
}

/* Botones de FullCalendar */
.fc .fc-button {
    background: #fff;
    border: 1px solid #ccc;
    color: #333;
    font-weight: 500;
    text-transform: capitalize;
    transition: background-color 0.3s;
}

.fc .fc-button:hover {
    background-color: #f0f0f0;
}

.fc .fc-button-primary {
    background-color: #f4f7f6;
    border: 1px solid #ddd;
}

.fc .fc-button-primary:not(:disabled).fc-button-active,
.fc .fc-button-primary:not(:disabled):active {
    background-color: #cc7722;
    color: white;
    border-color: #cc7722;
}

.fc .fc-today-button {
    background-color: #6c757d;
    color: white;
    border-color: #6c757d;
}

.fc .fc-today-button:hover {
    background-color: #5a6268;
}

.pagination-container button:disabled {
    background-color: #e9ecef;
    cursor: not-allowed;
}

.pagination-container span {
    margin: 0 10px;
    color: #495057;
}

/* Estilos para el contenedor del logo */
.logo-container {
    text-align: center;
    margin-bottom: 20px;
}

.logo {
    max-width: 180px;
    height: auto;
}

/* --- Estilos específicos para la página pública de reservas --- */

body.public-page {
    background-color: #343a40;
    color: #dee2e6;
}

.public-page .form-container {
    background-color: #212529;
    border-left-color: #cc7722;
}

.public-page h2,
.public-page legend,
.public-page label {
    color: #dee2e6;
}

.public-page input[type="text"],
.public-page input[type="email"],
.public-page input[type="tel"],
.public-page input[type="number"],
.public-page input[type="date"],
.public-page select,
.public-page textarea {
    background-color: #343a40;
    color: #dee2e6;
    border: 1px solid #495057;
}

.public-page input:focus,
.public-page select:focus,
.public-page textarea:focus {
    border-color: #cc7722;
    box-shadow: 0 0 0 0.2rem rgba(204, 119, 34, 0.25);
    outline: none;
}

.public-page button[type="submit"] {
    background-color: #cc7722;
    border-color: #cc7722;
    color: #ffffff;
}

.public-page button[type="submit"]:hover {
    background-color: #b3681d;
    border-color: #b3681d;
}

/* Ajuste para el selector de fecha en navegadores WebKit (Chrome, Safari) */
.public-page input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
}

.capacity-message {
    font-size: 0.9rem;
    color: #cc7722;
    /* Naranja corporativo */
    margin-top: 5px;
    font-weight: 500;
    transition: opacity 0.3s ease-in-out;
}

/* --- Ajustes para Móviles (iOS/iPhone) --- */
@media (max-width: 768px) {
    body {
        align-items: flex-start;
        /* Evita saltos al centrar verticalmente */
        padding: 20px 10px;
    }

    .form-container,
    .login-container {
        padding: 20px;
        /* Reducción de padding para pantallas pequeñas */
    }

    input,
    select,
    textarea {
        font-size: 16px !important;
        /* Evita que iOS haga zoom automático */
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
    }
}

/* --- Estilos para la Pantalla de Selección --- */
.main-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

.selection-screen {
    background: #212529;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    text-align: center;
    max-width: 500px;
    width: 100%;
}

.welcome-text {
    font-size: 1.1rem;
    color: #adb5bd;
    margin-bottom: 30px;
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.option-btn {
    padding: 20px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: transform 0.2s, background-color 0.3s;
    text-align: left;
    display: flex;
    flex-direction: column;
}

.option-btn:hover {
    transform: translateY(-3px);
}

.option-btn.primary {
    background-color: #cc7722;
    color: white;
}

.option-btn.secondary {
    background-color: #343a40;
    color: #dee2e6;
    border: 1px solid #495057;
}

.btn-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.btn-desc {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* --- Estilos para el Asistente Guiado --- */
.assistant-container {
    background: #212529;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    max-width: 500px;
    width: 100%;
    min-height: 400px;
    display: flex;
    flex-direction: column;
}

.assistant-header {
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 1px solid #343a40;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.mini-logo {
    width: 40px;
    height: auto;
}

.assistant-content {
    flex-grow: 1;
    margin-bottom: 20px;
}

.assistant-msg {
    color: #dee2e6;
    font-size: 1.1rem;
    line-height: 1.5;
    margin-bottom: 20px;
    animation: fadeIn 0.5s ease;
}

.assistant-controls {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.assistant-btn {
    padding: 15px;
    border-radius: 10px;
    border: 1px solid #495057;
    background: #343a40;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.assistant-btn:hover {
    background: #495057;
    border-color: #cc7722;
}

.assistant-btn.active {
    background: #cc7722;
    border-color: #cc7722;
}

.back-link {
    background: none;
    border: none;
    color: #adb5bd;
    cursor: pointer;
    margin-top: 20px;
    font-size: 0.9rem;
    text-decoration: underline;
    width: auto;
}

.back-link:hover {
    color: white;
}

.summary-box {
    background: #2b3035;
    padding: 15px;
    border-radius: 10px;
    border-left: 4px solid #cc7722;
    margin-top: 10px;
}

.summary-item {
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.summary-label {
    color: #adb5bd;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Ajustes adicionales para inputs dentro del asistente */
.assistant-input {
    width: 100%;
    padding: 15px;
    background: #343a40;
    border: 1px solid #495057;
    border-radius: 10px;
    color: white;
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.assistant-input:focus {
    border-color: #cc7722;
    outline: none;
}

/* --- Estilos del Ticket Digital --- */
.ticket-container {
    background: #fff;
    color: #333;
    padding: 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    margin-top: 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    animation: slideUp 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.ticket-header {
    background: #cc7722;
    color: white;
    padding: 15px;
    text-align: center;
    border-bottom: 2px dashed #eee;
}

.ticket-header h4 {
    margin: 5px 0;
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ticket-body {
    padding: 20px;
    position: relative;
}

.ticket-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 5px;
}

.ticket-label {
    font-weight: bold;
    color: #666;
    font-size: 0.85rem;
}

.ticket-value {
    color: #222;
    font-weight: 600;
}

.ticket-footer {
    background: #f8f9fa;
    padding: 15px;
    font-size: 0.8rem;
    color: #555;
    border-top: 2px dashed #eee;
}

.ticket-footer ul {
    padding-left: 15px;
    margin: 10px 0;
}

.ticket-footer li {
    margin-bottom: 4px;
}

.price-table-mini {
    width: 100%;
    font-size: 0.75rem;
    margin-top: 10px;
    border-collapse: collapse;
}

.price-table-mini td {
    padding: 3px 0;
    border-bottom: 1px solid #eee;
}

/* Efecto de "Corte de Ticket" */
.ticket-body::after {
    content: "";
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 100%;
    height: 20px;
    background-image: radial-gradient(circle, #fff 5px, transparent 6px);
    background-size: 20px 20px;
    background-position: left;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Ocultar todo menos el ticket al imprimir */
@media print {
    body * {
        visibility: hidden;
    }

    .ticket-container,
    .ticket-container * {
        visibility: visible;
    }

    .ticket-container {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        box-shadow: none;
    }
}