/* Reset y estilos base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #8b4513 0%, #8b4513 100%);
    min-height: 100vh;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* Encabezado */
.header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.header p {
    font-size: 1.2em;
    opacity: 0.9;
}

/* Formulario de reserva */
.reservation-form {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin-bottom: 30px;
}

.reservation-form h2 {
    color: #333;
    margin-bottom: 25px;
    text-align: center;
    font-size: 1.8em;
}

fieldset {
    border: none;
    padding: 0;
}

legend {
    font-weight: bold;
    margin-bottom: 20px;
    color: #555;
    font-size: 1.1em;
}

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

input, select {
    width: 100%;
    padding: 12px;
    margin-bottom: 20px;
    border: 2px solid #e1e1e1;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
}

input:focus, select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Selector de código de país */
#countryCode {
    font-size: 15px;
    padding: 12px 8px;
    background: white;
    cursor: pointer;
}

#countryCode option {
    padding: 8px;
    font-size: 15px;
}

/* Validación de teléfono */
input[type="tel"]:invalid:not(:placeholder-shown) {
    border-color: #ef4444;
    background: #fef2f2;
}

input[type="tel"]:valid:not(:placeholder-shown) {
    border-color: #10b981;
    background: #f0fdf4;
}

input[type="tel"] + small,
#phoneHelp {
    display: block;
    margin-top: -15px;
    margin-bottom: 15px;
    color: #666;
    font-size: 0.9em;
}

/* Contenedor flex para país + teléfono */
div[style*="display: flex"] {
    align-items: flex-start;
}

div[style*="display: flex"] select,
div[style*="display: flex"] input {
    margin-bottom: 5px;
}

.submit-btn {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-loading {
    display: none;
}

/* Información adicional */
.info-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.info-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.info-card h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.info-card ul {
    list-style: none;
    padding-left: 0;
}

.info-card li {
    padding: 5px 0;
    border-bottom: 1px solid #eee;
}

.info-card li:before {
    content: "✓ ";
    color: #51cf66;
    font-weight: bold;
}

/* Pie de página */
.footer {
    text-align: center;
    color: white;
    opacity: 0.8;
    margin-top: 30px;
}

.footer a {
    color: white;
    text-decoration: none;
    font-weight: 600;
}

.footer a:hover {
    text-decoration: underline;
}

/* Estilos del panel de administrador */
.admin-container {
    min-height: 100vh;
    background: #f5f7fa;
}

.login-view {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #8b4513 0%, #8b4513 100%);
    padding: 20px;
}

.login-container {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 450px;
}

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

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

.login-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #555;
}

.login-button {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.login-info {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    text-align: center;
}

.error-message {
    color: #ff6b6b;
    text-align: center;
    margin-top: 15px;
    font-weight: 500;
}

/* Vista de administración */
.admin-view {
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.admin-header h1 {
    color: #333;
    margin: 0;
}

.admin-user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.logout-button {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%) !important;
    padding: 10px 20px !important;
    width: auto !important;
}

.logout-button:hover {
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4) !important;
}

/* Estadísticas */
.stats-section {
    margin-bottom: 30px;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card h3 {
    color: #666;
    margin-bottom: 15px;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-card p {
    font-size: 2.5em;
    font-weight: bold;
    margin: 0;
}

.stat-card.reservas-pendientes p { color: #FF9800; }
.stat-card.reservas-confirmadas p { color: #4CAF50; }
.stat-card.reservas-canceladas p { color: #f44336; }
.stat-card.total-reservas p { color: #2196F3; }

/* Secciones de administración */
.admin-section {
    background: white;
    padding: 25px;
    margin-bottom: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.admin-section h2 {
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

/* Filtros */
.admin-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.filter-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #555;
}

/* Controles de administración */
.admin-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

.admin-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.admin-button.danger {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
}

.admin-button.danger:hover {
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4);
}

/* Tablas */
.table-container {
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.reservations-table, .admin-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.reservations-table th, .reservations-table td,
.admin-table th, .admin-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.reservations-table th, .admin-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85em;
    letter-spacing: 1px;
}

.reservations-table tr:hover, .admin-table tr:hover {
    background: #f8f9fa;
}

.no-data {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 30px !important;
}

/* Botones de acción en tabla */
.action-button {
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
    color: white;
}

.confirm-button {
    background: #4CAF50;
}

.confirm-button:hover {
    background: #45a049;
    transform: scale(1.05);
}

.cancel-button {
    background: #ff9800;
}

.cancel-button:hover {
    background: #fb8c00;
    transform: scale(1.05);
}

.delete-button {
    background: #f44336;
}

.delete-button:hover {
    background: #e53935;
    transform: scale(1.05);
}

/* Formularios en admin */
.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    align-items: end;
}

.form-row input {
    flex: 1;
    min-width: 200px;
    margin-bottom: 0;
}

/* Notificaciones */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    min-width: 300px;
    padding: 15px;
    border-radius: 8px;
    animation: slideIn 0.5s ease;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.notification-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notification.info {
    background: #2196F3;
    color: white;
}

.notification.success {
    background: #4CAF50;
    color: white;
}

.notification.error {
    background: #f44336;
    color: white;
}

.notification button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 20px;
    margin-left: 10px;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes slideIn {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

/* Validación de formularios */
.form-validation {
    margin-bottom: 20px;
}

.validation-message {
    color: #ff6b6b;
    font-size: 14px;
    margin-top: 5px;
    display: none;
}

.validation-message.show {
    display: block;
}

/* Feedback messages */
.feedback {
    padding: 15px;
    margin: 15px 0;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
    border: 1px solid;
}

.feedback.error {
    background-color: #ffebee;
    color: #c62828;
    border-color: #ef5350;
}

.feedback.success {
    background-color: #e8f5e9;
    color: #2e7d32;
    border-color: #66bb6a;
}

.hidden {
    display: none !important;
}

/* Diseño de dos columnas para el panel de administrador */
.two-column-layout {
    display: grid;
    grid-template-columns: 35fr 65fr; /* Columna izquierda 35%, derecha 65% */
    gap: 20px;
    margin-bottom: 30px;
}

.left-column {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.right-column {
    position: sticky;
    top: 20px;
    align-self: start;
}

.calendar-section {
    height: fit-content;
}

.calendar-section h2 {
    margin-bottom: 15px;
}

#calendar {
    font-size: 1.05em; /* Aumentado un poco más */
}

/* Ajustar tamaño del calendario */
.fc {
    max-width: 100%;
}

.fc-daygrid-day {
    min-height: 100px !important; /* Altura mínima flexible */
}

.fc-daygrid-day-events {
    margin-bottom: 0 !important;
}

.fc-daygrid-event-harness {
    margin-top: 1px !important;
}

.fc-event {
    font-size: 0.85em; /* Aumentado de 0.8em a 0.85em */
    padding: 3px 5px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fc-toolbar-title {
    font-size: 1.6em !important; /* Título del calendario más grande */
}

.fc-col-header-cell {
    padding: 10px 5px !important;
}

.fc-daygrid-day-number {
    font-size: 1.15em; /* Números de día más grandes */
    padding: 8px;
}

/* Asegurar que todas las celdas se vean completamente */
.fc-scrollgrid {
    border: 1px solid #ddd !important;
}

.fc-theme-standard td, .fc-theme-standard th {
    border: 1px solid #ddd;
}

/* Hacer filtros y acciones más compactas */
.two-column-layout .admin-section {
    padding: 15px; /* Reducido de 25px a 15px */
}

.two-column-layout .admin-section h2 {
    font-size: 1.1em; /* Reducido el tamaño del título */
    margin-bottom: 12px; /* Reducido de 20px a 12px */
    padding-bottom: 8px; /* Reducido de 10px a 8px */
}

.two-column-layout .admin-filters {
    gap: 12px; /* Reducido de 20px a 12px */
    margin-bottom: 12px; /* Reducido de 20px a 12px */
}

.two-column-layout .filter-group label {
    margin-bottom: 3px; /* Reducido de 5px a 3px */
    font-size: 0.9em; /* Reducido el tamaño de fuente */
}

.two-column-layout .filter-group input,
.two-column-layout .filter-group select {
    padding: 8px; /* Reducido de 12px a 8px */
    margin-bottom: 0;
    font-size: 0.9em; /* Reducido el tamaño de fuente */
}

.two-column-layout .admin-controls {
    gap: 10px; /* Reducido de 15px a 10px */
    margin-bottom: 12px; /* Reducido de 20px a 12px */
}

.two-column-layout .admin-button {
    padding: 8px 15px; /* Reducido de 10px 20px a 8px 15px */
    font-size: 0.85em; /* Reducido el tamaño de fuente */
}

/* Responsive */
@media (max-width: 1200px) {
    .two-column-layout {
        grid-template-columns: 1fr;
    }
    
    .right-column {
        position: static;
    }
    
    /* Restaurar tamaños normales en móvil */
    .two-column-layout .admin-section {
        padding: 25px;
    }
    
    .two-column-layout .admin-section h2 {
        font-size: 1.3em;
        margin-bottom: 20px;
        padding-bottom: 10px;
    }
    
    .two-column-layout .filter-group label {
        margin-bottom: 5px;
        font-size: 1em;
    }
    
    .two-column-layout .filter-group input,
    .two-column-layout .filter-group select {
        padding: 12px;
        font-size: 1em;
    }
    
    .two-column-layout .admin-button {
        padding: 10px 20px;
        font-size: 1em;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .reservation-form {
        padding: 20px;
    }
    
    .admin-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .admin-user-info {
        flex-direction: column;
        width: 100%;
    }
    
    .admin-controls {
        justify-content: center;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .form-row input {
        min-width: unset;
    }
    
    .stats-row {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .admin-filters {
        grid-template-columns: 1fr;
    }
    
    .notification {
        left: 10px;
        right: 10px;
        min-width: unset;
    }

    .action-button {
        font-size: 11px;
        padding: 5px 8px;
    }
    
    .two-column-layout {
        grid-template-columns: 1fr;
    }
    
    .right-column {
        position: static;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 2em;
    }
    
    .reservation-form {
        padding: 15px;
    }
    
    .stat-card p {
        font-size: 2em;
    }
    
    .admin-section {
        padding: 15px;
    }

    .login-container {
        padding: 25px;
    }
}

/* Mejoras de accesibilidad */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Estados de carga */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Estilos para impresión */
@media print {
    .admin-header,
    .admin-controls,
    .admin-filters,
    .notification {
        display: none !important;
    }
    
    .admin-section {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .reservations-table th {
        background: #f5f5f5 !important;
        color: #333 !important;
    }

    .action-button {
        display: none !important;
    }
}