/* Positional (right-click / anchored) menu — the shared one.
 *
 * Moved here out of dashboard.css so every page can have the same menu, not just the
 * dashboard. Pairs with wwwroot/js/cv-posmenu.js.
 *
 * Every colour is a theme token: the menu has to look right in light, dark and the
 * per-organisation themes, and it is rendered on pages that never load dashboard.css.
 * The tokens below fall back to the dashboard defaults when a page defines none. */

.pos-menu {
    position: fixed;
    z-index: 8001; /* overridden dynamically by _zNext() */
    min-width: 220px;
    max-width: 300px;
    background: var(--bg-popup, var(--bg-panel, #1b1e24));
    border: 1px solid var(--border-strong, var(--border, rgba(255,255,255,0.14)));
    border-radius: 14px;
    box-shadow: var(--shadow-panel, 0 14px 40px rgba(0,0,0,0.45));
    padding: 6px;
    opacity: 0;
    transform: scale(0.92) translateY(-6px);
    transform-origin: top left;
    transition: opacity 0.14s ease, transform 0.14s ease;
    pointer-events: none;
}
.pos-menu.is-open {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: all;
}
.pos-menu__category {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--text-muted, #8b93a1);
    padding: 8px 10px 4px;
}
/* A line icon in front of a heading — it takes the heading's own colour, like every icon. */
.pos-menu__category-icon {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
}
.pos-menu__separator {
    height: 1px;
    background: var(--border, rgba(255,255,255,0.12));
    margin: 4px 6px;
}
.pos-menu__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 9px;
    cursor: pointer;
    transition: background 0.1s;
}
.pos-menu__item:hover { background: var(--bg-item-hover, rgba(255,255,255,0.07)); }
/* Destructive rows take the theme's red, not a colour of their own — so they follow
   light/dark and the per-organisation palettes like everything else. */
.pos-menu__item--danger .pos-menu__label { color: var(--accent-red, #e53e3e); }
.pos-menu__item--danger .pos-menu__icon  { color: var(--accent-red, #e53e3e); }
.pos-menu__item--danger:hover { background: rgba(var(--accent-red-rgb, 229,62,62), 0.12); }
.pos-menu__icon {
    width: 32px; height: 32px;
    border-radius: 8px;
    background: var(--bg-item, rgba(255,255,255,0.05));
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    font-size: 14px;
}
/* A thumbnail instead of an icon: the first slide of a deck, the first page of a document.
   Wider than the square icon box, because that is what makes it recognisable. */
.pos-menu__icon--preview {
    width: 46px; height: 30px;
    border-radius: 6px;
    border: 1px solid var(--border, rgba(255,255,255,0.12));
    background-size: cover;
    background-position: center;
}
/* The row that is already the current choice. */
.pos-menu__item--on .pos-menu__label { color: var(--accent, #f5a623); font-weight: 700; }
.pos-menu__text { flex: 1; min-width: 0; }
.pos-menu__label  { font-size: 13px; font-weight: 600; color: var(--text-primary, #e8eaed); }
/* One line, cut with an ellipsis: a share URL as subtitle wrapped over three lines and
   stretched the whole menu. */
.pos-menu__sub    { font-size: 11px; color: var(--text-muted, #8b93a1); margin-top: 1px;
                    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pos-menu__chev   { flex: 0 0 auto; color: var(--text-muted, #8b93a1); display: flex; align-items: center; }
.pos-menu__item--sub:hover .pos-menu__chev { color: var(--accent, #f5a623); }
.pos-menu-backdrop {
    position: fixed; inset: 0; z-index: 8000; /* overridden dynamically */
}
/* Rich-HTML panels (CrewMate editor, teach review, follow-up draft) are modal-like
   forms — dim + frost the page behind them so the eye isn't fighting the clutter.
   Plain item menus stay transparent. */
.pos-menu-backdrop--dim {
    background: rgba(0,0,0,0.5);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    animation: cvPosMenuFadeIn 0.14s ease;
}
@keyframes cvPosMenuFadeIn { from { opacity: 0; } to { opacity: 1; } }
