/* =========================================
   1. RESET Y VARIABLES BÁSICAS
========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* El overflow-x hidden aquí es la MAGIA que evita el zoom raro y el hueco gris a la derecha */
html, body {
    overflow-x: hidden; 
    width: 100%;
}

body {
    background-color: #121212;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
}

/* =========================================
   2. HEADER Y NAVEGACIÓN
========================================= */
header {
    background-color: #000000;
    padding: 1.5rem 2rem;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    border-bottom: 2px solid #d4af37;
    position: relative;
    z-index: 100;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    color: #d4af37;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.nav-center {
    display: flex;
    justify-content: center;
}

nav a {
    color: #ffffff;
    text-decoration: none;
    margin: 0 1rem;
    font-size: 1.1rem;
    transition: color 0.3s ease;
}

nav a:hover, nav a.active {
    color: #d4af37;
}

.header-right {
    display: flex;
    justify-content: flex-end;
}

.profile-icon {
    color: #ffffff;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
}

.profile-icon:hover, .profile-icon.active {
    color: #d4af37;
}

/* =========================================
   3. SECCIONES GLOBALES (HERO Y CONTENEDOR)
========================================= */
.hero {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    height: 80vh;
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url('https://images.unsplash.com/photo-1585747860715-2ba37e788b70?ixlib=rb-1.2.1&auto=format&fit=crop&w=1920&q=80') center/cover;
}

.hero-content h1 {
    font-size: 3.5rem;
    color: #d4af37;
    margin-bottom: 1rem;
    padding: 0 1rem;
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: #cccccc;
    padding: 0 1rem;
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 3rem auto;
    padding: 2.5rem;
    background-color: #1e1e1e;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

.container h2 {
    color: #d4af37;
    margin-bottom: 1.5rem;
    text-align: center;
}

.container p {
    text-align: center;
    margin-bottom: 2.5rem;
    color: #cccccc;
    line-height: 1.6;
}

/* =========================================
   4. BOTONES Y FORMULARIOS
========================================= */
.btn {
    display: inline-block;
    background-color: #d4af37;
    color: #000000;
    padding: 0.8rem 2rem;
    text-decoration: none;
    font-weight: bold;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.btn:hover {
    background-color: #f1c40f;
    transform: translateY(-2px);
}

form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    text-align: left;
}

label {
    margin-bottom: 0.5rem;
    color: #d4af37;
}

input, select {
    padding: 0.8rem;
    border: 1px solid #333;
    background-color: #2a2a2a;
    color: #fff;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

input:focus, select:focus {
    outline: none;
    border-color: #d4af37;
}

/* =========================================
   5. PANEL ADMIN Y LISTAS
========================================= */
.dashboard-section {
    background-color: #2a2a2a;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: left;
}

.dashboard-section h3 {
    color: #d4af37;
    margin-bottom: 1rem;
    border-bottom: 1px solid #444;
    padding-bottom: 0.5rem;
}

.appointment-list {
    list-style: none;
    padding: 0;
}

.appointment-list li {
    background: #1e1e1e;
    padding: 1rem;
    margin-bottom: 0.5rem;
    border-left: 4px solid #d4af37;
    border-radius: 4px;
}

.table-container {
    overflow-x: auto;
    margin-top: 1.5rem;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    min-width: 600px; /* Evita que la tabla colapse muy feo en móviles */
}

.admin-table th, .admin-table td {
    padding: 1rem;
    border-bottom: 1px solid #333;
}

.admin-table th {
    background-color: #2a2a2a;
    color: #d4af37;
}

.admin-table tr:hover {
    background-color: #222;
}

.admin-nav {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #333;
    justify-content: center;
    flex-wrap: wrap; /* Para que en móviles caigan en dos líneas si no caben */
}

.admin-tab {
    background: none;
    border: none;
    color: #888;
    font-size: 1.1rem;
    font-weight: bold;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.admin-tab:hover {
    color: #fff;
}

.admin-tab.active {
    color: #d4af37;
    border-bottom: 2px solid #d4af37;
    margin-bottom: -2px;
}

.admin-content {
    display: none;
}

.admin-content.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

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

/* =========================================
   6. RESERVAS A 2 COLUMNAS
========================================= */
.booking-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 1rem;
    align-items: stretch;
}

/* =========================================
   7. CALENDARIO PREMIUM
========================================= */
.calendar-wrapper {
    background-color: #2a2a2a;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 1.5rem;
    min-height: 320px;
    height: 100%;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.calendar-header button {
    background: none;
    border: none;
    color: #d4af37;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 10px;
    transition: transform 0.2s ease;
}

.calendar-header button:hover {
    transform: scale(1.2);
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-weight: bold;
    color: #888;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}

.cal-day {
    aspect-ratio: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: bold;
    transition: all 0.2s ease;
}

.cal-day.available {
    background-color: rgba(212, 175, 55, 0.1);
    color: #d4af37;
    border: 1px solid rgba(212, 175, 55, 0.3);
    cursor: pointer;
}

.cal-day.available:hover {
    background-color: #d4af37;
    color: #000;
}

.cal-day.selected {
    background-color: #d4af37 !important;
    color: #000 !important;
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

.cal-day.unavailable {
    color: rgba(212, 175, 55, 0.3);
    background-color: transparent;
    cursor: not-allowed;
    position: relative;
}

.cal-day.unavailable::before, .cal-day.unavailable::after {
    content: '';
    position: absolute;
    width: 70%;
    height: 1px;
    background-color: rgba(212, 175, 55, 0.4);
    top: 50%;
    left: 15%;
}

.cal-day.unavailable::before { transform: rotate(45deg); }
.cal-day.unavailable::after { transform: rotate(-45deg); }

/* =========================================
   8. RECUADRO DE HORAS (GRID)
========================================= */
.time-slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 10px;
    background-color: #2a2a2a;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 1.5rem;
    min-height: 320px;
    align-content: start;
}

.time-slot {
    padding: 0.8rem 0;
    text-align: center;
    border: 1px solid #d4af37;
    border-radius: 4px;
    color: #d4af37;
    background-color: rgba(212, 175, 55, 0.05);
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s ease;
}

.time-slot.available:hover {
    background-color: #d4af37;
    color: #000;
}

.time-slot.selected {
    background-color: #d4af37 !important;
    color: #000 !important;
    transform: scale(1.05);
}

.time-slot.unavailable {
    color: rgba(212, 175, 55, 0.3);
    border-color: rgba(212, 175, 55, 0.2);
    background-color: transparent;
    cursor: not-allowed;
    position: relative;
    overflow: hidden;
}

.time-slot.unavailable::before {
    content: '';
    position: absolute;
    width: 120%;
    height: 1px;
    background-color: rgba(212, 175, 55, 0.3);
    top: 50%;
    left: -10%;
    transform: rotate(15deg);
}

/* =========================================
   9. FOOTER
========================================= */
footer {
    background-color: #000000;
    text-align: center;
    padding: 1.5rem;
    border-top: 1px solid #333;
    margin-top: auto;
}

/* =========================================
   10. RESPONSIVE Y MENÚ MÓVIL (HAMBURGUESA)
========================================= */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    z-index: 1000; /* Siempre encima del menú lateral */
}

.hamburger span {
    width: 30px;
    height: 3px;
    background-color: #d4af37;
    border-radius: 3px;
    transition: all 0.3s ease;
}

/* Animación del icono Hamburguesa al abrirse */
.hamburger.open span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}
.hamburger.open span:nth-child(2) {
    opacity: 0;
}
.hamburger.open span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

.mobile-only {
    display: none;
}

/* === REGLAS PARA MÓVIL (Pantallas menores a 768px) === */
@media (max-width: 768px) {
    header {
        grid-template-columns: auto auto; /* Solo Logo y Hamburguesa */
        justify-content: space-between;
        padding: 1.2rem 1.5rem;
    }

    .header-right { 
        display: none; 
    } 

    .hamburger { 
        display: flex; 
    }

    /* El menú lateral ahora tiene position: fixed para evitar saltos y se esconde completamente */
    .nav-center {
        position: fixed;
        top: 0;
        right: -100%;
        flex-direction: column;
        background-color: #000000;
        width: 250px;
        height: 100vh;
        padding-top: 5rem;
        padding-left: 2rem;
        padding-right: 2rem;
        transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        border-left: 2px solid #d4af37;
        z-index: 999;
        box-shadow: -10px 0 20px rgba(0,0,0,0.8);
    }

    .nav-center.active { 
        right: 0; 
    }

    nav a { 
        margin: 1.5rem 0; 
        font-size: 1.3rem; 
        border-bottom: 1px solid #222;
        padding-bottom: 0.5rem;
        width: 100%;
        display: block;
    }

    .mobile-only { 
        display: block; 
        color: #d4af37;
    }

    /* Ajustes de espacio y márgenes para móviles */
    .hero-content h1 { 
        font-size: 2.2rem; 
    }
    
    .container { 
        margin: 2rem 1rem; /* Más espacio a los lados de la pantalla */
        padding: 2rem 1.5rem; /* Más respiro para el texto interno */
    }

    .booking-grid { 
        grid-template-columns: 1fr; 
        gap: 1.5rem; 
    }
    
    .calendar-days { 
        gap: 2px; 
    }
    
    .cal-day { 
        font-size: 0.95rem; 
    }
    
    .calendar-wrapper, .time-slots-grid {
        padding: 1rem;
    }
}

/* Para que el calendario del admin no sea gigante pero sí legible */
.admin-content .calendar-wrapper {
    max-width: 450px;
    margin: 0 auto;
}