/* BASE */
body { font-family: 'Segoe UI', sans-serif; background: #eaeff2; margin: 0; padding-bottom: 50px; text-align: center; color: #333; }
* { box-sizing: border-box; }

/* HEADER */
header { background: white; padding: 15px 30px; box-shadow: 0 2px 5px rgba(0,0,0,0.05); display: flex; justify-content: space-between; align-items: center; max-width: 1200px; margin: 0 auto; }

.admin-switch { font-weight: bold; cursor: pointer; display: flex; align-items: center; gap: 8px; background: #E3F2FD; padding: 8px 15px; border-radius: 20px; border: 1px solid #2196F3; color: #1565C0; user-select: none; }

/* PANEL ADMIN (Simplificado) */
#admin-panel {
    display: none; /* Se activa con JS */
    background: white;
    padding: 25px;
    margin: 30px auto;
    max-width: 900px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border-top: 5px solid #4CAF50;
    text-align: left;
}

h3 { margin-top: 0; border-bottom: 1px solid #eee; padding-bottom: 10px; font-size: 1.2em; color: #444; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; align-items: flex-end; }
.full-row { grid-column: span 3; }

label { display: block; font-size: 0.85em; font-weight: bold; margin-bottom: 5px; color: #555; }
input, select { width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 5px; outline: none; }
input:focus { border-color: #2196F3; }

/* BOTONES ADMIN */
.action-bar { margin-top: 25px; display: flex; gap: 15px; }
button.action-btn { flex: 1; padding: 12px; border: none; border-radius: 5px; cursor: pointer; font-weight: bold; color: white; font-size: 1em;
background: #4CAF50; }

/* MAPA Y TARJETAS */
#hotel-map { display: flex; flex-wrap: wrap; justify-content: center; gap: 20px; max-width: 1200px; margin: 40px auto; padding: 0 20px; }

.room
{   background-color: white;
    width: 180px;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    position: relative;
    transition: transform 0.2s;
    border-bottom: 6px solid #ccc;
}
.room:hover { transform: translateY(-5px); box-shadow: 0 5px 15px rgba(0,0,0,0.1); }
.room h2 { margin: 5px 0; font-size: 1.8em; color: #444; }

.available { border-bottom-color: #4CAF50; }
.occupied { border-bottom-color: #F44336; background-color: #ffebee; }

.card-controls { position: absolute; top: 5px; right: 5px; display: none; gap: 3px; }
.btn-mini { padding: 4px 8px; border: none; border-radius: 3px; cursor: pointer; font-size: 11px; color: white; }

/* MODAL */
#modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); display: none; justify-content: center; align-items: center; z-index: 1000; }
.modal-content { background: white; padding: 30px; border-radius: 12px; width: 400px; text-align: left; box-shadow: 0 10px 25px rgba(0,0,0,0.3); }
.hidden { display: none; }

/* DESCUENTO BOX */
.discount-box { flex: 1.5; background: #f9f9f9; padding: 8px; border-radius: 5px; border: 1px solid #e0e0e0; }

button.main-btn { width: 100%; padding: 12px; margin-top: 15px; border: none; border-radius: 5px; color: white; font-weight: bold; cursor: pointer; }

/* LOADER */
#full-screen-loader {
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9); /* Fondo blanco casi sólido */
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 99999; /* Muy alto para tapar todo */
    display: flex; 
    flex-direction: column;
    justify-content: center; 
    align-items: center; 
    transition: opacity 0.3s ease;
}

.spinner {
    width: 50px; 
    height: 50px; 
    border-radius: 50%; 
    position: relative;
    animation: rotate 1s linear infinite;
}

/* Círculos animados */
.spinner::before, .spinner::after {
    content: ""; 
    box-sizing: border-box; 
    position: absolute; 
    inset: 0px;
    border-radius: 50%; 
    border: 5px solid transparent; /* Transparente para que gire bonito */
    animation: prixClipFix 2s linear infinite;
}

.spinner::before { 
    border-color: #2196F3; /* Color Azul */
    z-index: 1; 
}

.spinner::after { 
    border-color: #FF9800; /* Color Naranja */
    animation: prixClipFix 2s linear infinite reverse; 
    transform: rotate(90deg); 
}

#loader-text { 
    margin-top: 15px; 
    font-weight: 600; 
    color: #555; 
    letter-spacing: 1px; 
    animation: pulse 1.5s infinite; 
}

/* Animaciones Keyframes */
@keyframes rotate { 
    0% {transform: rotate(0deg)} 
    100% {transform: rotate(360deg)} 
}

@keyframes prixClipFix {
    0% {clip-path:polygon(50% 50%,0 0,0 0,0 0,0 0,0 0)}
    50% {clip-path:polygon(50% 50%,0 0,100% 0,100% 100%,100% 100%,100% 100%)}
    100% {clip-path:polygon(50% 50%,0 0,100% 0,100% 100%,0 100%,0 0)}
}

@keyframes pulse { 
    0% { opacity: 1; }
    50% { opacity: 0.6; }
    100% { opacity: 1; }
}
/* --- ESTILOS DE LA INFORMACIÓN DEL HUÉSPED EN TARJETA --- */
.guest-details-box {
    margin-top: 8px;
    background-color: #FFF8E1; /* Fondo amarillento suave */
    border: 1px solid #FFE0B2;
    border-radius: 5px;
    padding: 6px;
    text-align: left;
    font-size: 0.8em;
}

.guest-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2px;
}

.guest-label { color: #F57C00; font-weight: bold; font-size: 0.9em;}
.guest-val { color: #333; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 90px; }

/* BADGES (Etiquetas de colores) */
.badges-container {
    display: flex;
    gap: 4px;
    margin-top: 4px;
    justify-content: center;
}

.badge {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: bold;
    color: white;
}

.badge-count { background-color: #78909c; } /* Gris azulado para personas */
.badge-traveler { background-color: #7B1FA2; } /* Violeta para Viajante */
.badge-discount { background-color: #2E7D32; } /* Verde para descuento */
/* --- NUEVOS ESTILOS PARA LA TARJETA DE HABITACIÓN OCUPADA --- */

/* Ajuste para que la tarjeta ocupada tenga el fondo rosado como en la referencia */
.room.occupied {
    width: 33%;
    background-color: #ffebee; /* Fondo rosado claro */
    border-bottom: 4px solid #D32F2F; /* Línea roja inferior */
}

/* Contenedor (Caja) para la información del cliente */
.client-info-box {
    background-color: #fff3e0; /* Fondo beige claro */
    border: 1px solid #ffe0b2; /* Borde beige */
    border-radius: 8px; /* Bordes redondeados */
    padding: 10px 12px;
    margin-top: 12px;
    text-align: left; /* Texto alineado a la izquierda */
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* Estilo para cada línea de información dentro de la caja */
.client-info-box p {
    margin: 6px 0;
    color: #333;
    font-size: 0.95em;
    display: flex;
    align-items: center; /* Alinear icono y texto verticalmente */
}

/* Iconos (👤 y 📄) */
.client-icon {
    margin-right: 8px;
    font-size: 1.1em;
}

/* Etiquetas Específicas */
.label-cliente {
    color: #C62828; /* Rojo intenso para "Cliente:" */
    font-weight: bold;
    margin-right: 6px;
}

.label-dni {
    color: #EF6C00; /* Naranja intenso para "DNI:" */
    font-weight: bold;
    margin-right: 6px;
}

/* Datos del cliente (Nombre, DNI) */
.client-data {
    font-weight: 500;
    color: #555;
    white-space: nowrap; /* Evita que el texto se rompa en dos líneas */
    overflow: hidden;
    text-overflow: ellipsis; /* Puntos suspensivos si es muy largo */
}
/* ETIQUETA DE VIAJANTE EN LA TARJETA */
.tag-viajante {
    display: inline-block;
    background-color: #7B1FA2; /* Violeta */
    color: white;
    font-size: 0.7em;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 5px;
    vertical-align: middle;
    text-transform: uppercase;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
/* ESTILOS TABLA HISTORIAL */
/* --- SECCIÓN HISTORIAL FIJA (ABAJO) --- */
/* --- ESTILOS DE LA TABLA DE HISTORIAL --- */
.history-section-fixed {
    background: white;
    max-width: 1200px;
    margin: 40px auto;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
    border-top: 5px solid #607D8B; /* Color Gris Azulado */
    text-align: left;
}

.history-table-container {
    max-height: 350px; /* Scroll si hay muchas reservas */
    overflow-y: auto;
    border: 1px solid #eee;
    border-radius: 5px;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px; /* Para que no se rompa en celular */
}

.history-table th {
    background-color: #ECEFF1;
    color: #455A64;
    padding: 12px;
    text-align: left;
    position: sticky; top: 0; /* Cabecera fija */
    font-size: 0.85em;
    text-transform: uppercase;
}

.history-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.9em;
    color: #333;
}

.history-table tr:nth-child(even) { background-color: #fafafa; }
.history-table tr:hover { background-color: #e3f2fd; }