/* ---------- RESET ---------- */
* { margin:0; padding:0; box-sizing:border-box; }
body {
    font-family: Arial, sans-serif;
    background: #f5f5f5;
    color: #333;
}
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}
h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 10px;
}
.precio {
    text-align: center;
    font-size: 18px;
    margin-bottom: 20px;
    color: #27ae60;
}

/* ---------- NAVEGACIÓN ---------- */
.navegacion-fecha {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}
.btn-nav {
    padding: 8px 16px;
    background: #34495e;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
}
.btn-nav:hover { background: #2c3e50; }
.fecha-titulo {
    font-size: 18px;
    font-weight: bold;
    color: #2c3e50;
    min-width: 200px;
    text-align: center;
}

/* ---------- SEMANA ---------- */
.semana-container {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,.1);
    overflow-x: auto;
}
.semana-header {
    display: grid;
    grid-template-columns: 80px repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 10px;
}
.dia-header {
    background: #34495e;
    color: white;
    padding: 10px 5px;
    text-align: center;
    border-radius: 5px;
}
.dia-nombre { font-weight: bold; font-size: 14px; }
.dia-fecha { font-size: 12px; opacity: .9; }

.semana-body {
    display: flex;
}
.hora-columna-horas {
    width: 80px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.hora-etiqueta {
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ecf0f1;
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
    color: #7f8c8d;
}
.semana-dias-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    flex: 1;
}
.dia-columna {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.hora-casilla-semana {
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
    transition: all .2s ease;
}
.hora-casilla-semana.disponible {
    background: #27ae60;
    color: white;
}
.hora-casilla-semana.disponible:hover {
    background: #229954;
    transform: scale(1.05);
}

.hora-casilla-semana.caducada {
    background: #95a5a6;
    color: white;
    cursor: not-allowed;
    opacity: .6;
}

/* ---------- MODAL ---------- */
.modal-oculto { display: none; }
#modal-reserva {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,.5);
}
.modal-contenido {
    background: #fff;
    margin: 5% auto;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 5px 15px rgba(0,0,0,.3);
    position: relative;
}
.modal-cerrar {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    cursor: pointer;
    color: #999;
}
.modal-cerrar:hover { color: #000; }

/* ---------- FORMULARIO DENTRO DEL MODAL ---------- */
#form-reserva .form-group {
    margin-bottom: 15px;
}
#form-reserva label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #2c3e50;
}
#form-reserva input {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}
#form-reserva input:focus {
    outline: none;
    border-color: #3498db;
}
.btn-reservar {
    width: 100%;
    padding: 15px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: background .3s ease;
}
.btn-reservar:hover { background: #2980b9; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 768px) {
    .semana-header { grid-template-columns: 60px repeat(7, 1fr); }
    .hora-columna-horas { width: 60px; }
    .hora-etiqueta, .hora-casilla-semana { height: 35px; font-size: 10px; }
}
@media (max-width: 480px) {
    .navegacion-fecha { flex-direction: column; gap: 10px; }
    .fecha-titulo { font-size: 16px; }
}
/* 1. Celda más ancha en escritorio */
.hora-casilla-semana {
    min-width: 90px;          /* antes 80px aprox */
    font-size: 10px;          /* ligeramente más pequeño */
    white-space: nowrap;      /* evita salto de línea */
}

/* 2. Fila de horas (etiqueta) igual de ancha */
.hora-etiqueta {
    min-width: 90px;
    font-size: 11px;
}

/* 3. En móviles se reducen un poco más */
@media (max-width: 768px) {
    .hora-casilla-semana,
    .hora-etiqueta {
        min-width: 70px;
        font-size: 9px;
    }
}
/* ---------- POP-UP MODAL ---------- */
.modal-oculto        { display: none; }
#modal-reserva       { position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; background: rgba(0,0,0,.5); }
.modal-contenido     { background: #fff; margin: 5% auto; padding: 30px; border-radius: 10px; width: 90%; max-width: 500px; box-shadow: 0 5px 15px rgba(0,0,0,.3); position: relative; }
.modal-cerrar        { position: absolute; top: 10px; right: 15px; font-size: 28px; cursor: pointer; color: #999; }
.modal-cerrar:hover  { color: #000; }


/* Asegura que el modal de confirmación esté encima */
#modal-reserva-exitosa {
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,.5);
}


/* Reserva de usuario */
.hora-casilla-semana.reservada {
    background: #e74c3c;
    color: white;
    cursor: not-allowed;
}

/* Reserva de administrador */
.hora-casilla-semana.reservada-admin {
    background: #e67e22;
    color: white;
    cursor: not-allowed;
}

.hora-casilla-semana.reservada,
.hora-casilla-semana.reservada-admin {
    font-size: 9px;
    line-height: 1.1;
    white-space: pre-line;
    text-align: center;
    padding: 2px;
}
/* Reserva de usuario */
.hora-casilla-semana.reservada {
    background: #e74c3c;
    color: white;
    cursor: not-allowed;
    font-size: 9px;
    line-height: 1.1;
    text-align: center;
    padding: 2px;
}

/* Reserva de administrador */
.hora-casilla-semana.reservada-admin {
    background: #e67e22;
    color: white;
    cursor: not-allowed;
    font-size: 9px;
    line-height: 1.1;
    text-align: center;
    padding: 2px;
}
/* Reserva de clase (profesor) */
.hora-casilla-semana.reservada-admin {
    background: #e67e22 !important;
    color: #fff;
    cursor: not-allowed;
    font-size: 9px;
    line-height: 1.1;
    text-align: center;
    padding: 2px;
}