/* Video tutorials index design layer.
 *
 * The presentation layer for Components/Pages/VideoTutorialsIndex.razor. Global
 * CSS, linked from App.razor — it was Blazor-scoped until the stylesheets were
 * consolidated under wwwroot/css. The same two rules pages/home.css,
 * pages/saas-pricing.css, pages/blog-index.css and pages/help-center.css call
 * out apply:
 *
 * 1. Nothing confines these rules to this page any more, so every selector is
 *    qv- prefixed or a descendant of one.
 * 2. @keyframes names are global too. Hence the qv- prefix on
 *    every one, so they cannot collide with the compiled Tailwind bundle, with
 *    Home's qh- animations, pricing's qp- ones, the blog's qb- ones or the help
 *    centre's qc- ones.
 *
 * 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 shared with the pricing, blog and help-centre pages:
 * #a22dea (magenta-violet) → #7b5ee5 → #5b5de2 (indigo-blue), with #4f46e5 →
 * #7c3aed as the primary. No hue from outside that ramp appears on this page.
 *
 * Reading order the layout is built around: hero → one uniform grid of video
 * cards. Nothing is promoted into a featured slot and there is no filter rail —
 * the collection is a short ordered curriculum, so re-sorting it would work
 * against the "step by step" framing the hero sets.
 */

/* ── hero ───────────────────────────────────────────────────────────── */
.qv-hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, #fff 0%, #fbfaff 44%, #f3f1fe 100%);
    padding: 76px 0 62px;
}

.qv-hero__aurora,
.qv-hero__grid {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.qv-hero__aurora i {
    position: absolute;
    display: block;
    border-radius: 50%;
    filter: blur(90px);
    opacity: .72;
    animation: qv-drift 26s ease-in-out infinite;
}

.qv-hero__aurora i:nth-child(1) {
    width: 720px;
    height: 720px;
    top: -400px;
    right: -200px;
    background: radial-gradient(circle, rgba(129, 140, 248, .28), transparent 62%);
}

.qv-hero__aurora i:nth-child(2) {
    width: 560px;
    height: 560px;
    bottom: -300px;
    left: -200px;
    animation-delay: -9s;
    background: radial-gradient(circle, rgba(167, 139, 250, .26), transparent 62%);
}

.qv-hero__aurora i:nth-child(3) {
    width: 440px;
    height: 440px;
    top: 24%;
    left: 44%;
    animation-delay: -16s;
    background: radial-gradient(circle, rgba(162, 45, 234, .16), transparent 62%);
}

@keyframes qv-drift {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33%      { transform: translate(-46px, 38px) scale(1.08); }
    66%      { transform: translate(38px, -28px) scale(.94); }
}

.qv-hero__grid {
    opacity: .5;
    background-image: radial-gradient(circle at 1px 1px, rgba(79, 70, 229, .24) 1.1px, transparent 0);
    background-size: 22px 22px;
    -webkit-mask-image: radial-gradient(ellipse 58% 46% at 50% 8%, #000, transparent 72%);
    mask-image: radial-gradient(ellipse 58% 46% at 50% 8%, #000, transparent 72%);
}

.qv-hero__inner {
    position: relative;
    z-index: 5;
    max-width: 830px;
    margin: 0 auto;
    text-align: center;
}

/* ── eyebrow ────────────────────────────────────────────────────────── */
.qv-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 8px 17px 8px 9px;
    margin-bottom: 26px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: #fff;
    background: linear-gradient(100deg, #4f46e5, #7c3aed 55%, #a855f7);
    box-shadow: 0 12px 30px -12px rgba(99, 102, 241, .85);
}

.qv-eyebrow__pip {
    width: 22px;
    height: 22px;
    border-radius: 99px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    color: #fff;
    background: rgba(255, 255, 255, .22);
    animation: qv-pulse 2.8s ease-in-out infinite;
}

/* The glyph is a solid triangle, so it reads a touch heavy next to the
   stroked pips on the sibling pages — nudged down a step to compensate. */
.qv-eyebrow__pip svg {
    width: 11px;
    height: 11px;
    fill: currentColor;
    margin-left: 1px;
}

@keyframes qv-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, .38); }
    50%      { box-shadow: 0 0 0 6px rgba(255, 255, 255, 0); }
}

.qv-hero__title {
    font-size: clamp(32px, 4.2vw, 54px);
    line-height: 1.08;
    letter-spacing: -.035em;
    font-weight: 800;
    color: #0b1020;
    margin: 0 0 20px;
}

.qv-accent {
    background: linear-gradient(96deg, #4f46e5 0%, #7c3aed 46%, #a22dea 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.qv-hero__lede {
    font-size: clamp(15.5px, 1.2vw, 17.5px);
    line-height: 1.65;
    color: #64748b;
    max-width: 620px;
    margin: 0 auto;
}

/* Counts, not claims — both numbers are derived from the published rows. */
.qv-stats {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 14px 40px;
    margin: 34px 0 0;
    padding: 0;
    list-style: none;
}

.qv-stats li {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.qv-stats b {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -.02em;
    line-height: 1.1;
    background: linear-gradient(96deg, #4f46e5, #a22dea);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.qv-stats span {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: #94a3b8;
}

/* ── list ───────────────────────────────────────────────────────────── */
.qv-list {
    position: relative;
    padding: 62px 0 92px;
    background: linear-gradient(180deg, #fff 0%, #fbfaff 100%);
}

.qv-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.qv-card {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 24px;
    background: #fff;
    border: 1px solid #eae9f6;
    box-shadow: 0 20px 44px -32px rgba(15, 23, 42, .4);
    transition: transform .3s cubic-bezier(.2, .8, .2, 1), box-shadow .3s, border-color .3s;
}

.qv-card:hover {
    transform: translateY(-6px);
    border-color: #d8d5f6;
    box-shadow: 0 36px 72px -34px rgba(79, 70, 229, .45);
}

/* Keyboard users get the same affordance the pointer does — the card is the
   link, so the focus ring belongs on the card and not on an inner element. */
.qv-card:focus-visible {
    outline: 3px solid #7c3aed;
    outline-offset: 3px;
}

.qv-card__media {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    /* Shows through while the thumbnail loads and 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 card. */
    background: linear-gradient(135deg, #7b5ee5, #a22dea 52%, #5b5de2);
}

.qv-card__media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s cubic-bezier(.2, .8, .2, 1);
}

.qv-card:hover .qv-card__media img { transform: scale(1.06); }

.qv-card__scrim {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(11, 16, 32, .28) 0%, rgba(11, 16, 32, 0) 42%),
        linear-gradient(0deg, rgba(11, 16, 32, .55) 0%, rgba(11, 16, 32, 0) 46%);
    transition: opacity .3s;
}

.qv-card:hover .qv-card__scrim { opacity: .82; }

/* ── play button ────────────────────────────────────────────────────── */
.qv-card__play {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 58px;
    height: 58px;
    margin: -29px 0 0 -29px;
    border-radius: 99px;
    display: grid;
    place-items: center;
    color: #4f46e5;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: 0 16px 34px -14px rgba(2, 6, 23, .75);
    transition: transform .3s cubic-bezier(.2, .8, .2, 1), color .25s, background .25s, box-shadow .3s;
}

/* Optical centring: a triangle's visual mass sits left of its bounding box. */
.qv-card__play svg {
    width: 22px;
    height: 22px;
    margin-left: 3px;
}

.qv-card:hover .qv-card__play {
    color: #fff;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    transform: scale(1.08);
    box-shadow: 0 22px 44px -16px rgba(79, 70, 229, .95);
}

/* The halo is a pseudo-element so the ring can animate while the button
   itself stays put — scaling the button would drag the glyph with it. */
.qv-card__play::after {
    content: "";
    position: absolute;
    inset: -6px;
    border-radius: 99px;
    border: 1.5px solid rgba(255, 255, 255, .5);
    opacity: 0;
    transition: opacity .3s;
}

.qv-card:hover .qv-card__play::after {
    opacity: 1;
    animation: qv-halo 2.4s ease-out infinite;
}

@keyframes qv-halo {
    0%   { transform: scale(1);    opacity: .75; }
    70%  { transform: scale(1.35); opacity: 0; }
    100% { transform: scale(1.35); opacity: 0; }
}

/* ── duration chip ──────────────────────────────────────────────────── */
.qv-card__time {
    position: absolute;
    right: 14px;
    bottom: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .01em;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    color: #fff;
    background: rgba(17, 12, 46, .72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, .18);
}

.qv-card__time svg {
    width: 12px;
    height: 12px;
    flex: 0 0 auto;
    opacity: .85;
}

/* ── card body ──────────────────────────────────────────────────────── */
.qv-card__body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    padding: 20px 22px 18px;
    min-width: 0;
}

.qv-card__title {
    font-size: 16.5px;
    line-height: 1.42;
    font-weight: 750;
    letter-spacing: -.015em;
    color: #0b1020;
    margin: 0 0 16px;
    transition: color .2s;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.qv-card:hover .qv-card__title { color: #4f46e5; }

.qv-card__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid #f1eefb;
}

.qv-card__cta {
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: .01em;
    color: #7c3aed;
}

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

.qv-card__arrow svg { width: 15px; height: 15px; }

.qv-card:hover .qv-card__arrow {
    color: #fff;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    transform: translateX(3px);
}

/* ── empty state ────────────────────────────────────────────────────── */
.qv-empty {
    max-width: 520px;
    margin: 0 auto;
    padding: 62px 32px;
    text-align: center;
    border-radius: 24px;
    background: #fff;
    border: 1px dashed #ddd9f2;
}

.qv-empty__ic {
    width: 56px;
    height: 56px;
    margin: 0 auto 20px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    color: #7c3aed;
    background: #f6f1ff;
}

.qv-empty__ic svg { width: 26px; height: 26px; }

.qv-empty h2 {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -.02em;
    color: #0b1020;
    margin: 0 0 10px;
}

.qv-empty p {
    font-size: 14px;
    line-height: 1.7;
    color: #64748b;
    margin: 0;
}

/* ── responsive ─────────────────────────────────────────────────────── */
@media (max-width: 1080px) {
    .qv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
    .qv-hero { padding: 56px 0 44px; }
    .qv-stats { gap: 12px 26px; }

    .qv-list { padding: 44px 0 62px; }
    .qv-grid { grid-template-columns: minmax(0, 1fr); }

    .qv-card__play {
        width: 52px;
        height: 52px;
        margin: -26px 0 0 -26px;
    }

    .qv-card__play svg { width: 20px; height: 20px; }
}

/* Touch devices never fire :hover in a way that helps here — the play button
   would sit in its resting state until tapped, which is one tap too late for
   the primary affordance on the card. Promote it to the hover treatment. */
@media (hover: none) {
    .qv-card__play {
        color: #fff;
        background: linear-gradient(135deg, #4f46e5, #7c3aed);
    }

    .qv-card__play::after { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .qv-hero__aurora i,
    .qv-eyebrow__pip { animation: none !important; }

    .qv-card:hover .qv-card__play::after { animation: none; }

    .qv-card,
    .qv-card__media img,
    .qv-card__scrim,
    .qv-card__play,
    .qv-card__arrow {
        transition: none;
    }

    .qv-card:hover,
    .qv-card:hover .qv-card__media img,
    .qv-card:hover .qv-card__play,
    .qv-card:hover .qv-card__arrow {
        transform: none;
    }
}
