/* Menú lateral del Concurso Docente, adaptado del prototipo Concursa (UNEMI). Se carga en basepse.html. */
:root {
    --pt-side-w: 16.5rem;
    --pt-side-w-min: 4.75rem;
    --pt-top: 61px;
    --ms-surface: #FFFFFF;
    --ms-bg: #F5F7FA;
    --ms-line: #D5DCE0;
    --ms-fg: #222223;
    --ms-muted: #627378;
    --ms-brand: #002E45;
    --ms-accent: #FF6900;
    --ms-accent-tint: #FFF1E6;
    --ms-hover: #ECF2F6;
}
.pt-side [hidden] { display: none !important; }
.pt-ic { width: 1.25rem; height: 1.25rem; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Contenedor ---------- */
.pt-side {
    position: fixed; z-index: 1035; left: 0; top: var(--pt-top); bottom: 0; width: var(--pt-side-w);
    display: flex; flex-direction: column; gap: .25rem; padding: 1rem .75rem 2.75rem 1.25rem;
    overflow-y: auto; overscroll-behavior: contain; font-family: 'Poppins', Arial, Helvetica, sans-serif; font-size: 14px;
    border-right: 1px solid var(--ms-line);
    /* Sin barra de desplazamiento: sombras suaves arriba/abajo indican que hay más opciones */
    scrollbar-width: none;
    background:
        linear-gradient(var(--ms-surface) 30%, rgba(255, 255, 255, 0)) top / 100% 2.5rem no-repeat local,
        linear-gradient(rgba(255, 255, 255, 0), var(--ms-surface) 70%) bottom / 100% 2.5rem no-repeat local,
        radial-gradient(farthest-side at 50% 0, rgba(0, 46, 69, .16), rgba(0, 46, 69, 0)) top / 100% .9rem no-repeat scroll,
        radial-gradient(farthest-side at 50% 100%, rgba(0, 46, 69, .16), rgba(0, 46, 69, 0)) bottom / 100% .9rem no-repeat scroll;
    background-color: var(--ms-surface);
}
.pt-side::-webkit-scrollbar { display: none; }
body.pt-con-menu .content-wrapper { margin-left: var(--pt-side-w) !important; }
body.pt-con-menu #footer { left: var(--pt-side-w); }
body.pt-side-listo .pt-side, body.pt-side-listo.pt-con-menu .content-wrapper, body.pt-side-listo.pt-con-menu #footer { transition: width .2s, margin-left .2s, left .2s, transform .2s; }

/* ---------- Buscador (fijo arriba) ---------- */
.pt-side__buscar { position: sticky; top: -1rem; z-index: 2; margin: -1rem 0 .25rem; padding: 1rem 0 .4rem; background: var(--ms-surface); }
.pt-side__buscar .pt-ic { position: absolute; left: .7rem; top: calc(50% + .3rem); transform: translateY(-50%); color: var(--ms-muted); pointer-events: none; }
.pt-side__buscar .form-control { height: auto; min-height: 2.6rem; padding: .4rem .75rem .4rem 2.4rem; font-size: .9rem; border: 1px solid #C6D0D9; border-radius: .5625rem; color: var(--ms-brand); }
.pt-side__buscar .form-control:focus { border-color: #3C7AA0; box-shadow: 0 0 0 3px rgba(60, 122, 160, .22); }
.pt-side__buscar .form-control::placeholder { color: #5F7082; }

/* ---------- Grupos ---------- */
.pt-grp { display: flex; align-items: center; gap: .4rem; margin: .9rem .6rem .3rem; font-size: .75rem; font-weight: 600; color: var(--ms-muted); }
.pt-grp-btn { width: calc(100% - .4rem); min-height: 2.25rem; margin: .6rem .2rem .2rem; padding: .35rem .4rem; border: 0; border-radius: .5rem; background: none; font: inherit; font-size: .75rem; font-weight: 700; color: var(--ms-muted); cursor: pointer; justify-content: space-between; }
.pt-grp-btn:hover { background: var(--ms-hover); color: var(--ms-brand); }
.pt-grp-btn:focus-visible, .pt-nav a:focus-visible, .pt-star:focus-visible { outline: 3px solid rgba(255, 105, 0, .55); outline-offset: 1px; }
.pt-grp-btn > span:first-child { flex: 1; text-align: left; }
.pt-grp-n { display: inline-grid; place-items: center; min-width: 1.3rem; height: 1.3rem; margin-right: .3rem; border-radius: 999px; background: var(--ms-hover); color: #264763; font-size: .75rem; }
.pt-grp-cv { width: 1rem; height: 1rem; transition: transform .2s; }
.pt-grp-btn[aria-expanded="true"] .pt-grp-cv { transform: rotate(180deg); }
.pt-grp--fav > .pt-ic { width: 1rem; height: 1rem; color: #F76600; fill: currentColor; }
.pt-grp-linea { display: none; margin: .5rem .4rem; border-top: 1px solid var(--ms-line); }

/* ---------- Opciones ---------- */
.pt-nav { position: relative; display: flex; align-items: center; border-radius: .5rem; }
.pt-nav a { flex: 1; display: flex; align-items: center; gap: .7rem; min-width: 0; min-height: 2.75rem; padding: .45rem .65rem; border-radius: .5rem; color: var(--ms-fg); font-size: .93rem; text-decoration: none; }
.pt-nav a span { line-height: 1.25; }
.pt-nav a:hover { background: var(--ms-bg); color: var(--ms-fg); text-decoration: none; }
.pt-nav a[aria-current="page"] { background: var(--ms-accent-tint); color: var(--ms-brand); font-weight: 600; box-shadow: inset 4px 0 0 var(--ms-accent); }
.pt-star { display: grid; place-items: center; min-width: 2.75rem; min-height: 2.75rem; border: 0; border-radius: .5rem; background: none; color: var(--ms-muted); cursor: pointer; opacity: 0; transition: opacity .15s, transform .15s; }
.pt-nav:hover .pt-star, .pt-star:focus-visible, .pt-star[aria-pressed="true"] { opacity: 1; }
.pt-star:hover { background: var(--ms-hover); color: #264763; }
.pt-star[aria-pressed="true"] { color: #F76600; }
.pt-star[aria-pressed="true"] .pt-ic { fill: currentColor; }
.pt-star[aria-pressed="true"]:hover { background: transparent; color: #F76600; transform: scale(1.12); }
.pt-star:active { transform: scale(.9); }
.pt-star--quitar { opacity: 0; color: var(--ms-muted); }
.pt-nav:hover .pt-star--quitar, .pt-star--quitar:focus-visible { opacity: 1; }
.pt-star--quitar:hover { color: var(--ms-brand); }
.pt-side__vacio { margin: .6rem; font-size: .85rem; color: var(--ms-muted); }
.pt-tip { position: absolute; left: calc(100% + .5rem); top: 50%; z-index: 60; display: none; padding: .3rem .6rem; transform: translateY(-50%); border-radius: .375rem; background: #222223; color: #fff; font-size: .8rem; white-space: nowrap; pointer-events: none; }

/* ---------- Botón de menú en la barra superior ---------- */
.pt-menu-btn { display: inline-grid; place-items: center; width: 2.75rem; height: 2.75rem; margin-right: .25rem; border: 0; border-radius: .5rem; background: transparent; color: #fff; cursor: pointer; }
.pt-menu-btn:hover { background: rgba(255, 255, 255, .12); }
.pt-menu-btn:focus-visible { outline: 3px solid rgba(255, 105, 0, .7); outline-offset: 1px; }
.pt-menu-btn .pt-ic { width: 1.4rem; height: 1.4rem; }

/* ---------- Contraído (solo íconos con descripción emergente) ---------- */
@media (min-width: 992px) {
    body.pt-side-contraido .pt-side { width: var(--pt-side-w-min); padding-left: .5rem; padding-right: .5rem; overflow-x: visible; }
    body.pt-side-contraido.pt-con-menu .content-wrapper { margin-left: var(--pt-side-w-min) !important; }
    body.pt-side-contraido.pt-con-menu #footer { left: var(--pt-side-w-min); }
    body.pt-side-contraido .pt-side__buscar, body.pt-side-contraido .pt-grp, body.pt-side-contraido .pt-star,
    body.pt-side-contraido .pt-nav a span, body.pt-side-contraido .pt-side__vacio { display: none !important; }
    body.pt-side-contraido .pt-grp-linea { display: block; }
    body.pt-side-contraido .pt-grp-items[hidden] { display: block !important; }
    body.pt-side-contraido .pt-nav a { justify-content: center; padding: .45rem; }
    body.pt-side-contraido .pt-nav:hover .pt-tip, body.pt-side-contraido .pt-nav:focus-within .pt-tip { display: block; }
    body.pt-side-contraido .pt-side { overflow: visible; }
}

/* ---------- Móvil: cajón con fondo oscurecido ---------- */
@media (max-width: 991.98px) {
    body.pt-con-menu .content-wrapper { margin-left: 0 !important; }
    body.pt-con-menu #footer { left: 0; }
    .pt-side { top: 0; z-index: 1060; width: min(18rem, 85vw); padding-top: calc(1rem + env(safe-area-inset-top, 0px)); transform: translateX(-105%); box-shadow: 0 0 40px rgba(0, 0, 0, .3); }
    body.pt-side-abierto .pt-side { transform: none; }
    body.pt-side-abierto .pt-side-scrim { position: fixed; inset: 0; z-index: 1055; display: block; background: rgba(0, 0, 0, .4); }
    body.pt-side-abierto { overflow: hidden; }
}
.pt-side-scrim { display: none; }
@media (prefers-reduced-motion: reduce) {
    .pt-side, .pt-grp-cv, .pt-star, body.pt-side-listo .pt-side, body.pt-side-listo.pt-con-menu .content-wrapper, body.pt-side-listo.pt-con-menu #footer { transition: none !important; }
}
