/* ==================================
   VARIABLES CSS INSTITUCIONALES
===================================== */
:root {
    --primary-color: #0b3d91;
    /* Azul institucional */
    --secondary-color: #2e7d32;
    /* Verde salud pública */
    --accent-color: #43a047;
    --bg-color: #f7f9fc;
    --text-color: #333333;
    --navbar-bg: #ffffff;
    --transition-speed: 0.3s;
}

/* ==================================
   RESETEOS Y ESTRUCTURA GENERAL
===================================== */
body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ==================================
   NAVBAR Y NAVEGACIÓN
===================================== */
.navbar {
    background-color: var(--navbar-bg);
    transition: all var(--transition-speed) ease;
    border-bottom: 2px solid var(--secondary-color);
}

.navbar-brand .text-primary {
    color: var(--primary-color) !important;
}

.navbar-brand .text-success {
    color: var(--secondary-color) !important;
}

.nav-link {
    font-weight: 500;
    color: #555;
    padding: 0.5rem 1rem;
    transition: color var(--transition-speed) ease, background-color var(--transition-speed) ease;
    border-radius: 4px;
    margin: 0 0.2rem;
}

.nav-link:hover {
    color: var(--primary-color);
    background-color: rgba(11, 61, 145, 0.05);
}

.nav-link.active {
    color: var(--primary-color) !important;
    font-weight: 600;
    position: relative;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0px;
    left: 10%;
    width: 80%;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 3px 3px 0 0;
}

/* ==================================
   DASHBOARD / CONTENIDOS
===================================== */
.dashboard-header {
    margin-bottom: 1.5rem;
    animation: fadeInDown 0.5s ease-out;
}

.dashboard-header h1 {
    color: var(--primary-color);
    font-weight: 700;
}

.dashboard-header p {
    color: #666;
    font-size: 1.1rem;
}

/* Contenedor Iframe Power BI */
.iframe-container {
    position: relative;
    width: 100%;
    /* Altura mínima dinámica para que al menos ocupe la pantalla, pero pueda crecer más allá y empujar el footer */
    min-height: calc(100vh - 140px);
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    animation: fadeIn 0.6s ease-out;
}

.iframe-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 10;
}

/* ==================================
   LOADER (Indicador de carga)
===================================== */
.loader-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f8f9fa;
    z-index: 5;
    flex-direction: column;
}

.spinner-border {
    color: var(--secondary-color);
    width: 3rem;
    height: 3rem;
}

.loader-text {
    margin-top: 1rem;
    color: var(--primary-color);
    font-weight: 500;
}

/* ==================================
   INTERFAZ (Botones, utilidades)
===================================== */
/* Botón "Volver Arriba" */
#btn-back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: none;
    background-color: var(--primary-color);
    color: white;
    border: none;
    z-index: 99;
    width: 45px;
    height: 45px;
    padding: 0;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-speed) ease;
}

#btn-back-to-top:hover {
    background-color: var(--secondary-color);
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2) !important;
}

.footer-institucional {
    background-color: var(--primary-color);
}

/* ==================================
   VISTA DE INICIO (Home)
===================================== */
.welcome-container {
    width: 100%;
    text-align: center;
    padding: 2rem 1rem;
}

.welcome-icon {
    font-size: 5rem;
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
}

.project-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.03);
    height: 100%;
    text-decoration: none;
    color: inherit;
    display: block;
    background-color: #fff;
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
    border-color: rgba(11, 61, 145, 0.2);
}

.project-card-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* ==================================
   ANIMACIONES
===================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.4s ease-in-out;
}