/* ==========================================================================
   1. VARIABLES GLOBALES (UNIFICADAS)
   ========================================================================== */
:root {
    /* --- Paleta de Colores --- */
    --brand-color: #8800FF; /* Colores cargados el modulo AMD */
    --brand-color-light: color-mix(in srgb, var(--brand-color) 70%, white); /* opcional, un tono claro */
    --color-morado-boton: #6A4EA6;
    --color-lila-claro-acento: #CEB3F2;
    --color-azul-claro-boton: #3A86FF;
    --color-naranja-tag: #FF6F00;

    /* --- Fondos y Superficies --- */
    --color-fondo-principal: #ffffff;
    --color-fondo-sutil: #f7f7f9;
    --color-fondo-seccion: #F4F6F8;
    --color-fondo-bienvenida: #f0f7ff;

    /* --- Texto --- */
    --color-texto-titulos: #000A89;
    --color-texto-principal: #979797;
    --color-texto-secundario: #B765FF;
    --color-texto-gris-suave: #888;
    --color-texto-gris-claro: #B3B3B3;
    --color-texto-enlaces-drawer: #333;
    --color-texto-titulos-drawer: #555;
    --color-texto-titulos-drawer-2: #666;

    /* --- Bordes y Sombras --- */
    --color-borde-sutil: #e0e0e0;
    --color-borde-drawer: #ddd;
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-suave: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-fuerte: 0 6px 15px rgba(0, 0, 0, 0.12);
    --radius-md: 12px;
    --radius-lg: 16px;

    /* --- Colores de Estados y Gráficas --- */
    --color-estado-verde: #4CAF50;
    --color-estado-rojo: #FF6B6B;
    --color-estado-azul: #4D96FF;
    --color-grafica-amarillo: #FFD93D;
    --color-nota-verde-fondo: #A5F3CC;
    --color-nota-amarillo-fondo: #FDE68A;
    --color-nota-rojo-fondo: #FCA5A5;

    /*--sizes*/
    --drawer-width: clamp(200px,18vw,260px);
}

/* ==========================================================================
   2. COMPONENTES GENERALES Y DEL DASHBOARD
   ========================================================================== */
.linkmenu {
    font-size: 1rem;
    width: 100%;
    height: 100%;
    color: var(--color-texto-gris-claro);
}

.ateneamain-bloque {
    padding: 15px;
    border-radius: 12px;
    text-align: center;
}

.ateneamain-bloque .bienvenida {
    background: var(--color-fondo-bienvenida);
}

.ateneamain-bloque .botones {
    margin-top: 10px;
}

.lista-progreso {
    list-style: none;
    padding: 0;
    height: 54vh;
    overflow-y: scroll;
}

.lista-progreso li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--color-fondo-principal);
    margin: 5px 0;
    padding: 8px;
    border-radius: 8px;
}

.progreso-circular {
    min-width: 60px;
    min-height: 60px;
    border-radius: 50%;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

.azul {
    border: 2px solid var(--color-estado-azul);
}

.verde {
    border: 2px solid var(--color-estado-verde);
}

.rojo {
    border: 2px solid var(--color-estado-rojo);
}

.leyenda {
    text-align: left;
    list-style: none;
    padding: 0;
    height: 27vh;
    overflow-y: scroll;
}

.leyenda li {
    margin: 4px 0;
}

.color {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 5px;
}

.color-mate {
    background: var(--color-grafica-amarillo);
}


/* ==========================================================================
   3. BLOQUE DE PERFIL (SIDEBAR)
   ========================================================================== */
/* --- 1. Contenedor Principal (Aspecto de Tarjeta) --- */
.perfil-bloque {
    background-color: var(--color-fondo-principal); /* Fondo blanco limpio */
    border-radius: var(--radius-lg, 16px); /* Bordes más suaves */
    border: 1px solid var(--color-borde-sutil);
    box-shadow: var(--shadow-suave);
    padding: 1.5rem; /* Más espaciado interno */
    text-align: center;
}

/* --- 2. Info de Usuario (Foto, Nombre, Rol) --- */
.perfil-bloque .foto img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 4px solid var(--color-fondo-principal); /* Anillo blanco alrededor */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15); /* Sombra para destacar la foto */
    margin-top: -50px; /* Tira la foto hacia arriba, superponiéndose */
    margin-bottom: 0.5rem;
}

.perfil-bloque .nombre {
    font-size: 1.5rem; /* Más grande para mayor impacto */
    font-weight: 700;
    color: var(--color-texto-principal);
    margin-top: 0.5rem;
}

.perfil-bloque .rol {
    font-size: 0.9rem;
    color: var(--color-texto-secundario);
    margin-bottom: 1.5rem;
}

/* --- 3. Secciones Interiores (Tests, Recordatorios) --- */
.perfil-bloque .seccion {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-borde-sutil); /* Separador limpio */
    text-align: left;
}

.perfil-bloque .seccion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-texto-secundario);
    text-transform: uppercase; /* Da un toque más formal */
    letter-spacing: 0.5px;
}

.perfil-bloque .seccion-header a {
    font-size: 0.8rem;
    color: var(--brand-color, #6A4EA6);
    text-decoration: none;
    font-weight: 600;
}

.perfil-bloque .seccion-header a:hover {
    text-decoration: underline;
}

/* --- 4. Items Individuales (Tests y Recordatorios) --- */
.test, .recordatorio {
    display: flex;
    align-items: center;
    gap: 1rem; /* Espacio consistente entre icono y texto */
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border-radius: var(--radius-md, 12px);
    transition: background-color 0.2s ease;
}

.test:hover, .recordatorio:hover {
    background-color: var(--color-fondo-sutil);
}

.test a, .recordatorio a {
    color: var(--color-texto-principal);
    text-decoration: none;
    font-weight: 500;
}

/* Notas y iconos rediseñados */
.test .nota, .recordatorio .icono {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%; /* Círculos para un look más suave */
    font-weight: 700;
    font-size: 0.9rem;
}

/* Paleta de colores de alto contraste para las notas */
.notaverde {
    background-color: #d1fae5;
    color: #065f46;
}

.notaamarillo {
    background-color: #fef3c7;
    color: #92400e;
}

.notarojo {
    background-color: #fee2e2;
    color: #991b1b;
}

.recordatorio .icono {
    background-color: #e0e7ff; /* Un lila/azul muy claro */
    border-radius: var(--radius-md, 12px); /* Mantenemos el radio cuadrado para diferenciarlo */
}


/* ==========================================================================
   4. MENÚ LATERAL (CUSTOM DRAWER)
   ========================================================================== */
#custom-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--drawer-width);
    height: 100%;
    background: var(--color-fondo-principal);
    border-right: 1px solid var(--color-borde-drawer);
    overflow-y: auto;
    z-index: 9999 !important;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease-in-out;
}

#custom-drawer .drawer-logo {
    text-align: center;
    margin-bottom: 1.5rem;
    margin-top: 2rem;
}

#custom-drawer .drawer-logo img.drawer-site-logo {
    max-width: 180px;
    height: auto;
}

#custom-drawer .drawer-section {
    margin-bottom: 1.5rem;
}

#custom-drawer .drawer-section h4 {
    font-size: 0.85rem;
    font-weight: 600;
    margin: 1rem 0 0.5rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid #eee;
    color: var(--color-texto-titulos-drawer-2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#custom-drawer ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

#custom-drawer a {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    color: var(--color-texto-enlaces-drawer);
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.95rem;
    transition: background 0.2s, color 0.2s;
}

#custom-drawer a:hover {
    background: #f5f5f5;
    color: var(--brand-color);
}

#custom-drawer a.is-active {
    background: #efe9ff;
    color: var(--brand-color);
    font-weight: 600;
}

#custom-drawer .custom-items a {
    gap: 8px;
}

#custom-drawer .custom-items a svg {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

#custom-drawer .drawer-section a i {
    margin-right: 8px;
    font-size: 1rem;
    color: var(--brand-color-light);
}

/* --- Componentes específicos del Drawer --- */
.drawer-toggle {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 2000;
    background: var(--brand-color-light);
    color: var(--color-fondo-principal);
    border: none;
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-size: 1.2rem;
}

.drawer-toggle:hover {
    background: var(--brand-color);
}

#custom-drawer .notif-items {
    display: flex;
    gap: 10px;
    margin-bottom: 1rem;
    justify-content: flex-start;
}

#custom-drawer .notif-items .popover-region-toggle {
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background 0.2s;
}

/* ==========================================================================
   5. MODIFICACIONES NAVBAR Y HERO BANNER
   ========================================================================== */
nav.navbar.fixed-top.navbar-light.bg-white.navbar-expand {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

nav.navbar.fixed-top .navbar-brand,
nav.navbar.fixed-top .navbar-nav:not(.ml-auto) {
    display: none !important;
}

nav.navbar.fixed-top .ml-auto {
    display: flex !important;
    position: relative;
    z-index: 3000;
    background: var(--color-fondo-principal);
    padding: 5px 8px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hero-banner {
    position: relative;
}

.hero-banner .hero-illustration {
    display: block;
}

.hero-banner-mobile-wrapper {
    display: none;
}

#page-local-miperfil-index #page-header .d-flex.align-items-center {
    flex-direction: row-reverse !important;
    justify-content: center !important;
    padding: 1rem;
}

@media (min-width: 992px) {
    #page-local-miperfil-index #page-header .d-flex.align-items-center {
        margin-right: 12rem;
    }
}

/* ==========================================================================
   6. REGLAS RESPONSIVE (AGRUPADAS)
   ========================================================================== */
@media (min-width: 769px) {
    #custom-drawer {
        transform: translateX(0) !important;
    }

    .drawer-toggle {
        display: none;
    }

    body:not(.pagelayout-login) #page-wrapper {
        margin-left: var(--drawer-width);
    }

    body:not(.pagelayout-login) .drawer-toggles .drawer-left-toggle {
        left: var(--drawer-width) !important;
    }

    /* Mueve el panel del índice del curso (esto ya te funcionaba) */
    body:not(.pagelayout-login) #theme_boost-drawers-courseindex.drawer {
        left: var(--drawer-width) !important;
    }

    body:not(.pagelayout-login) #mobile-sticky-logo {
        display: none;
    }
}

@media (max-width: 768px) {
    /* --- Layout del Drawer en Móvil --- */
    #custom-drawer {
        transform: translateX(-100%);
    }

    #custom-drawer.open {
        transform: translateX(0);
    }

    .drawer-toggle {
        display: block;
    }

    body {
        /*margin-left: 0;*/
        padding-top: 72px; /* Espacio para elementos fijos */
    }

    /* --- Navbar y Logo Fijo en Móvil --- */
    nav.navbar.fixed-top .ml-auto {
        position: fixed !important;
        top: 10px;
        right: 10px;
    }

    #mobile-sticky-logo {
        display: flex;
        position: fixed;
        top: 70px;
        left: 50%;
        transform: translateX(-50%);
        align-items: center;
        justify-content: center;
        padding: 6px 14px;
        max-width: 60vw;
        background: rgba(255, 255, 255, 0.96);
        border-radius: 999px;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
        z-index: 1000;
        transition: opacity 0.3s ease, transform 0.3s ease;
    }

    #mobile-sticky-logo img {
        max-height: 44px;
        width: auto;
    }

    /* --- Hero Banner en Móvil --- */
    .hero-banner-desktop {
        display: none !important;
    }

    .hero-banner-mobile-wrapper {
        display: flex !important;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1.25rem;
    }

    .hero-banner-mobile-wrapper > p {
        margin: 0;
    }

    .hero-banner-mobile-wrapper .botones {
        position: static !important;
        width: 100%;
        max-width: 320px;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .hero-banner-mobile-wrapper .botones .btn-accion {
        margin: 0;
        width: 100%;
    }

    .hero-banner-mobile-wrapper .hero-illustration {
        position: static !important;
        max-width: min(420px, 100%);
        width: 100%;
        height: auto;
        order: -1;
    }

    /* --- Contenido del Perfil en Móvil --- */
    .contenido-mobile {
        padding-top: 20px;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .perfil-bloque .foto,
    .perfil-bloque .nombre,
    .perfil-bloque .rol {
        display: none;
    }

    .perfil-oculto-en-subpagina-movil {
        display: none;
    }
}


/* ==========================================================
   BOTONES DE ACCIÓN - HERO BANNER
   ========================================================== */
.hero-banner .botones,
.hero-banner-mobile-wrapper .botones {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-start;
}

.btn-accion {
    background: var(--brand-color-light);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 10px 18px;
    margin: 5px 0;
    font-weight: 600;
    font-size: 0.95rem;
    text-transform: none;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.12);
    transition: all 0.25s ease-in-out;
}

/* Hover más notorio */
.btn-accion:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    filter: brightness(1.1);
}

/* Botón secundario (azul claro existente) */
.btn-accion.btn-secundario {
    background-color: var(--color-azul-claro-boton);
}

/* Botón terciario (nuevo, con tono lila-acento) */
.btn-accion.btn-terciario {
    background-color: var(--color-lila-claro-acento);
    color: #fff;
}

/* Hover para secundarios y terciarios */
.btn-accion.btn-secundario:hover {
    filter: brightness(1.15);
}
.btn-accion.btn-terciario:hover {
    filter: brightness(1.1);
}

/* En pantallas pequeñas, botones uno debajo del otro */
@media (max-width: 768px) {
    .hero-banner .botones,
    .hero-banner-mobile-wrapper .botones {
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
    }

    .btn-accion {
        width: 100%;
        max-width: 300px;
        text-align: center;
    }
}

#custom-drawer .custom-items li {
    list-style: none;
    margin: 0;
    padding: 0;
}

#mobile-sticky-logo.hidden {
    opacity: 0;
    transform: translate(-50%, -30px);
    pointer-events: none;
}
