/* =============================================================================
   Product Video Library — Alternating Vertical Lanes Gallery Carousel
   Spec: Full-width dark canvas, spatially fixed gallery container,
         independent vertical lanes moving in alternating directions (↑ ↓ ↑ ↓ ↑),
         deliberately staggered vertical column offsets (no boring straight lines),
         tall portrait cards with clean, decluttered metadata (video is hero),
         seamless continuous linear vertical loop (translate3d(0, Y, 0)),
         pause & spotlight focus on video hover, vertical gradient fade mask.
   ========================================================================== */

.review-reel {
    position: relative;
    overflow: hidden;
    background: #000 !important;
    padding: var(--space-20) 0 var(--space-24);
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Ensure site-feature-canvas retains dark tone */
.site-feature-canvas .review-reel {
    background: #000 !important;
}

/* Centered Original Header */
.review-reel__header {
    width: min(1180px, calc(100% - var(--space-10)));
    margin: 0 auto var(--space-12);
    text-align: center;
    position: relative;
    z-index: var(--z-raised);
}

.review-reel__eyebrow {
    margin: 0 0 var(--space-4);
    color: var(--brand-blue-tint);
    font-family: var(--font-sans);
    font-size: var(--text-2xs);
    font-weight: var(--weight-semibold);
    letter-spacing: var(--tracking-wider);
    text-transform: uppercase;
}

.review-reel__title {
    margin: 0;
}

.review-reel__title.landing-section-title {
    font-size: var(--text-5xl);
    line-height: var(--leading-display);
}

.review-reel__intro {
    max-width: 820px;
    margin: var(--space-4) auto 0;
    color: var(--text-secondary);
    font-size: var(--text-xl);
    font-weight: var(--weight-medium);
    line-height: var(--leading-normal);
    text-wrap: balance;
}

/* Gallery Container: Spatially Fixed with Vertical Gradient Fade Mask */
.vertical-gallery-wrapper {
    position: relative;
    width: min(1240px, 80vw);
    margin: 0 auto;
    overflow: hidden;
    mask-image: linear-gradient(
        to bottom,
        transparent 0%,
        #000 14%,
        #000 84%,
        transparent 100%
    );
    -webkit-mask-image: linear-gradient(
        to bottom,
        transparent 0%,
        #000 14%,
        #000 84%,
        transparent 100%
    );
}

/* 4 to 5 Independent Vertical Lanes Grid (Fixed Spatially) */
.vertical-gallery {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--space-4);
    height: clamp(560px, 68vh, 640px);
    width: 100%;
    align-items: start;
}

/* Show 5th lane on large screens */
@media (min-width: 1400px) {
    .vertical-gallery {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

/* Hide 5th lane on standard desktop (keeps 4 spacious columns, eliminates clutter) */
@media (max-width: 1399px) {
    .vertical-lane:nth-child(5) {
        display: none;
    }
}

/* Individual Vertical Lane */
.vertical-lane {
    position: relative;
    height: 100%;
    overflow: hidden;
    min-width: 0;
}

/* Intentional Staggered Column Offsets (Lệch nhau có sắp xếp chủ đích) */
.vertical-lane[data-lane="1"] {
    margin-top: 0;
}

.vertical-lane[data-lane="2"] {
    margin-top: var(--space-12);
}

.vertical-lane[data-lane="3"] {
    margin-top: calc(var(--space-6) * -1);
}

.vertical-lane[data-lane="4"] {
    margin-top: var(--space-16);
}

.vertical-lane[data-lane="5"] {
    margin-top: var(--space-6);
}

/* Inner Conveyor Track */
.vertical-lane__track {
    display: flex;
    flex-direction: column;
    width: 100%;
    will-change: transform;
}

/* Upward Movement (bottom -> top) */
.vertical-lane--up .vertical-lane__track {
    animation: verticalScrollUp 32s linear infinite;
}

/* Downward Movement (top -> bottom) */
.vertical-lane--down .vertical-lane__track {
    animation: verticalScrollDown 36s linear infinite;
}

/* Deliberate Phase & Speed Staggering across lanes (↑ ↓ ↑ ↓ ↑) */
.vertical-lane[data-lane="1"] .vertical-lane__track {
    animation-duration: 30s;
    animation-delay: 0s;
}

.vertical-lane[data-lane="2"] .vertical-lane__track {
    animation-duration: 36s;
    animation-delay: -16s;
}

.vertical-lane[data-lane="3"] .vertical-lane__track {
    animation-duration: 28s;
    animation-delay: -8s;
}

.vertical-lane[data-lane="4"] .vertical-lane__track {
    animation-duration: 38s;
    animation-delay: -22s;
}

.vertical-lane[data-lane="5"] .vertical-lane__track {
    animation-duration: 32s;
    animation-delay: -12s;
}

/* Hover Pause: Stop all vertical conveyor belts when hovering */
.vertical-gallery:hover .vertical-lane__track,
.vertical-gallery.is-paused .vertical-lane__track,
.vertical-lane.is-paused .vertical-lane__track {
    animation-play-state: paused !important;
}

/* Card Sequence Group (Group A and Group B clone are identical in height) */
.vertical-lane__group {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    padding-bottom: var(--space-4);
    flex-shrink: 0;
}

/* Clean, Decluttered Portrait Ad Card */
.ad-card {
    display: flex;
    flex-direction: column;
    height: clamp(380px, 48vh, 440px);
    background: var(--surface-low);
    border-radius: var(--radius-card);
    padding: var(--space-3);
    overflow: hidden;
    box-sizing: border-box;
    border: 1px solid rgb(var(--ch-white) / var(--a-08));
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform var(--dur-moderate) var(--ease-out),
                box-shadow var(--dur-moderate) ease,
                border-color var(--dur-base) ease,
                opacity var(--dur-base) ease;
}

/* Hover & Subtle Focus state: gentle lift and clean border highlight */
.ad-card:hover,
.ad-card.is-focused {
    z-index: 20;
    transform: scale(1.02);
    border-color: rgb(var(--ch-brand-blue-tint) / var(--a-42));
    box-shadow: 0 10px 28px rgb(var(--ch-black) / var(--a-55)), 0 0 16px rgb(var(--ch-brand-blue) / var(--a-14));
}

/* Gentle Focus: slightly lower opacity of siblings without darkening background */
.vertical-gallery.has-focus .ad-card:not(.is-focused) {
    opacity: 0.72;
}

/* Card Header: Minimal Brand info + Active status */
.ad-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-2);
    flex-shrink: 0;
}

.ad-card__brand {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    min-width: 0;
}

.ad-card__avatar {
    width: 22px;
    height: 22px;
    border-radius: var(--radius-full);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-2xs);
    font-weight: var(--weight-bold);
    color: #fff;
    box-shadow: 0 2px 6px rgb(var(--ch-black) / var(--a-42));
}

.ad-card__name {
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ad-card__status {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    height: 16px;
    padding: 0 var(--space-1);
    border-radius: var(--radius-full);
    background: rgb(var(--ch-white) / var(--a-04));
    color: rgb(var(--ch-white) / var(--a-72));
    font-size: 9px;
    font-weight: var(--weight-medium);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
    flex-shrink: 0;
    border: 1px solid rgb(var(--ch-white) / var(--a-08));
    line-height: 1;
}

.ad-card__status-dot {
    width: 4px;
    height: 4px;
    border-radius: var(--radius-full);
    background: hsl(145, 75%, 52%);
    box-shadow: 0 0 4px hsl(145, 75%, 52%);
}

/* Video Frame with Sleek Floating Glass Metric Pill (Dominates 85%+ of card) */
.ad-card__video-wrap {
    position: relative;
    flex: 1;
    min-height: 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #000;
}

.ad-card__video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

/* Clean Floating Glass Metric Pill */
.ad-card__metric-pill {
    position: absolute;
    bottom: var(--space-3);
    left: var(--space-3);
    right: var(--space-3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    background: rgb(var(--ch-black) / var(--a-72));
    border: 1px solid rgb(var(--ch-white) / var(--a-14));
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    backdrop-filter: blur(var(--blur-sm));
    -webkit-backdrop-filter: blur(var(--blur-sm));
    pointer-events: none;
    box-shadow: 0 4px 16px rgb(var(--ch-black) / var(--a-55));
}

.ad-card__metric-views {
    font-size: var(--text-2xs);
    font-weight: var(--weight-medium);
    color: rgb(var(--ch-white) / var(--a-85));
    white-space: nowrap;
}

.ad-card__metric-sep {
    font-size: var(--text-2xs);
    color: rgb(var(--ch-white) / var(--a-42));
}

.ad-card__metric-val {
    font-size: var(--text-2xs);
    font-weight: var(--weight-bold);
    color: hsl(145, 75%, 52%);
    white-space: nowrap;
}

/* Viral Micro-Interactions Layer (Flying Emojis & Comment Popups) */
.ad-card__viral-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 10;
}

/* Floating Emoji Reactions (Hearts, Fires, Rockets jumping up) */
.ad-card__reaction {
    position: absolute;
    bottom: var(--space-8);
    right: var(--space-4);
    font-size: var(--text-2xl);
    pointer-events: none;
    user-select: none;
    animation: reactionFloat 2.2s ease-out forwards;
    filter: drop-shadow(0 2px 12px rgb(var(--ch-black) / var(--a-85)));
    z-index: 12;
}

@keyframes reactionFloat {
    0% {
        opacity: 0;
        transform: translate3d(0, 0, 0) scale(0.6) rotate(0deg);
    }
    15% {
        opacity: 1;
        transform: translate3d(-10px, -30px, 0) scale(1.3) rotate(-14deg);
    }
    45% {
        opacity: 0.95;
        transform: translate3d(12px, -90px, 0) scale(1.15) rotate(10deg);
    }
    75% {
        opacity: 0.8;
        transform: translate3d(-8px, -160px, 0) scale(1) rotate(-8deg);
    }
    100% {
        opacity: 0;
        transform: translate3d(10px, -230px, 0) scale(0.8) rotate(14deg);
    }
}

/* Viral Comment Toast Popups */
.ad-card__comment-toast {
    position: absolute;
    top: var(--space-3);
    left: var(--space-3);
    right: var(--space-3);
    display: flex;
    align-items: center;
    gap: var(--space-2);
    background: rgb(var(--ch-black) / var(--a-95));
    border: 1px solid rgb(var(--ch-white) / var(--a-14));
    border-radius: var(--radius-full);
    padding: var(--space-2) var(--space-3);
    backdrop-filter: blur(var(--blur-sm));
    -webkit-backdrop-filter: blur(var(--blur-sm));
    box-shadow: 0 8px 24px rgb(var(--ch-black) / var(--a-85)), 0 0 16px rgb(var(--ch-brand-blue) / var(--a-42));
    z-index: 15;
    pointer-events: none;
    animation: commentSlideFade 3.8s ease-in-out forwards;
}

.ad-card__comment-avatar {
    width: 20px;
    height: 20px;
    border-radius: var(--radius-full);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-2xs);
    font-weight: var(--weight-bold);
    color: #fff;
    box-shadow: 0 2px 6px rgb(var(--ch-black) / var(--a-42));
}

.ad-card__comment-text {
    font-size: var(--text-xs);
    color: rgb(var(--ch-white) / var(--a-95));
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: var(--weight-medium);
}

@keyframes commentSlideFade {
    0% {
        opacity: 0;
        transform: translate3d(0, -14px, 0) scale(0.88);
    }
    10% {
        opacity: 1;
        transform: translate3d(0, 2px, 0) scale(1.03);
    }
    16% {
        transform: translate3d(0, 0, 0) scale(1);
    }
    82% {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate3d(0, -10px, 0) scale(0.92);
    }
}

/* Dynamic Live Metric Increments & Pulse */
.ad-card__metric-pill {
    transition: border-color var(--dur-base) ease, box-shadow var(--dur-base) ease, transform var(--dur-base) ease;
}

.ad-card__metric-pill.is-ticking {
    border-color: hsl(145, 75%, 52%) !important;
    box-shadow: 0 0 20px rgb(var(--ch-brand-blue) / var(--a-85)), 0 4px 16px rgb(var(--ch-black) / var(--a-72)) !important;
    transform: scale(1.05);
}

.ad-card__metric-views,
.ad-card__metric-val {
    transition: color var(--dur-base) ease, transform var(--dur-base) ease;
}

.ad-card__metric-views.is-incrementing,
.ad-card__metric-val.is-incrementing {
    color: hsl(145, 75%, 52%) !important;
    transform: scale(1.1);
}

.ad-card__metric-delta {
    position: absolute;
    top: -18px;
    right: var(--space-3);
    font-size: var(--text-2xs);
    font-weight: var(--weight-bold);
    color: hsl(145, 75%, 52%);
    background: rgb(var(--ch-black) / var(--a-85));
    border: 1px solid hsl(145, 75%, 52%);
    border-radius: var(--radius-full);
    padding: 0 var(--space-2);
    animation: deltaFloat 1.2s ease-out forwards;
    pointer-events: none;
    box-shadow: 0 0 10px rgb(var(--ch-brand-blue) / var(--a-42));
}

@keyframes deltaFloat {
    0% {
        opacity: 0;
        transform: translate3d(0, 6px, 0) scale(0.85);
    }
    25% {
        opacity: 1;
        transform: translate3d(0, -2px, 0) scale(1.1);
    }
    75% {
        opacity: 1;
        transform: translate3d(0, -10px, 0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate3d(0, -22px, 0) scale(0.9);
    }
}

/* Seamless Vertical Scroll Keyframes */
@keyframes verticalScrollUp {
    0% {
        transform: translate3d(0, 0, 0);
    }
    100% {
        transform: translate3d(0, -50%, 0);
    }
}

@keyframes verticalScrollDown {
    0% {
        transform: translate3d(0, -50%, 0);
    }
    100% {
        transform: translate3d(0, 0, 0);
    }
}

/* Responsive Breakpoints */
@media (max-width: 1023px) {
    .vertical-gallery-wrapper {
        width: min(100%, calc(100% - var(--space-8)));
    }

    /* 3 Lanes on Tablet: Lanes 1 (↑), 2 (↓), 3 (↑) */
    .vertical-gallery {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        height: clamp(520px, 66vh, 600px);
        gap: var(--space-3);
    }

    .vertical-lane:nth-child(n+4) {
        display: none;
    }

    .vertical-lane[data-lane="2"] {
        margin-top: var(--space-8);
    }
}

@media (max-width: 639px) {
    .review-reel {
        padding: var(--space-12) 0 var(--space-16);
    }

    .review-reel__header {
        margin-bottom: var(--space-8);
    }

    /* 2 Lanes on Mobile: Lanes 1 (↑), 2 (↓) */
    .vertical-gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: var(--space-2);
        height: clamp(440px, 64vh, 520px);
    }

    .vertical-lane:nth-child(n+3) {
        display: none;
    }

    .vertical-lane[data-lane="2"] {
        margin-top: var(--space-6);
    }

    .ad-card {
        padding: var(--space-2);
        height: clamp(260px, 38vh, 310px);
    }

    .ad-card__metric-pill {
        bottom: var(--space-2);
        left: var(--space-2);
        right: var(--space-2);
        padding: var(--space-1) var(--space-2);
        gap: var(--space-1);
    }
}

@media (prefers-reduced-motion: reduce) {
    .vertical-lane__track {
        animation: none;
        overflow-y: auto;
    }

    .ad-card {
        transition: none;
    }
}
