/* --- Fuentes y Colores Base --- */
:root {
    --color-azul: #007bff; /* Azul corporativo */
    --color-rojo: #DC3545; /* Rojo para limpiar/error */
    --color-gris-fondo: #E9ECEF; /* Gris claro para fondos de card */
    --color-gris-texto: #6c757d; /* Gris para texto secundario */
    --color-cielo: #87CEEB; /* Azul cielo sugerido */
}

/* --- GENERALES --- */
    body {
       font-family: 'Roboto', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
        background-color: #f4f7f6; /* Gris de fondo */
        margin: 0;
        padding: 0;
        color: #333;

    }

    input, button, select {
        font-family: inherit;
        border-radius: 8px;
        border: 1px solid #ccc;
        padding: 10px;
        font-size: 16px;
        box-sizing: border-box; /* Importante para padding */
    }

    button {
        cursor: pointer;
        font-weight: bold;
        color: white;
    }

/* --- Estilos del Login --- */

.firma {
    text-align: center;
    color: #007bff;
    font-size: 0.7rem;
}

/* NUEVO: Estilo para el Pie de Página */
.main-footer {
    background-color: #007bff;
    color: white;
    text-align: center;
    padding: 0.2rem;
    font-size: 0.9rem;
    width: 100%;
}

.main-footer a {
    color: var(--color-principal);
    text-decoration: none;
}

.main-footer a:hover {
    text-decoration: underline;
}

.main-footer p {
    line-height: 1.1; /* Puedes ajustar el valor según prefieras: 1, 1.1, 1.2 */
    margin: 0.2rem 0; /* Opcional: reduce el espacio vertical entre párrafos */
}

.login-card {
    width: 100%;
    max-width: 400px;
    padding: 2.5rem;
    border-radius: 15px;
    background-color: #ffffff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: none;
}

.login-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.5rem;
    color: var(--color-rojo);
}

.login-logo i {
    font-size: 3rem; /* Icono de corazón */
}

.login-title {
    text-align: center;
    font-weight: 700;
    margin-bottom: 2rem;
    color: #333;
}

.btn-azul {
    background-color: var(--color-azul);
    border-color: var(--color-azul);
    color: #fff;
    padding: 0.75rem 1rem;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.btn-azul:hover {
    background-color: #0056b3;
    border-color: #0056b3;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 123, 255, 0.3);
}

.btn-rojo {
    background-color: var(--color-rojo);
    border-color: var(--color-rojo);
    color: #fff;
    /*padding: 0.5rem 0.75rem;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.3s ease;*/
    padding: 0.75rem 1rem;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.btn-rojo:hover {
    background-color: #b02a37;
    border-color: #b02a37;
    color: #fff;
}

    /* --- LOGIN --- */
    .login-container {
        display: flex;
        justify-content: center;
        align-items: center;
        height: 100vh;
        background: linear-gradient(135deg, #007bff, #87CEEB); /* Azul corporativo y Azul Cielo */
    }

    .login-box {
        background: white;
        padding: 2.5rem;
        border-radius: 12px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.1);
        width: 350px;
        text-align: center;
    }

    .login-box h1 {
        color: #007bff;
        margin-top: 0;
        margin-bottom: 0.5rem;
        font-size: 1.5rem;
    }
    
    .login-box .logo-icon {
        font-size: 3rem;
        color: #DC3545; /* Rojo Corazón */
        line-height: 1;
        margin-bottom: 0.5rem;
    }

    .login-box p {
        margin-bottom: 1.5rem;
        color: #555;
    }

    .login-box form {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    .login-box input {
        width: 100%;
    }

    .login-box button {
        background-color: #007bff; /* Azul primario */
        border: none;
        padding: 12px;
        transition: background-color 0.2s;
    }

    .login-box button:hover {
        background-color: #0056b3;
    }

    .login-error {
        background-color: #f8d7da; /* Rojo pálido */
        color: #721c24; /* Rojo oscuro */
        border: 1px solid #f5c6cb;
        padding: 10px;
        border-radius: 8px;
        margin-top: 1rem;
        text-align: center;
    }

    /* --- DASHBOARD (Próximos pasos) --- */
    .navbar {
        background-color: #fff;
        padding: 1rem 2rem;
        box-shadow: 0 2px 10px rgba(0,0,0,0.05);
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    .navbar .logo {
        font-size: 1.5rem;
        font-weight: bold;
        color: #007bff;
    }
    .navbar .logo span {
        color: #DC3545;
    }
    .navbar nav a {
        margin-left: 1.5rem;
        text-decoration: none;
        color: #333;
        font-weight: 500;
        padding: 5px 0;
        border-bottom: 2px solid transparent;
    }
    .navbar nav a.active,
    .navbar nav a:hover {
        color: #007bff;
        border-bottom-color: #007bff;
    }
    .navbar a.logout-btn {
        background-color: #DC3545;
        color: white;
        padding: 8px 15px;
        border-radius: 8px;
        text-decoration: none;
        font-weight: bold;
    }
    .navbar a.logout-btn:hover {
        background-color: #c82333;
    }

    .main-content {
        padding: 2rem;
        max-width: 1400px;
        margin: 0 auto;
    }

       /* --- HEADER DEL CONTENIDO --- */
.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap; /* Para pantallas pequeñas */
    gap: 1rem;
}
.content-header h2 {
    margin: 0;
    font-size: 2rem;
    color: #333;
}
.controles-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.controles-header label {
    font-weight: 500;
    color: #555;
}
#fecha-visita {
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-size: 1rem;
}

/* --- BOTONES --- */
.btn-azul {
    /*background-color: var(--color-azul);
    color: #fff;
    /* AJUSTE: Eliminar margen inferior para que no empuje el grid */
    margin-bottom: 1rem; 
    margin-top: 1rem;
}
.btn-azul:hover {
    background-color: #0056b3;
}
.btn-azul:disabled {
    background-color: #a0a0a0;
    cursor: not-allowed;
}

.btn-rojo {
    margin-bottom: 1rem; 
    margin-top: 1rem;
}

/* Botones de Guardado (con feedback) */
.btn-success {
    background-color: #28a745; /* Verde */
}
.btn-error {
    background-color: #DC3545; /* Rojo */
}

/* Spinner de carga para botones */
.spinner-guardar {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}


/* --- GRID DE HABITACIONES --- */
.grid-habitaciones {
    display: grid;
    /* Crear columnas automáticas de ~350px, pero que se ajusten */
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

/* --- CARD DE HABITACIÓN --- */
.card-habitacion {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border: 1px solid #e0e0e0;
    overflow: hidden; /* Para que el header se vea bien */
    display: flex;
    flex-direction: column;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f9f9f9; /* Gris muy claro */
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
}
.card-header strong {
    font-size: 2.0rem;
    color: #007bff; /* Azul */
    font-weight: 700;
}

.btn-limpiar {
    background-color: #DC3545; /* Rojo */
    color: white;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
}
.btn-limpiar:hover {
    background-color: #c82333;
}

.card-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.card-body label {
    font-weight: 500;
    color: #444;
    margin-bottom: -8px; /* Acercar al input */
}
.card-body input[type="text"],
.card-body select[multiple] {
    width: 100%;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 10px;
}
.card-body select[multiple] {
    height: 100px; /* Altura para los select múltiples */
}

/* --- SKELETON LOADER (para la carga) --- */
.skeleton-loader-container {
    display: contents; /* Se comporta como parte del grid */
}
.skeleton-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border: 1px solid #e0e0e0;
    height: 320px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-pulse 1.5s infinite;
}
@keyframes skeleton-pulse {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* --- ------------------------------------------------------------------------------------------------------------------------------------------- --- */


/* --- Estilos del Panel Principal (index.php) --- */
.navbar-custom {
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #dee2e6;
}

.navbar-brand {
    font-weight: 700;
    color: var(--color-azul);
    font-size: 1.5rem;
}

.navbar-brand i {
    margin-right: 10px;
}

.nav-link {
    color: #555;
    font-weight: 500;
    margin: 0 0.5rem;
    padding: 0.5rem 1rem !important;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.nav-link.active {
    background-color: var(--color-azul);
    color: #fff;
}

.nav-link:hover {
    background-color: var(--color-gris-fondo);
    color: #000;
}

.user-info {
    color: var(--color-gris-texto);
}

.user-info i {
    color: var(--color-azul);
}

#main-content {
    padding: 2rem;
}

/* --- Estilos de las Cards de Habitación (Paso 3.2) --- */
.card-habitacion {
    margin-bottom: 1.5rem;
    height: calc(100% - 1.5rem); /* Para que todas tengan la misma altura */
}

.card-habitacion-header {
    background-color: var(--color-gris-fondo);
    padding: 0.2rem 1.25rem;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

.card-habitacion-header h5 {
    margin-bottom: 0;
    font-weight: 600;
    color: #333;
}

.card-habitacion-body {
    padding: 1.25rem;
    flex-grow: 1; /* Hace que el cuerpo crezca para llenar el espacio */
}

.card-habitacion-body .form-label {
    font-weight: 500;
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
    color: #555;
}

.card-habitacion-body .form-control {
    border-radius: 8px;
    margin-bottom: 1rem;
}

.selector-display {
    min-height: 40px;
    background-color: #f8f9fa;
    border: 1px solid #ced4da;
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    color: #495057;
    font-size: 0.9rem;
    line-height: 1.4;
    cursor: default;
    margin-bottom: 0.5rem;
}

.selector-display:empty::before {
    content: "Ninguno seleccionado";
    color: var(--color-gris-texto);
    font-style: italic;
}

/*.btn-seleccionar {
    width: 100%;
    background-color: #fff;
    border: 1px solid var(--color-azul);
    color: var(--color-azul);
    border-radius: 8px;
    transition: all 0.2s ease;
    margin-bottom: 1rem;
}

.btn-seleccionar:hover {
    background-color: var(--color-azul);
    color: #fff;
}*/


/* --- Estilos de la Ventana Modal (Paso 3.2) --- */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1040;
}

.modal-custom {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 600px; /* Ancho máximo */
    max-height: 80vh; /* Alto máximo */
    background-color: #fff;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    z-index: 1050;
    display: flex;
    flex-direction: column;
}

.modal-custom-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--color-gris-fondo);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-custom-title {
    margin-bottom: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.btn-close {
    border: none;
    background: transparent;
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1;
    color: #000;
    opacity: 0.5;
    cursor: pointer;
    padding: 0;
}
.btn-close:hover {
    opacity: 0.8;
}

.modal-custom-body {
    padding: 1.5rem;
    overflow-y: auto; /* Permite scroll si la lista es larga */
    flex-grow: 1;
}

.modal-checklist-contenedor {
    display: block;
    max-height: calc(80vh - 250px); /* Altura dinámica */
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
}

.modal-checklist-item {
    display: block; /* Uno por línea */
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.modal-checklist-item:hover {
    background-color: #f4f4f4;
}

.modal-checklist-item input {
    margin-right: 12px;
    cursor: pointer;
}

.modal-checklist-item label {
    cursor: pointer;
    user-select: none; /* Evita que el texto se seleccione */
    width: calc(100% - 25px); /* Ajusta para que el texto no se desborde */
}

.modal-custom-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--color-gris-fondo);
    display: flex;
    justify-content: flex-end; /* Botones a la derecha */
}

.modal-custom-footer .btn {
    margin-left: 0.5rem;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
}

/* --- ESTILOS DE BOTONES SOLICITADOS --- */
.btn-seleccionar {
    background-color: #007bff; /* Azul primario */
    color: white;
    border: none;
    padding: 6px 10px;
    font-size: 14px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    width: 100%;
    margin-top: -5px; /* Sube el botón */
}

.btn-seleccionar:hover {
    background-color: #0056b3; /* Azul más oscuro */
}

/* --- Estilos Ventana Modal --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6); /* Fondo oscuro semitransparente */
    display: none; /* Oculto por defecto */
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-contenido {
    background-color: #ffffff;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e9ecef;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto; /* Scroll si la lista es larga */
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal-body .input-buscar {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    border: 1px solid #ced4da;
    border-radius: 5px;
    box-sizing: border-box;
}

.modal-lista-items {
    max-height: 400px; /* Altura máxima de la lista */
    overflow-y: auto;
    border: 1px solid #e9ecef;
    border-radius: 5px;
}

.modal-lista-items label {
    display: block;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f8f9fa;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-size: 0.95rem;
}

.modal-lista-items label:last-child {
    border-bottom: none;
}

.modal-lista-items label:hover {
    background-color: #f8f9fa;
}

.modal-lista-items input[type="checkbox"] {
    margin-right: 0.75rem;
    transform: scale(1.1); /* Checkbox un poco más grande */
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    background-color: #f8f9fa;
}

.btn-modal-accion {
    padding: 0.6rem 1.25rem;
    border: none;
    border-radius: 5px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

/*#btn-modal-aceptar {
    background-color: #007bff; 
    color: white;
} 
*/

#btn-modal-aceptar:hover {
    background-color: #0056b3;
}
/*
#btn-modal-cancelar {
    background-color: #DC3545 !important; 
    color: white;
}
*/
#btn-modal-cancelar:hover {
    background-color: #c82333;
}

/* --- SOLUCIÓN PARA BOTONES DEL MODAL --- */

/* 2. Botón Aceptar (Azul, ya funcionaba con .btn-azul) */
#btn-modal-aceptar {
    background-color: var(--color-azul) !important;
    color: white !important;
}

.modal-footer button.btn-base {
    padding: 0.6rem 1.25rem;
    font-size: 0.9rem;
}

/* Ajuste de tamaño y color para los botones del footer del modal */
.modal-footer button {
    padding: 0.4rem 1rem; /* Botones más pequeños y compactos */
    font-size: 0.9rem;
}

#btn-modal-cancelar {
    background-color: var(--color-rojo) !important; /* ROJO */
    color: white !important;
}


/* -------------------------------------------------------------------------- */
/* RESPONSIVIDAD                               */
/* -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .navbar-custom {
        flex-direction: column;
        gap: 10px;
    }
    .navbar nav {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }
    .content-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .controles-header {
        width: 100%;
        justify-content: space-between;
    }
    .modal-contenido {
        width: 95%;
    }
}