﻿/* ============================================================
   LAYOUT INSTITUCIONAL — PUEBLA DIGITAL 2024–2030
   ============================================================ */

/* CONTENEDOR GENERAL: Ocupa toda la pantalla y no permite scroll fuera */
.full-page-layout {
    height: 100vh; /* Forzamos a que mida exactamente la pantalla */
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Evita el scroll doble en la ventana principal */
}

/* CONTENEDOR MEDIO: Se estira para ocupar el espacio entre header y footer */
.ep-main {
    flex: 1;
    display: flex;
    overflow: hidden; /* Crucial para que los hijos controlen su propio scroll */
    min-height: 0;
}

/* SIDEBAR: Ya no necesita sticky ni cálculos de 100vh */
.ep-main-sidebar {
    background: #fefefe;
    border-right: 1px solid #f0f0f0;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

/* CONTENIDO: Aquí es donde aparecerá el scroll de tu @Body */
.ep-main-content {
    position: relative;
    flex: 1;
    overflow-y: auto; /* El scroll aparece aquí cuando el contenido sobrepasa el alto */
    padding: 2rem;
    background: #f5f5f5;
}

#textureCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* No bloquea clics */
    opacity: 0.25; /* Sutil */
}

/* FOOTER: Siempre visible al fondo */
.ep-footer {
    flex-shrink: 0; /* Evita que el footer se "aplane" si el contenido es mucho */
    background: var(--puebla-gray-dark);
    font-size: .85rem;
    color: #dfdfdf;
    padding: .75rem;
    text-align: center;
}

/* ------------------------------------------------------------
   HEADER
   ------------------------------------------------------------ */

.ep-header {
    padding: .75rem 1rem;
    display: flex;
    align-items: center;
    background: var(--puebla-guinda);
    color: var(--text-light);
}

.ep-header-title {
    font-weight: 700;
    font-size: 1.75rem;
}

.ep-spacer {
    flex-grow: 1;
}

/* ------------------------------------------------------------
   SUBHEADER
   ------------------------------------------------------------ */

.ep-subheader {
    background: var(--puebla-gray-light);
    color: var(--puebla-gray-dark);
    padding: .5rem 1rem;
    font-size: .85rem;
    font-weight: 300;
    text-align: center;
}

/* ------------------------------------------------------------
   BODY
   ------------------------------------------------------------ */

/* CENTRADO OPCIONAL */
.ep-center-content {
    width: 100%;
    min-height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ============================================================
   PROFILE MENU — PUEBLA DIGITAL 2024–2030
   ============================================================ */

.ep-profile-menu {
    display: flex;
    align-items: center;
    gap: .75rem;
    color: white;
    position: relative;
    cursor: pointer;
    user-select: none;
}

.ep-profile-initials {
    background: var(--puebla-guinda-dark);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    border: 2px solid white;
    font-size: .9rem;
}

.ep-profile-info {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.ep-profile-name {
    font-weight: 600;
    font-size: .9rem;
}

.ep-profile-email {
    font-size: .75rem;
    opacity: .85;
}

.ep-profile-arrow {
    font-size: .75rem;
    transition: transform .2s ease;
}

    .ep-profile-arrow.open {
        transform: rotate(180deg);
    }

.ep-profile-dropdown {
    position: absolute;
    top: 48px;
    right: 0;
    background: var(--puebla-gray-light);
    color: var(--puebla-guinda-dark);
    padding: .5rem 0;
    border-radius: 6px;
    min-width: 180px;
    box-shadow: 0 4px 12px rgba(0,0,0,.25);
    z-index: 1000;
}

.ep-profile-item {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--puebla-guinda-light);
    text-align: left;
    padding: .5rem 1rem;
    cursor: pointer;
    font-size: .9rem;
}

    .ep-profile-item:hover {
        background: #f5f5f5;
    }

/* ============================================================
   SIDEBAR INSTITUCIONAL — PUEBLA DIGITAL 2024–2030
   ============================================================ */

.ep-sidebar {
    width: 250px;
    background: #fefefe;
    color: var(--puebla-gray-dark);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 100px; /* altura real del header + subheader */
    height: 100%;
    overflow-y: auto;
    border-right: 1px solid #f9f9f9;
    transition: width .25s ease;
}


    .ep-sidebar.collapsed {
        width: 80px;
    }

.ep-sidebar-inner {
    flex: 1;
    padding: .75rem;
    display: flex;
    flex-direction: column;
    gap: .25rem;
}

.ep-sidebar-toggle {
    background: var(--puebla-guinda);
    color: white;
    border: none;
    width: 100%;
    padding: .5rem;
    cursor: pointer;
    font-weight: 700;
    transition: background .2s ease;
}

    .ep-sidebar-toggle:hover {
        background: var(--puebla-guinda-light);
    }

.ep-sidebar-item {
    padding: .65rem .75rem;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: .75rem;
    transition: background .2s ease;
    font-size: .9rem;
}

    .ep-sidebar-item:hover {
        background: var(--puebla-gray-light);
    }

    .ep-sidebar-item.active {
        background: var(--puebla-guinda-dark);
        color: white;
    }

.ep-sidebar-icon {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.ep-sidebar.collapsed .ep-sidebar-text {
    display: none;
}
