/* itsrlabs/apps/platform/static/css/_shared/help_videos.css */
/* Help nav item menu + floating tutorial player (markup in _help_videos.html, logged-in only). Linked from the layouts' head.
   The trigger is a nav link; the menu reuses the account dropdown classes in nav_header_footer_2_variant_f.css. */

/* ========= HELP NAV ITEM + MENU ========= */
.itsr-help__trigger {
    border: 0;
    background: none;
}

.itsr-pill-account-wrapper--open .itsr-help__trigger {
    color: var(--p1-dusk-blue);
    background: rgba(46, 80, 119, 0.06);
}

/* The nav row clips overflow, so the menu is fixed and help_videos.js sets top/left.
   z-index: above the floating player so another video can be picked while one plays. */
.itsr-help__menu.itsr-pill-account-dropdown {
    position: fixed;
    right: auto;
    margin-top: 0;
    z-index: 1065;
    width: min(23rem, calc(100vw - 2rem));
    white-space: normal; /* the nav row is nowrap */
    max-height: min(70vh, 34rem);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.itsr-help__intro {
    margin: 0 0 0.25rem;
    padding: 0.35rem 0.75rem 0.6rem;
    border-bottom: 1px solid var(--pill-card-border);
    color: var(--pill-text-muted);
    font-size: 0.8rem;
    line-height: 1.4;
}

.itsr-help__group + .itsr-help__group {
    margin-top: 0.15rem;
}

.itsr-help__group-name {
    display: block;
    padding: 0.6rem 0.75rem 0.2rem;
    color: var(--p1-dusk-blue);
    font-family: 'Outfit', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
}

.itsr-help__item.itsr-pill-dropdown-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    width: 100%;
    border: 0;
    background: none;
    font-family: inherit;
    line-height: 1.35;
    text-align: left;
}

.itsr-help__item-icon {
    flex-shrink: 0;
    margin-top: 0.05rem;
    color: var(--pill-text-muted);
    transition: color var(--pill-transition);
}

.itsr-help__item:hover .itsr-help__item-icon {
    color: var(--p1-dusk-blue);
}

.itsr-help__item.itsr-help__item--playing,
.itsr-help__item.itsr-help__item--playing:hover {
    background: var(--pill-accent-soft);
    color: var(--pill-accent);
    font-weight: 600;
}

.itsr-help__item--playing .itsr-help__item-icon,
.itsr-help__item--playing:hover .itsr-help__item-icon {
    color: var(--pill-accent);
}

.itsr-help__item:focus-visible,
.itsr-help-player__btn:focus-visible {
    outline: 2px solid var(--p1-dusk-blue);
    outline-offset: -2px;
}

@media (max-width: 480px) {
    .itsr-help .itsr-pill-account-chevron {
        display: none;
    }
}

/* ========= FLOATING PLAYER ========= */
.itsr-help-player {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    z-index: 1060; /* above Bootstrap modals (1055) so a tutorial can be followed inside one */
    width: min(44rem, calc(100vw - 3rem), calc((100vh - 7rem) * 16 / 9));
    overflow: hidden;
    background: var(--clr-surface);
    border: 1px solid rgba(11, 110, 79, 0.14);
    border-radius: 1rem;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.18), 0 2px 6px rgba(15, 23, 42, 0.06);
    font-family: 'Outfit', sans-serif;
    transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.itsr-help-player[hidden] {
    display: none;
}

.itsr-help-player:focus {
    outline: none;
}

/* Large stays 16:9 inside short viewports too. */
.itsr-help-player--large {
    width: min(76rem, calc(100vw - 3rem), calc((100vh - 7rem) * 16 / 9));
}

.itsr-help-player--enter {
    animation: itsr-help-player-in 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
    transform-origin: bottom right;
}

@keyframes itsr-help-player-in {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.97);
    }
}

.itsr-help-player__bar {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    padding: 0.5rem 0.45rem 0.5rem 0.9rem;
    cursor: grab;
    user-select: none;
    touch-action: none;
}

.itsr-help-player--dragging,
.itsr-help-player--dragging .itsr-help-player__bar {
    cursor: grabbing;
    transition: none;
}

.itsr-help-player--dragging iframe {
    pointer-events: none;
}

.itsr-help-player__heading {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
}

.itsr-help-player__product {
    color: var(--p1-dark-emerald);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.2;
}

.itsr-help-player__title {
    overflow: hidden;
    color: var(--clr-text-main);
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.itsr-help-player__btn {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: 0;
    border-radius: 9999px;
    background: transparent;
    color: var(--clr-text-muted);
    font-size: 0.85rem;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.itsr-help-player__btn:hover {
    background: rgba(46, 80, 119, 0.08);
    color: var(--p1-dusk-blue);
}

.itsr-help-player__frame {
    aspect-ratio: 16 / 9;
    background: #000;
}

.itsr-help-player__frame iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Phones: a full-width strip along the bottom; no drag, no enlarge. */
@media (max-width: 575.98px) {
    .itsr-help-player,
    .itsr-help-player--large {
        right: 0.75rem;
        bottom: 0.75rem;
        left: 0.75rem;
        width: auto;
    }

    .itsr-help-player__bar {
        cursor: default;
    }

    .itsr-help-player__btn--size {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .itsr-help-player,
    .itsr-help-player--enter {
        transition: none;
        animation: none;
    }
}
