/* --- Reset y Estructura Base --- */

html,
body {
    width: 100%;
    height: 100%;
    /* Obligatorio para controlar el scroll */
    margin: 0;
    padding: 0;
    overflow: hidden;
    /* Evita el scroll de la ventana principal */
    background-color: #f8f9fa;
}


/* Fusión de #wrapper: Crucial para que el Sidebar esté al lado del contenido */

#wrapper {
    display: flex !important;
    width: 100% !important;
    height: 100vh;
    /* Altura fija al tamaño de la pantalla */
    overflow: hidden;
}


/* --- SIDEBAR --- */

#sidebar-wrapper {
    width: 250px;
    height: 100vh;
    /* Altura total de la pantalla */
    background-color: #2c3e50;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    /* Alinea hijos verticalmente */
    overflow: hidden;
    /* Evita que el contenedor padre scrollee */
    transition: all 0.3s ease-in-out;
    z-index: 1050;
}

#sidebar-wrapper::-webkit-scrollbar {
    width: 6px;
}

#sidebar-wrapper::-webkit-scrollbar-track {
    background: #1a252f;
}

#sidebar-wrapper::-webkit-scrollbar-thumb {
    background: #34495e;
    border-radius: 10px;
}

#sidebar-wrapper::-webkit-scrollbar-thumb:hover {
    background: #3498db;
}

#sidebar-wrapper .sidebar-heading {
    padding: 1.5rem 1.25rem;
    background-color: #1a252f;
    /* Fondo oscuro */
    color: white;
    /* <--- CRUCIAL: Para que el icono sea visible */
    text-align: center;
    /* Centra el icono y el h4 */
    flex-shrink: 0;
    /* Mantiene el tamaño fijo arriba */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#sidebar-wrapper .sidebar-heading span.material-icons {
    display: block;
    /* Para que respete mejor el centrado */
    margin-bottom: 0.5rem;
}

#sidebar-wrapper .list-group {
    flex-grow: 1;
    /* Ocupa todo el espacio restante */
    overflow-y: auto;
    /* Activa el scroll solo aquí */
    display: block;
    /* Asegura comportamiento de bloque para los links */
}

#sidebar-wrapper .list-group::-webkit-scrollbar {
    width: 5px;
}

#sidebar-wrapper .list-group::-webkit-scrollbar-track {
    background: transparent;
}

#sidebar-wrapper .list-group::-webkit-scrollbar-thumb {
    background: #34495e;
    border-radius: 10px;
}

#sidebar-wrapper .list-group::-webkit-scrollbar-thumb:hover {
    background: #3498db;
}

.sidebar-label {
    padding: 1.5rem 1rem 0.5rem;
    /* Ajustado para que no sea tan ancho */
    font-size: 0.75rem;
    font-weight: bold;
    color: #dddddd !important;
    text-transform: uppercase;
    display: block;
    /* Para que el padding funcione correctamente */
}

#sidebar-wrapper .sidebar-label {
    color: #dddddd !important;
}

.login-body {
    overflow: auto !important;
    /* Permite scroll normal en el login si es necesario */
}


/* --- CONTENIDO --- */

#page-content-wrapper {
    flex-grow: 1;
    height: 100vh;
    /* Ocupa toda la altura */
    overflow-y: auto;
    /* El contenido tendrá su propio scroll */
    background-color: #f8f9fa;
    display: flex;
    flex-direction: column;
}


/* Ajuste de tarjetas de habitación */

.card-habitacion {
    min-height: 160px;
    /* Asegura altura uniforme */
    transition: transform 0.2s;
    overflow: hidden;
    /* Evita que el contenido se salga */
}

.card-habitacion:hover {
    transform: scale(1.02);
}

.card-habitacion h2 {
    font-size: 2.5rem;
    /* Número de habitación más equilibrado */
}


/* Badge de tiempo cumplido / extra */

.badge-tiempo {
    white-space: normal;
    /* Permite que el texto salte de línea si es necesario */
    line-height: 1.2;
    padding: 8px 4px !important;
    font-size: 0.85rem !important;
    border-radius: 8px;
    display: block;
    width: 100%;
}

.timer-display {
    min-height: 45px;
    /* Espacio reservado para el reloj */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}


/* Ajuste de columnas para que no sean tan estrechas en móviles pequeños */

@media (max-width: 400px) {
    .col-6 {
        width: 100% !important;
        /* Una sola columna en pantallas muy pequeñas */
    }
}


/* --- LOGICA RESPONSIVA (MOBILE) --- */

@media (max-width: 991.98px) {
    #sidebar-wrapper {
        position: fixed;
        left: -250px;
        /* Escondido a la izquierda */
    }
    /* Esta es la regla que activa el botón hamburguesa */
    #wrapper.toggled #sidebar-wrapper {
        left: 0 !important;
    }
}


/* --- LOGICA RESPONSIVA (DESKTOP) --- */

@media (min-width: 992px) {
    #sidebar-wrapper {
        margin-left: 0;
    }
    /* Si quieres esconderlo en PC también al dar click */
    #wrapper.toggled #sidebar-wrapper {
        margin-left: -250px;
    }
}


/* Estilos de botones de menú */

.list-group-item {
    background: transparent !important;
    color: #bdc3c7 !important;
    border: none !important;
    padding: 1rem 1.5rem !important;
    display: flex;
    align-items: center;
}

.list-group-item i {
    margin-right: 12px;
}

.list-group-item:hover {
    background-color: #34495e !important;
    color: #fff !important;
}

.list-group-item.active {
    background-color: #3498db !important;
    color: #fff !important;
    border-left: 5px solid #fff !important;
}


/* --- SPLASH SCREEN --- */

#splash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #2c3e50;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.8s ease;
    color: white;
}

.loader {
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes pulse-danger {
    0% {
        background-color: #dc3545;
    }
    50% {
        background-color: #842029;
    }
    100% {
        background-color: #dc3545;
    }
}

@keyframes pulse-red {
    0% {
        background-color: #dc3545;
    }
    /* Rojo original */
    50% {
        background-color: #8b0000;
    }
    /* Rojo oscuro */
    100% {
        background-color: #dc3545;
    }
}

.pulse-danger {
    animation: pulse-red 1.5s infinite;
}