/* Video tutorial detail design layer.
 *
 * The presentation layer for Components/Pages/VideoTutorialPage.razor. Global
 * CSS, linked from App.razor — it was Blazor-scoped until the stylesheets were
 * consolidated under wwwroot/css. Three rules govern this file, the first two
 * shared with the sibling sheets:
 *
 * 1. Nothing confines these rules to this page any more, so every selector is
 *    qvd- prefixed or a descendant of one. A bare element selector here would
 *    leak into the rest of the site the way the deleted css/site.css did.
 * 2. @keyframes names are global too. Hence the qvd- prefix on both of them, so
 *    they cannot collide with the compiled Tailwind bundle, with the index's
 *    qv- animations, home's qh-, pricing's qp-, the blog's qb- or the help
 *    centre's qc- ones.
 * 3. The doubled class in `.qvd-prose.qvd-prose p` is deliberate, not a typo.
 *    Isolation used to rewrite these selectors as `.qvd-prose[b-xxxxx] p`, and
 *    the attribute was carrying real weight against the bundle's own unlayered
 *    .prose block. Repeating the class restores exactly that specificity. Same
 *    approach pages/blog-post.css takes, and `prose` stays on the element as
 *    the base — this file only adjusts it, it does not restate it.
 *
 * These rules are unlayered and Tailwind v4's utilities live inside @layer, so
 * they win regardless of specificity. Keep every selector class-based and
 * prefixed.
 *
 * Palette is the logo ramp the index uses: #a22dea → #7b5ee5 → #5b5de2, with
 * #4f46e5 → #7c3aed as the primary.
 *
 * The shape: player first and full width of the content column, then the copy
 * card under it, then the previous/next pair — with the rest of the series in a
 * sticky rail beside them. The player is the only dark surface on the page, so
 * the eye lands on it before anything else.
 */

/* ── page ───────────────────────────────────────────────────────────── */
.qvd-page {
    position: relative;
    padding: 26px 0 84px;
    background: linear-gradient(180deg, #fff 0%, #faf9ff 34%, #f5f3fd 100%);
}

.qvd-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 352px;
    gap: 28px;
    align-items: start;
}

.qvd-main { min-width: 0; }

/* ── breadcrumb ─────────────────────────────────────────────────────── */
.qvd-crumb { margin: 0 0 20px; }

.qvd-crumb ol {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 12.5px;
    font-weight: 600;
    color: #94a3b8;
}

.qvd-crumb a {
    color: #64748b;
    transition: color .2s;
}

.qvd-crumb a:hover { color: #4f46e5; }

.qvd-crumb__sep {
    color: #cbd5e1;
    user-select: none;
}

/* The title is the one part of the trail that can be arbitrarily long, so it
   truncates rather than wrapping the crumb to three lines. */
.qvd-crumb__now {
    max-width: 360px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 550;
    color: #a6aebe;
}

/* ── player ─────────────────────────────────────────────────────────── */
.qvd-stage {
    position: relative;
    margin-bottom: 22px;
}

/* Sits BEHIND the frame rather than over it — an inset overlay would cover the
   iframe and eat every click meant for the player controls. */
.qvd-stage::before {
    content: "";
    position: absolute;
    inset: 6% 4% -14px;
    border-radius: 32px;
    pointer-events: none;
    filter: blur(46px);
    opacity: .55;
    background: linear-gradient(120deg, #4f46e5, #a22dea 52%, #5b5de2);
}

.qvd-stage__frame {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    border-radius: 22px;
    background: #05060f;
    border: 1px solid rgba(124, 58, 237, .22);
    box-shadow: 0 40px 90px -44px rgba(15, 12, 46, .85);
}

.qvd-stage__frame iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

/* ── copy card ──────────────────────────────────────────────────────── */
.qvd-card {
    padding: 28px 30px 26px;
    border-radius: 22px;
    background: #fff;
    border: 1px solid #eae9f6;
    box-shadow: 0 22px 50px -38px rgba(15, 23, 42, .5);
}

.qvd-kind {
    display: inline-block;
    padding: 5px 12px;
    margin-bottom: 15px;
    border-radius: 6px;
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #fff;
    background: linear-gradient(100deg, #7c3aed, #a22dea);
}

.qvd-title {
    font-size: clamp(24px, 2.8vw, 34px);
    line-height: 1.24;
    letter-spacing: -.028em;
    font-weight: 800;
    color: #0b1020;
    margin: 0 0 16px;
    text-wrap: balance;
}

.qvd-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
}

.qvd-meta__item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 13px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
    color: #5b21b6;
    background: #f6f1ff;
    border: 1px solid #ece5fd;
}

.qvd-meta__item svg {
    width: 13px;
    height: 13px;
    flex: 0 0 auto;
    opacity: .8;
}

/* ── description (doubled class — see note 3 at the top) ────────────── */
.qvd-prose {
    margin-top: 22px;
    padding-top: 22px;
    border-top: 1px solid #f1eefb;
    font-size: 15.5px;
    color: #64748b;
}

.qvd-prose.qvd-prose p {
    margin: 0 0 1.3em;
    line-height: 1.85;
    color: #64748b;
}

.qvd-prose.qvd-prose p:last-child { margin-bottom: 0; }

/* The bundle's .prose gives every heading the same weight and a 2em+ top
   margin; these restore a hierarchy under the H1 the card already carries. */
.qvd-prose.qvd-prose h2 {
    font-size: 1.28em;
    line-height: 1.35;
    letter-spacing: -.02em;
    font-weight: 800;
    color: #0b1020;
    margin: 1.8em 0 .65em;
}

.qvd-prose.qvd-prose h3 {
    font-size: 1.12em;
    line-height: 1.4;
    letter-spacing: -.015em;
    font-weight: 750;
    color: #0b1020;
    margin: 1.5em 0 .5em;
}

.qvd-prose.qvd-prose a {
    color: #5b21b6;
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: rgba(124, 58, 237, .35);
    text-decoration-thickness: 1.5px;
    text-underline-offset: 3px;
    transition: color .2s, text-decoration-color .2s;
}

.qvd-prose.qvd-prose a:hover {
    color: #4f46e5;
    text-decoration-color: #4f46e5;
}

.qvd-prose.qvd-prose strong { color: #1e293b; font-weight: 700; }

.qvd-prose.qvd-prose ul,
.qvd-prose.qvd-prose ol {
    margin: 0 0 1.3em;
    padding-left: 1.3em;
}

.qvd-prose.qvd-prose li {
    margin: .4em 0;
    line-height: 1.8;
    padding-left: .2em;
}

.qvd-prose.qvd-prose li::marker {
    color: #7c3aed;
    font-weight: 700;
}

.qvd-prose.qvd-prose img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
}

/* ── previous / next ────────────────────────────────────────────────── */
.qvd-steps {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 22px;
}

/* With only a next link, the pair would otherwise stretch across both columns
   and read as the previous one. It stays in the right-hand half instead. */
.qvd-step--next:only-child { grid-column: 2; }

.qvd-step {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 15px 18px;
    border-radius: 18px;
    background: #fff;
    border: 1px solid #eae9f6;
    box-shadow: 0 18px 40px -34px rgba(15, 23, 42, .5);
    min-width: 0;
    transition: transform .25s cubic-bezier(.2, .8, .2, 1), box-shadow .25s, border-color .25s;
}

.qvd-step--next { justify-content: flex-end; text-align: right; }

.qvd-step:hover {
    transform: translateY(-2px);
    border-color: #d8d5f6;
    box-shadow: 0 28px 56px -34px rgba(79, 70, 229, .55);
}

.qvd-step:focus-visible {
    outline: 3px solid #7c3aed;
    outline-offset: 3px;
}

.qvd-step__ic {
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    border-radius: 99px;
    display: grid;
    place-items: center;
    color: #7c3aed;
    background: #f6f1ff;
    transition: color .25s, background .25s, transform .25s;
}

.qvd-step__ic svg { width: 15px; height: 15px; }

.qvd-step:hover .qvd-step__ic {
    color: #fff;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
}

.qvd-step--prev:hover .qvd-step__ic { transform: translateX(-3px); }
.qvd-step--next:hover .qvd-step__ic { transform: translateX(3px); }

.qvd-step__txt {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.qvd-step__txt small {
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: #a3aec0;
}

.qvd-step__txt b {
    font-size: 14px;
    line-height: 1.4;
    font-weight: 700;
    color: #0b1020;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color .2s;
}

.qvd-step:hover .qvd-step__txt b { color: #4f46e5; }

/* ── rail ───────────────────────────────────────────────────────────── */
.qvd-rail {
    position: sticky;
    top: 96px;
    min-width: 0;
}

.qvd-panel {
    position: relative;
    overflow: hidden;
    padding: 20px 18px 18px;
    border-radius: 22px;
    background: #fff;
    border: 1px solid #eae9f6;
    box-shadow: 0 30px 66px -44px rgba(79, 70, 229, .6);
}

.qvd-panel::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #4f46e5, #7c3aed 52%, #a22dea);
}

.qvd-panel__head {
    display: flex;
    align-items: center;
    gap: 11px;
    padding-bottom: 15px;
    margin-bottom: 6px;
    border-bottom: 1px solid #f1eefb;
}

.qvd-panel__ic {
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    border-radius: 12px;
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    box-shadow: 0 12px 26px -14px rgba(79, 70, 229, .95);
}

.qvd-panel__ic svg { width: 17px; height: 17px; }

.qvd-panel__txt {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.qvd-panel__txt b {
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -.015em;
    color: #0b1020;
}

.qvd-panel__txt small {
    font-size: 11.5px;
    font-weight: 600;
    color: #94a3b8;
}

/* The series runs to fifteen rows, which is taller than most viewports — the
   list scrolls inside the panel so the rail stays sticky and the "view all"
   link below it never falls off the bottom of the screen. */
.qvd-list {
    margin: 0;
    padding: 6px 6px 6px 0;
    list-style: none;
    max-height: min(58vh, 520px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #d8d5f6 transparent;
    overscroll-behavior: contain;
}

.qvd-list::-webkit-scrollbar { width: 6px; }

.qvd-list::-webkit-scrollbar-thumb {
    border-radius: 99px;
    background: #ddd9f2;
}

.qvd-list::-webkit-scrollbar-thumb:hover { background: #c8c2ee; }

/* ── rail item ──────────────────────────────────────────────────────── */
.qvd-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px;
    border-radius: 14px;
    border: 1px solid transparent;
    min-width: 0;
    transition: background .2s, border-color .2s;
}

.qvd-item:hover {
    background: #faf8ff;
    border-color: #eee9fd;
}

.qvd-item:focus-visible {
    outline: 3px solid #7c3aed;
    outline-offset: 1px;
}

.qvd-item--now {
    background: linear-gradient(120deg, #f6f1ff, #f3f0ff);
    border-color: #e3dafb;
}

.qvd-item__media {
    position: relative;
    overflow: hidden;
    width: 104px;
    flex: 0 0 104px;
    aspect-ratio: 16 / 9;
    border-radius: 10px;
    /* Fills the pillarbox on a YouTube hqdefault frame, which is 4:3 — a black
       plate there reads as a broken image, this reads as part of the row. */
    background: linear-gradient(135deg, #7b5ee5, #a22dea 52%, #5b5de2);
}

.qvd-item__media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.qvd-item__play {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #fff;
    opacity: 0;
    background: rgba(11, 16, 32, .48);
    transition: opacity .25s;
}

.qvd-item__play svg {
    width: 17px;
    height: 17px;
    margin-left: 2px;
}

.qvd-item:hover .qvd-item__play { opacity: 1; }

/* Three bars over the thumbnail of the one being watched — a badge saying so
   is already in the row's meta line, this is the glanceable version. */
.qvd-item__bars {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background: rgba(11, 16, 32, .48);
}

.qvd-item__bars i {
    display: block;
    width: 3px;
    height: 8px;
    border-radius: 99px;
    background: #fff;
    animation: qvd-eq 1.1s ease-in-out infinite;
}

.qvd-item__bars i:nth-child(2) { animation-delay: -.35s; }
.qvd-item__bars i:nth-child(3) { animation-delay: -.7s; }

@keyframes qvd-eq {
    0%, 100% { height: 7px; }
    50%      { height: 15px; }
}

.qvd-item__txt {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.qvd-item__txt b {
    font-size: 13px;
    line-height: 1.42;
    font-weight: 700;
    color: #1e293b;
    transition: color .2s;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.qvd-item:hover .qvd-item__txt b { color: #4f46e5; }

.qvd-item--now .qvd-item__txt b { color: #4338ca; }

.qvd-item__txt small {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 11px;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
    color: #94a3b8;
}

.qvd-item__n {
    display: inline-grid;
    place-items: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 800;
    color: #6d28d9;
    background: #f1ebfe;
}

.qvd-item--now .qvd-item__n {
    color: #fff;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
}

.qvd-item__now {
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #7c3aed;
}

/* ── view-all link ──────────────────────────────────────────────────── */
.qvd-all {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    margin-top: 14px;
    padding: 12px 18px;
    border-radius: 13px;
    font-size: 13px;
    font-weight: 700;
    color: #4338ca;
    background: #faf8ff;
    border: 1px solid #ebe6fc;
    transition: color .2s, background .25s, border-color .2s, box-shadow .25s;
}

.qvd-all svg { width: 15px; height: 15px; flex: 0 0 auto; }

.qvd-all:hover {
    color: #fff;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    border-color: transparent;
    box-shadow: 0 20px 40px -22px rgba(79, 70, 229, .95);
}

/* ── responsive ─────────────────────────────────────────────────────── */
@media (max-width: 1180px) {
    .qvd-grid { grid-template-columns: minmax(0, 1fr) 316px; gap: 22px; }
}

@media (max-width: 1024px) {
    /* The rail drops below the player, so it stops being sticky — a panel that
       tracks the viewport once it is full-width covers the content behind it —
       and the inner scroller comes off, since there is no longer a fixed
       column height to fit inside. */
    .qvd-grid { grid-template-columns: minmax(0, 1fr); gap: 30px; }

    .qvd-rail { position: static; }
    .qvd-list { max-height: none; overflow-y: visible; }
}

@media (max-width: 760px) {
    .qvd-page { padding: 18px 0 58px; }

    .qvd-crumb__now { max-width: 190px; }

    .qvd-stage__frame { border-radius: 16px; }
    .qvd-card { padding: 22px 20px 20px; border-radius: 18px; }

    /* Stacked, so `--next:only-child` has no second column to sit in. */
    .qvd-steps { grid-template-columns: minmax(0, 1fr); }
    .qvd-step--next:only-child { grid-column: 1; }

    .qvd-item__media { width: 88px; flex-basis: 88px; }
}

@media (prefers-reduced-motion: reduce) {
    .qvd-item__bars i { animation: none; height: 11px; }

    .qvd-step,
    .qvd-step__ic,
    .qvd-item,
    .qvd-item__play,
    .qvd-all {
        transition: none;
    }

    .qvd-step:hover,
    .qvd-step--prev:hover .qvd-step__ic,
    .qvd-step--next:hover .qvd-step__ic {
        transform: none;
    }
}
