/* ================================================================
   Video Reel Widget — Frontend Styles
   Aesthetic: Dark cinematic minimal, inspired by Shorts/TikTok
================================================================ */

/* ── Container ── */
.vrw-reel {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: #000;
    border-radius: 16px;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    box-shadow:
        0 4px 6px -1px rgba(0,0,0,.4),
        0 0 0 1px rgba(255,255,255,.06);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.vrw-reel:active { cursor: grabbing; }

/* ── Track (horizontal slider) ── */
.vrw-track {
    display: flex;
    height: 100%;
    will-change: transform;
    transition: transform .38s cubic-bezier(.4,0,.2,1);
}

.vrw-reel.is-dragging .vrw-track {
    transition: none;
}

/* ── Individual Slide ── */
.vrw-slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

/* ── Video element ── */
.vrw-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: #111;
}

/* ── Gradient overlay for readability ── */
.vrw-slide::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0,0,0,.15) 0%,
        transparent 35%,
        transparent 55%,
        rgba(0,0,0,.55) 100%
    );
    pointer-events: none;
    z-index: 1;
}

/* ── Controls overlay ── */
.vrw-controls {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    padding: 14px 14px 40px;
    pointer-events: none;
}

/* ── Counter badge ── */
.vrw-counter {
    display: flex;
    align-items: center;
    gap: 2px;
    background: rgba(0,0,0,.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    letter-spacing: .5px;
    pointer-events: none;
    line-height: 1.4;
}

.vrw-sep {
    opacity: .5;
    margin: 0 1px;
}

/* ── Button stack (right side) ── */
.vrw-btn-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: all;
}

/* ── Buttons ── */
.vrw-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,.18);
    background: rgba(0,0,0,.45);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    outline: none;
    transition:
        transform .15s ease,
        background .15s ease,
        border-color .15s ease;
    -webkit-tap-highlight-color: transparent;
}

.vrw-btn:hover {
    background: rgba(255,255,255,.18);
    border-color: rgba(255,255,255,.4);
    transform: scale(1.08);
}

.vrw-btn:active {
    transform: scale(.93);
}

.vrw-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Mute icon visibility */
.vrw-btn-mute .icon-unmuted { display: none; }
.vrw-btn-mute .icon-muted   { display: block; }

.vrw-btn-mute:not(.is-muted) .icon-muted   { display: none; }
.vrw-btn-mute:not(.is-muted) .icon-unmuted { display: block; }

/* Play/Pause icon visibility */
.vrw-btn-play .icon-play  { display: none; }
.vrw-btn-play .icon-pause { display: block; }

.vrw-btn-play:not(.is-playing) .icon-pause { display: none; }
.vrw-btn-play:not(.is-playing) .icon-play  { display: block; }

/* ── Progress bar ── */
.vrw-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255,255,255,.18);
    z-index: 20;
    overflow: hidden;
    border-radius: 0 0 16px 16px;
}

.vrw-progress-bar {
    height: 100%;
    width: 0%;
    background: #fff;
    border-radius: 0 0 16px 16px;
    transition: width .1s linear;
    will-change: width;
}

/* ── Swipe hint animation ── */
.vrw-swipe-hint {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 30;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: rgba(255,255,255,.85);
    pointer-events: none;
    animation: vrw-hint-fade 2.2s ease forwards;
    animation-delay: .8s;
    opacity: 0;
}

.vrw-swipe-hint svg {
    width: 32px;
    height: 32px;
    animation: vrw-hint-slide 1.1s ease-in-out infinite;
}

.vrw-swipe-hint span {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

@keyframes vrw-hint-fade {
    0%   { opacity: 0; }
    15%  { opacity: 1; }
    75%  { opacity: 1; }
    100% { opacity: 0; }
}

@keyframes vrw-hint-slide {
    0%, 100% { transform: translateX(0); }
    50%       { transform: translateX(8px); }
}

/* ── Loading spinner ── */
.vrw-video-loading .vrw-video::after {
    content: '';
    position: absolute;
    inset: 0;
    margin: auto;
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255,255,255,.15);
    border-top-color: #fff;
    border-radius: 50%;
    animation: vrw-spin .7s linear infinite;
}

@keyframes vrw-spin {
    to { transform: rotate(360deg); }
}

/* ── Tap-to-play overlay (big play icon center) ── */
.vrw-tap-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 15;
    pointer-events: none;
    opacity: 0;
    transition: opacity .25s ease;
}

.vrw-tap-play.visible {
    opacity: 1;
}

.vrw-tap-play svg {
    width: 64px;
    height: 64px;
    color: rgba(255,255,255,.8);
    filter: drop-shadow(0 2px 12px rgba(0,0,0,.6));
}

/* ── Slide transition: fade active state ── */
.vrw-slide {
    opacity: .3;
    transition: opacity .3s ease;
}
.vrw-slide.is-active {
    opacity: 1;
}

/* ── Edge nav arrows (keyboard / pointer hint) ── */
.vrw-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 20;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0,0,0,.4);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,.15);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity .2s ease, transform .2s ease;
    pointer-events: none;
}

.vrw-reel:hover .vrw-arrow { opacity: 1; pointer-events: all; }
.vrw-arrow:hover { transform: translateY(-50%) scale(1.12); }

.vrw-arrow-prev { left: 8px; }
.vrw-arrow-next { right: 8px; }

.vrw-arrow svg {
    width: 14px;
    height: 14px;
}

/* ── Responsive tweaks ── */
@media (max-width: 480px) {
    .vrw-reel {
        border-radius: 12px;
    }
}

/* ================================================================
   FULLSCREEN MODE
================================================================ */

/* Fullscreen icon visibility */
.vrw-btn-fullscreen .icon-exit-fs { display: none; }
.vrw-btn-fullscreen .icon-enter-fs { display: block; }

.vrw-btn-fullscreen.is-fullscreen .icon-enter-fs { display: none; }
.vrw-btn-fullscreen.is-fullscreen .icon-exit-fs  { display: block; }

/* When reel is fullscreen element */
.vrw-reel:fullscreen,
.vrw-reel:-webkit-full-screen,
.vrw-reel:-moz-full-screen,
.vrw-reel:-ms-fullscreen {
    width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
    background: #000;
}

/* Fullscreen: scale up controls */
.vrw-reel:fullscreen .vrw-btn,
.vrw-reel:-webkit-full-screen .vrw-btn,
.vrw-reel:-moz-full-screen .vrw-btn {
    width: 52px;
    height: 52px;
}

.vrw-reel:fullscreen .vrw-btn svg,
.vrw-reel:-webkit-full-screen .vrw-btn svg,
.vrw-reel:-moz-full-screen .vrw-btn svg {
    width: 22px;
    height: 22px;
}

.vrw-reel:fullscreen .vrw-controls,
.vrw-reel:-webkit-full-screen .vrw-controls,
.vrw-reel:-moz-full-screen .vrw-controls {
    padding: 20px 20px 60px;
}

.vrw-reel:fullscreen .vrw-counter,
.vrw-reel:-webkit-full-screen .vrw-counter,
.vrw-reel:-moz-full-screen .vrw-counter {
    font-size: 14px;
    padding: 6px 14px;
}

.vrw-reel:fullscreen .vrw-progress,
.vrw-reel:-webkit-full-screen .vrw-progress,
.vrw-reel:-moz-full-screen .vrw-progress {
    height: 4px;
    border-radius: 0;
}

/* Fullscreen arrow buttons */
.vrw-reel:fullscreen .vrw-arrow,
.vrw-reel:-webkit-full-screen .vrw-arrow,
.vrw-reel:-moz-full-screen .vrw-arrow {
    width: 44px;
    height: 44px;
    opacity: 1;
    pointer-events: all;
}

.vrw-reel:fullscreen .vrw-arrow svg,
.vrw-reel:-webkit-full-screen .vrw-arrow svg,
.vrw-reel:-moz-full-screen .vrw-arrow svg {
    width: 20px;
    height: 20px;
}

/* Fullscreen: video center crop */
.vrw-reel:fullscreen .vrw-video,
.vrw-reel:-webkit-full-screen .vrw-video,
.vrw-reel:-moz-full-screen .vrw-video {
    object-fit: contain; /* show full video in fullscreen without crop */
}

/* Fullscreen ESC hint */
.vrw-fs-hint {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 40;
    background: rgba(0,0,0,.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 11px;
    font-weight: 500;
    color: rgba(255,255,255,.8);
    letter-spacing: .5px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    display: none;
}

.vrw-reel:fullscreen .vrw-fs-hint,
.vrw-reel:-webkit-full-screen .vrw-fs-hint,
.vrw-reel:-moz-full-screen .vrw-fs-hint {
    display: block;
    animation: vrw-hint-fade 3s ease forwards;
    animation-delay: .3s;
}

