﻿.custom-video {
    --cv-accent-1: #6366f1;
    --cv-accent-2: #a855f7;
    --cv-accent-3: #06b6d4;
    --cv-radius: 22px;
    --cv-radius-sm: 14px;
    --cv-bg: rgba(255, 255, 255, 0.55);
    --cv-bg-strong: rgba(255, 255, 255, 0.85);
    --cv-border: rgba(0, 0, 0, 0.10);
    --cv-text: #0f172a;
    --cv-text-dim: rgba(15, 23, 42, 0.60);
    --cv-track: rgba(15, 23, 42, 0.15);
    --cv-buffer: rgba(15, 23, 42, 0.25);
    --cv-shadow: 0 18px 50px rgba(15, 23, 42, 0.18), 0 0 0 1px rgba(0,0,0,0.04) inset;
    --cv-vol-bar-empty: rgba(15, 23, 42, 0.28);
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    max-width: 960px;
    margin: 24px auto;
    border-radius: var(--cv-radius) var(--cv-radius) 0 0;
    background: var(--cv-bg);
    backdrop-filter: blur(22px) saturate(160%);
    -webkit-backdrop-filter: blur(22px) saturate(160%);
    border: 1px solid var(--cv-border);
    box-shadow: var(--cv-shadow);
    color: var(--cv-text);
    user-select: none;
    isolation: isolate;
    overflow:hidden;
}

    [data-theme="dark"] .custom-video,
    .custom-video.custom-video-dark {
        --cv-bg: rgba(20, 20, 35, 0.55);
        --cv-bg-strong: rgba(15, 15, 28, 0.85);
        --cv-border: rgba(255, 255, 255, 0.14);
        --cv-text: #ffffff;
        --cv-text-dim: rgba(255, 255, 255, 0.65);
        --cv-track: rgba(255, 255, 255, 0.18);
        --cv-buffer: rgba(255, 255, 255, 0.28);
        --cv-shadow: 0 18px 50px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255,255,255,0.05) inset;
        --cv-vol-bar-empty: rgba(255, 255, 255, 0.18);
    }

    .custom-video::before {
        content: "";
        position: absolute;
        inset: -40%;
        background: radial-gradient(circle at 15% 20%, rgba(99,102,241,0.45), transparent 45%), radial-gradient(circle at 85% 80%, rgba(168,85,247,0.40), transparent 50%), radial-gradient(circle at 50% 50%, rgba(6,182,212,0.25), transparent 55%);
        filter: blur(60px);
        z-index: -1;
        pointer-events: none;
        opacity: 0.9;
    }

/* =========================================================
   Stage (Video / Audio container)
   ========================================================= */
.custom-video-stage {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
}

.custom-video.custom-video-audio .custom-video-stage {
    aspect-ratio: 16 / 7;
}

.custom-video-stage video,
.custom-video-stage audio {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
    display: block;
}

    .custom-video-stage video::cue {
        background: rgba(0,0,0,0.75);
        color: #fff;
        font-family: inherit;
        font-size: 18px;
        padding: 4px 10px;
        border-radius: 6px;
    }

.custom-video-stage audio {
    opacity: 0;
    pointer-events: none;
    position: absolute;
    width: 1px;
    height: 1px;
}

/* =========================================================
   Poster
   ========================================================= */
.custom-video-poster {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transition: opacity .5s ease, transform .8s ease;
    z-index: 3;
}

    .custom-video-poster::after {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient(180deg, rgba(0,0,0,0.05) 0%, rgba(0,0,0,0.55) 100%);
    }

    .custom-video-poster.custom-video-hidden {
        opacity: 0;
        pointer-events: none;
        transform: scale(1.05);
    }

/* =========================================================
   Audio Visualizer
   ========================================================= */
.custom-video-audio-visual {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

    .custom-video-audio-visual::before {
        content: "";
        position: absolute;
        inset: 0;
        background-image: var(--cv-audio-poster, none);
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
        opacity: 0.55;
        filter: blur(2px) saturate(120%);
        transform: scale(1.08);
        z-index: 0;
    }

    .custom-video-audio-visual::after {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient( 180deg, rgba(0,0,0,0.35) 0%, rgba(0,0,0,0.55) 50%, rgba(0,0,0,0.75) 100% );
        z-index: 1;
    }

.custom-video-audio-inner {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 30px 30px 90px 30px;
    width: 100%;
    height: 100%;
    text-align: center;
    box-sizing: border-box;
}

.custom-video-audio-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: #fff;
    text-shadow: 0 2px 12px rgba(0,0,0,0.7);
    min-width: 0;
    align-items: center;
}

.custom-video-audio-meta-title {
    font-size: 22px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 480px;
}

.custom-video-audio-meta-sub {
    font-size: 13px;
    opacity: 0.9;
}

/* =========================================================
   Waves (Audio)
   ========================================================= */
.custom-video-waves {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 40%;
    max-height: 160px;
    min-height: 60px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 3px;
    padding: 0 18px 76px 18px;
    box-sizing: border-box;
    pointer-events: none;
    z-index: 2;
    overflow: hidden;
}

    .custom-video-waves .custom-video-wave-bar {
        display: block;
        flex: 1 1 0;
        min-width: 2px;
        max-width: 6px;
        border-radius: 3px 3px 2px 2px;
        background: linear-gradient(180deg, rgba(168, 85, 247, 0.95) 0%, rgba(99, 102, 241, 0.85) 55%, rgba(99, 102, 241, 0.45) 100%);
        box-shadow: 0 0 8px rgba(168,85,247,0.35);
        transform-origin: bottom center;
        height: var(--cv-wave-base, 8%);
        transition: height .35s cubic-bezier(.22,.61,.36,1);
        will-change: height;
    }

.custom-video.custom-video-paused .custom-video-wave-bar {
    transition: height .6s cubic-bezier(.25,.1,.25,1);
}

.custom-video.custom-video-stopped .custom-video-wave-bar {
    height: var(--cv-wave-base, 8%) !important;
    transition: height .7s cubic-bezier(.4,0,.2,1) !important;
    box-shadow: none;
    opacity: 0.35;
}

.custom-video.custom-video-playing .custom-video-wave-bar {
    animation-name: customVideoWave;
    animation-duration: var(--cv-wave-dur, 1.4s);
    animation-delay: var(--cv-wave-delay, 0s);
    animation-timing-function: ease-in-out;
    animation-iteration-count: infinite;
}

    .custom-video.custom-video-playing .custom-video-wave-bar[data-wave="1"] {
        animation-name: customVideoWave1;
    }

    .custom-video.custom-video-playing .custom-video-wave-bar[data-wave="2"] {
        animation-name: customVideoWave2;
    }

    .custom-video.custom-video-playing .custom-video-wave-bar[data-wave="3"] {
        animation-name: customVideoWave3;
    }

    .custom-video.custom-video-playing .custom-video-wave-bar[data-wave="4"] {
        animation-name: customVideoWave4;
    }

@keyframes customVideoWave {
    0%, 100% {
        height: var(--cv-wave-base, 8%);
        opacity: 0.55;
    }

    50% {
        height: 90%;
        opacity: 1;
    }
}

@keyframes customVideoWave1 {
    0%, 100% {
        height: var(--cv-wave-base, 8%);
        opacity: 0.6;
    }

    30% {
        height: 40%;
        opacity: 0.85;
    }

    70% {
        height: 75%;
        opacity: 1;
    }
}

@keyframes customVideoWave2 {
    0%, 100% {
        height: var(--cv-wave-base, 8%);
        opacity: 0.5;
    }

    25% {
        height: 75%;
        opacity: 1;
    }

    60% {
        height: 30%;
        opacity: 0.7;
    }
}

@keyframes customVideoWave3 {
    0%, 100% {
        height: var(--cv-wave-base, 8%);
        opacity: 0.65;
    }

    20% {
        height: 20%;
        opacity: 0.7;
    }

    55% {
        height: 95%;
        opacity: 1;
    }

    80% {
        height: 55%;
        opacity: 0.85;
    }
}

@keyframes customVideoWave4 {
    0%, 100% {
        height: var(--cv-wave-base, 8%);
        opacity: 0.55;
    }

    40% {
        height: 85%;
        opacity: 1;
    }

    65% {
        height: 35%;
        opacity: 0.75;
    }
}

/* =========================================================
   Center Play Button
   ========================================================= */
.custom-video-center-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 84px;
    height: 84px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.35);
    background: rgba(255,255,255,0.12);
    backdrop-filter: blur(14px) saturate(180%);
    -webkit-backdrop-filter: blur(14px) saturate(180%);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 4;
    transition: transform .3s ease, background .3s ease, box-shadow .3s ease;
    box-shadow: 0 10px 40px rgba(99,102,241,0.45), 0 0 0 1px rgba(255,255,255,0.1) inset;
}

    .custom-video-center-play:hover {
        transform: translate(-50%, -50%) scale(1.08);
        background: linear-gradient(135deg, var(--cv-accent-1), var(--cv-accent-2));
        box-shadow: 0 14px 50px rgba(168,85,247,0.55);
    }

    .custom-video-center-play svg {
        width: 34px;
        height: 34px;
        fill: #fff;
    }

.custom-video.custom-video-playing .custom-video-center-play {
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, -50%) scale(0.7);
}

.custom-video.custom-video-no-controls .custom-video-center-play {
    display: none;
}

/* =========================================================
   Loader
   ========================================================= */
.custom-video-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,0.2);
    border-top-color: #fff;
    animation: customVideoSpin 0.9s linear infinite;
    z-index: 5;
    display: none;
}

.custom-video.custom-video-loading .custom-video-loader {
    display: block;
}

.custom-video.custom-video-loading .custom-video-center-play {
    opacity: 0;
    visibility: hidden;
}

@keyframes customVideoSpin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* =========================================================
   Lock Toast
   ========================================================= */
.custom-video-lock-toast {
    position: absolute;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--cv-bg-strong);
    backdrop-filter: blur(14px);
    color: var(--cv-text);
    padding: 10px 18px;
    border-radius: 12px;
    font-size: 13px;
    border: 1px solid var(--cv-border);
    opacity: 0;
    pointer-events: none;
    transition: all .3s ease;
    z-index: 8;
    white-space: nowrap;
}

[dir="rtl"] .custom-video-lock-toast {
    direction: rtl;
}

.custom-video-lock-toast.custom-video-show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* =========================================================
   Header
   ========================================================= */
.custom-video-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: var(--cv-bg-strong);
    backdrop-filter: blur(22px);
    border-radius: var(--cv-radius) var(--cv-radius) 0 0;
    border-bottom: 1px solid var(--cv-border);
    font-size: 14px;
}

.custom-video-header-title {
    font-weight: 700;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.custom-video-badge {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--cv-accent-1), var(--cv-accent-2));
    color: #fff;
    font-weight: 600;
    letter-spacing: 0.3px;
    direction: ltr;
}

/* =========================================================
   Controls (Main)
   ========================================================= */
.custom-video-controls {
    direction: ltr;
    text-align: left;
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 14px 18px 16px;
    background: linear-gradient( 180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.35) 40%, rgba(0,0,0,0.75) 100% );
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 6;
    transition: opacity .45s cubic-bezier(.25,.1,.25,1), transform .45s cubic-bezier(.25,.1,.25,1);
    will-change: opacity, transform;
    color: #fff;
}

.custom-video.custom-video-controls-hidden .custom-video-controls {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

/* =========================================================
   Progress Bar
   ========================================================= */
.custom-video-progress {
    position: relative;
    height: 22px;
    display: flex;
    align-items: center;
    cursor: pointer;
    direction: ltr;
}

.custom-video-progress-track {
    position: relative;
    width: 100%;
    height: 6px;
    border-radius: 6px;
    background: rgba(255,255,255,0.25);
    overflow: visible;
    transition: height .2s ease;
}

.custom-video-progress:hover .custom-video-progress-track {
    height: 10px;
}

.custom-video-progress-buffer {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 0%;
    background: linear-gradient(90deg, rgba(6,182,212,0.55), rgba(6,182,212,0.75));
    transition: width .3s ease;
    border-radius: 6px 0 0 6px;
}

.custom-video-progress-watched {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 0%;
    background: linear-gradient(90deg, rgba(52,211,153,0.75), rgba(16,185,129,0.95));
    border-radius: 6px 0 0 6px;
    transition: width .3s ease;
}

.custom-video-progress-played {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 0%;
    background: linear-gradient(90deg, var(--cv-accent-1), var(--cv-accent-2), var(--cv-accent-3));
    border-radius: 6px 0 0 6px;
    transition: width .08s linear;
    z-index: 2;
}

.custom-video-progress-thumb {
    position: absolute;
    top: 50%;
    left: 0%;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(168,85,247,0.55), 0 4px 12px rgba(0,0,0,0.5);
    transform: translate(-50%, -50%);
    transition: left .08s linear, transform .2s ease, box-shadow .2s ease;
    pointer-events: none;
    z-index: 4;
}

.custom-video-progress:hover .custom-video-progress-thumb,
.custom-video-progress.custom-video-dragging .custom-video-progress-thumb {
    transform: translate(-50%, -50%) scale(1.25);
    box-shadow: 0 0 0 6px rgba(168,85,247,0.55), 0 6px 16px rgba(0,0,0,0.6);
}

.custom-video-progress-locked {
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    background: repeating-linear-gradient( 45deg, rgba(0,0,0,0.35) 0 6px, rgba(0,0,0,0.55) 6px 12px );
    pointer-events: none;
    border-left: 2px dashed rgba(255,255,255,0.5);
    z-index: 3;
    border-radius: 0 6px 6px 0;
}

.custom-video-progress-tip {
    position: absolute;
    bottom: 26px;
    transform: translateX(-50%);
    background: rgba(15, 15, 28, 0.9);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255,255,255,0.14);
    color: #fff;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 8px;
    pointer-events: none;
    opacity: 0;
    transition: opacity .2s ease;
    white-space: nowrap;
    z-index: 5;
    direction: ltr;
}

.custom-video-progress:hover .custom-video-progress-tip {
    opacity: 1;
}

/* =========================================================
   Controls Row
   ========================================================= */
.custom-video-row {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    direction: ltr;
}

.custom-video-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(255,255,255,0.10);
    border: 1px solid rgba(255,255,255,0.18);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all .25s ease;
    flex-shrink: 0;
    backdrop-filter: blur(8px);
}

    .custom-video-btn:hover {
        background: linear-gradient(135deg, var(--cv-accent-1), var(--cv-accent-2));
        border-color: transparent;
        color: #fff;
        transform: translateY(-2px);
        box-shadow: 0 8px 20px rgba(99,102,241,0.45);
    }

    .custom-video-btn:active {
        transform: translateY(0) scale(0.96);
    }

    .custom-video-btn svg {
        width: 20px;
        height: 20px;
        fill: currentColor;
        pointer-events: none;
    }

    .custom-video-btn.custom-video-btn-pin.active {
        background: linear-gradient(135deg, var(--cv-accent-1), var(--cv-accent-2));
        border-color: transparent;
        color: #fff;
        box-shadow: 0 8px 20px rgba(99,102,241,0.45);
    }

    .custom-video-btn.custom-video-btn-fullscreen.active {
        background: linear-gradient(135deg, var(--cv-accent-1), var(--cv-accent-2));
        border-color: transparent;
        color: #fff;
        box-shadow: 0 8px 20px rgba(99,102,241,0.45);
    }

.custom-video-time {
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    color: rgba(255,255,255,0.75);
    white-space: nowrap;
    padding: 0 4px;
    direction: ltr;
}

.custom-video-time-current {
    color: #fff;
    font-weight: 600;
}

.custom-video-spacer {
    flex: 1;
}

/* =========================================================
   Volume
   ========================================================= */
.custom-video-volume-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    direction: ltr;
    height: 40px;
    padding: 0 10px 0 6px;
    border-radius: 12px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.16);
    backdrop-filter: blur(8px);
    transition: background .25s ease, border-color .25s ease;
}

    .custom-video-volume-wrap:hover {
        background: rgba(168,85,247,0.20);
        border-color: rgba(168,85,247,0.55);
    }

.custom-video-btn-mute {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: transparent;
    border: none;
    box-shadow: none;
    color: #fff;
}

    .custom-video-btn-mute:hover {
        background: rgba(168,85,247,0.25);
        border-color: transparent;
        transform: none;
        box-shadow: none;
        color: #fff;
    }

    .custom-video-btn-mute svg {
        width: 20px;
        height: 20px;
        fill: currentColor;
        transition: transform .2s ease;
    }

    .custom-video-btn-mute:hover svg {
        transform: scale(1.1);
    }

.custom-video-volume-bars {
    position: relative;
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 22px;
    width: 90px;
    cursor: pointer;
    user-select: none;
    padding: 0 2px;
}

    .custom-video-volume-bars .custom-video-volume-bar {
        display: block;
        flex: 1;
        border-radius: 2px;
        background: rgba(255,255,255,0.28);
        transition: background .15s ease, transform .15s ease;
        align-self: flex-end;
        position: relative;
        overflow: hidden;
    }

        .custom-video-volume-bars .custom-video-volume-bar.custom-video-bar-filled {
            background: linear-gradient(180deg, #a855f7, #6366f1);
            box-shadow: 0 0 6px rgba(168,85,247,0.55);
        }

        .custom-video-volume-bars .custom-video-volume-bar.custom-video-bar-head {
            background: linear-gradient(180deg, #ffffff, #e9d5ff);
            box-shadow: 0 0 10px rgba(255,255,255,0.7);
        }

    .custom-video-volume-bars:hover .custom-video-volume-bar {
        transform: scaleY(1.05);
    }

.custom-video-volume-wrap.custom-video-muted .custom-video-volume-bar {
    background: rgba(255,255,255,0.15) !important;
    box-shadow: none !important;
}

    .custom-video-volume-wrap.custom-video-muted .custom-video-volume-bar.custom-video-bar-filled,
    .custom-video-volume-wrap.custom-video-muted .custom-video-volume-bar.custom-video-bar-head {
        background: rgba(230, 70, 70, 0.75) !important;
        box-shadow: none !important;
    }

.custom-video-volume-pct {
    font-size: 11px;
    color: rgba(255,255,255,0.75);
    min-width: 34px;
    text-align: right;
    font-variant-numeric: tabular-nums;
    direction: ltr;
    transition: color .2s ease;
}

.custom-video-volume-wrap:hover .custom-video-volume-pct {
    color: #fff;
}

/* =========================================================
   Settings Button + Panel
   ========================================================= */
.custom-video-settings {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
}

.custom-video-btn-settings svg {
    transition: transform .3s ease;
}

.custom-video-settings.custom-video-settings-open .custom-video-btn-settings svg {
    transform: rotate(45deg);
}

.custom-video-btn-settings.active {
    background: linear-gradient(135deg, var(--cv-accent-1), var(--cv-accent-2));
    border-color: transparent;
    color: #fff;
    box-shadow: 0 8px 20px rgba(99,102,241,0.45);
}

.custom-video-settings-panel {
    position: absolute;
    bottom: calc(100% + 10px);
    right: 0;
    min-width: 240px;
    max-width: 300px;
    overflow: visible;
    max-height: none;
    background: rgba(15, 15, 28, 0.92);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 14px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) scale(0.96);
    transform-origin: bottom right;
    transition: opacity .22s ease, transform .22s cubic-bezier(.22,.61,.36,1), visibility .22s;
    z-index: 20;
    color: #fff;
    box-shadow: 0 18px 50px rgba(0,0,0,0.55);
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.25) transparent;
}

[dir="rtl"] .custom-video-settings-panel {
    direction: rtl;
}

.custom-video-settings-panel::-webkit-scrollbar {
    width: 6px;
}

.custom-video-settings-panel::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.25);
    border-radius: 6px;
}

.custom-video-settings-panel::-webkit-scrollbar-track {
    background: transparent;
}

.custom-video-settings.custom-video-settings-open .custom-video-settings-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.custom-video-settings-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    overflow: visible;
}

    .custom-video-settings-group:last-child {
        border-bottom: none;
        padding-bottom: 2px;
    }

.custom-video-settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 8px;
    border-radius: 8px;
    transition: background .2s ease;
}

.custom-video-settings-row-label {
    font-size: 12px;
    color: rgba(255,255,255,0.85);
}

.custom-video-settings-panel select {
    background: rgba(255,255,255,0.10);
    border: 1px solid rgba(255,255,255,0.18);
    color: #fff;
    border-radius: 8px;
    height: 32px;
    padding: 0 8px;
    font-size: 12px;
    cursor: pointer;
    outline: none;
    min-width: 100px;
}

    .custom-video-settings-panel select option {
        background: #1a1a2e;
        color: #fff;
    }

.custom-video-settings-panel-scroll {
    max-height: 320px;
    overflow-y: auto;
    overscroll-behavior: contain;
    display: flex;
    flex-direction: column;
    gap: 8px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.25) transparent;
}

    .custom-video-settings-panel-scroll::-webkit-scrollbar {
        width: 6px;
    }

    .custom-video-settings-panel-scroll::-webkit-scrollbar-thumb {
        background: rgba(255,255,255,0.25);
        border-radius: 6px;
    }

    .custom-video-settings-panel-scroll::-webkit-scrollbar-track {
        background: transparent;
    }

/* =========================================================
   Fullscreen
   ========================================================= */
.custom-video.custom-video-fullscreen {
    position: fixed;
    inset: 0;
    max-width: none;
    margin: 0;
    border-radius: 0;
    z-index: 99999;
}

    .custom-video.custom-video-fullscreen .custom-video-header {
        display: none;
    }

    .custom-video.custom-video-fullscreen .custom-video-stage {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        aspect-ratio: auto;
    }

/* =========================================================
   Seek Feedback (Double tap)
   ========================================================= */
.custom-video-seek-feedback {
    position: absolute;
    top: 50%;
    transform: translateY(-50%) scale(0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease, transform .35s cubic-bezier(.22,.61,.36,1);
    z-index: 7;
}

    .custom-video-seek-feedback.custom-video-seek-feedback-forward {
        right: 8%;
    }

    .custom-video-seek-feedback.custom-video-seek-feedback-backward {
        left: 8%;
    }

    .custom-video-seek-feedback.custom-video-seek-feedback-show {
        opacity: 1;
        transform: translateY(-50%) scale(1);
    }

.custom-video-seek-feedback-icon {
    font-size: 26px;
    line-height: 1;
}

.custom-video-seek-feedback-text {
    font-size: 12px;
    opacity: 0.9;
    letter-spacing: 0.5px;
}

/* =========================================================
   Custom Dropdown (Quality / Speed / Captions)
   ========================================================= */
.custom-video-custom-dropdown {
    position: relative;
    display: inline-block;
    min-width: 100px;
    user-select: none;
}

.custom-video-custom-dropdown-toggle {
    width: 100%;
    height: 32px;
    padding: 0 10px;
    border-radius: 8px;
    background: rgba(255,255,255,0.10);
    border: 1px solid rgba(255,255,255,0.18);
    color: #fff;
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    outline: none;
    transition: background .2s ease, border-color .2s ease;
    direction: inherit;
}

    .custom-video-custom-dropdown-toggle:hover {
        background: rgba(168,85,247,0.20);
        border-color: rgba(168,85,247,0.55);
    }

.custom-video-custom-dropdown.custom-video-custom-dropdown-open .custom-video-custom-dropdown-toggle {
    background: linear-gradient(135deg, var(--cv-accent-1), var(--cv-accent-2));
    border-color: transparent;
    box-shadow: 0 8px 20px rgba(99,102,241,0.45);
}

.custom-video-custom-dropdown-toggle .custom-video-custom-dropdown-arrow {
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid currentColor;
    transition: transform .25s ease;
    flex-shrink: 0;
}

.custom-video-custom-dropdown.custom-video-custom-dropdown-open .custom-video-custom-dropdown-arrow {
    transform: rotate(180deg);
}

.custom-video-custom-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    left: auto;
    min-width: 100%;
    max-height: 100px;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: rgba(15, 15, 28, 0.96);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 10px;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px) scale(0.96);
    transform-origin: top right;
    transition: opacity .18s ease, transform .18s ease, visibility .18s;
    z-index: 100;
    box-shadow: 0 14px 40px rgba(0,0,0,0.55);
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.25) transparent;
}

[dir="rtl"] .custom-video-custom-dropdown-menu {
    right: auto;
    left: 0;
    transform-origin: top left;
}

.custom-video-custom-dropdown-menu::-webkit-scrollbar {
    width: 6px;
}

.custom-video-custom-dropdown-menu::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.25);
    border-radius: 6px;
}

.custom-video-custom-dropdown-menu::-webkit-scrollbar-track {
    background: transparent;
}

.custom-video-custom-dropdown.custom-video-custom-dropdown-open .custom-video-custom-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.custom-video-custom-dropdown-item {
    padding: 7px 10px;
    border-radius: 6px;
    font-size: 12px;
    color: rgba(255,255,255,0.85);
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    white-space: nowrap;
}

    .custom-video-custom-dropdown-item:hover {
        background: rgba(168,85,247,0.20);
        color: #fff;
    }

    .custom-video-custom-dropdown-item.custom-video-custom-dropdown-item-active {
        background: linear-gradient(135deg, var(--cv-accent-1), var(--cv-accent-2));
        color: #fff;
        font-weight: 600;
    }

        .custom-video-custom-dropdown-item.custom-video-custom-dropdown-item-active::after {
            content: "✓";
            font-size: 11px;
        }

/* =========================================================
   Block Overlay (Interrupt Content)
   ========================================================= */
.custom-video.custom-video-blocking .custom-video-stage > video,
.custom-video.custom-video-blocking .custom-video-audio-visual,
.custom-video.custom-video-blocking .custom-video-poster {
    visibility: hidden;
    pointer-events: none;
}

.custom-video.custom-video-blocking .custom-video-controls {
    pointer-events: none;
    opacity: 0.35;
    filter: grayscale(0.7);
}

.custom-video.custom-video-blocking .custom-video-center-play {
    display: none;
}

.custom-video-block-overlay {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 15% 20%, rgba(99,102,241,0.45), transparent 45%), radial-gradient(circle at 85% 80%, rgba(168,85,247,0.40), transparent 50%), radial-gradient(circle at 50% 50%, rgba(6,182,212,0.25), transparent 55%), rgba(10, 10, 20, 0.92);
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    color: #fff;
    padding: 24px;
    box-sizing: border-box;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.98);
    transition: opacity .35s ease, transform .35s cubic-bezier(.22,.61,.36,1), visibility .35s;
    font-family: inherit;
}

    .custom-video-block-overlay > video {
        z-index: 0;
    }

.custom-video.custom-video-blocking .custom-video-block-overlay {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.custom-video-block-content {
    position: relative;
    overflow: hidden;
    max-width: 560px;
    width: 100%;
    max-height: 100%;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 26px 22px;
    border-radius: 18px;
    background: rgba(20, 20, 35, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255,255,255,0.05) inset;
    text-align: center;
    direction: inherit;
    z-index: 1;
    animation: customVideoBlockIn .45s cubic-bezier(.22,.61,.36,1);
}

@keyframes customVideoBlockIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.custom-video-block-content > * {
    margin: 0 0 12px;
    line-height: 1.7;
}

    .custom-video-block-content > *:last-child {
        margin-bottom: 0;
    }

.custom-video-block-badge {
    display: inline-block;
    font-size: 11px;
    padding: 4px 12px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--cv-accent-1), var(--cv-accent-2));
    color: #fff;
    font-weight: 700;
    letter-spacing: 0.4px;
    margin-bottom: 14px;
    direction: ltr;
}

.custom-video-block-content button,
.custom-video-block-content .custom-video-block-approve {
    margin-top: 14px;
    padding: 10px 22px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.2);
    background: linear-gradient(135deg, var(--cv-accent-1), var(--cv-accent-2));
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease;
}

    .custom-video-block-content button:hover,
    .custom-video-block-content .custom-video-block-approve:hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 26px rgba(99,102,241,0.45);
    }

    .custom-video-block-content button:disabled,
    .custom-video-block-content .custom-video-block-approve:disabled {
        opacity: 0.45;
        cursor: not-allowed;
        transform: none;
        box-shadow: none;
    }

.custom-video-block-progress {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-top: 16px;
}

    .custom-video-block-progress .custom-video-block-dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.25);
        transition: background .3s ease, transform .3s ease;
    }

        .custom-video-block-progress .custom-video-block-dot.custom-video-block-dot-done {
            background: linear-gradient(135deg, var(--cv-accent-1), var(--cv-accent-2));
            transform: scale(1.15);
        }

        .custom-video-block-progress .custom-video-block-dot.custom-video-block-dot-active {
            background: #fff;
            transform: scale(1.35);
            box-shadow: 0 0 10px rgba(255,255,255,0.7);
        }

/* =========================================================
   Block Footer / Skip / Countdown
   ========================================================= */
.custom-video-block-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid rgba(255,255,255,0.12);
    gap: 12px;
}

.custom-video-block-skip {
    padding: 10px 22px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.2);
    background: linear-gradient(135deg, var(--cv-accent-1), var(--cv-accent-2));
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease;
}

    .custom-video-block-skip:hover:not(:disabled) {
        transform: translateY(-2px);
        box-shadow: 0 10px 26px rgba(99,102,241,0.45);
    }

    .custom-video-block-skip:disabled {
        opacity: 0.4;
        cursor: not-allowed;
        background: rgba(255,255,255,0.12);
        border-color: rgba(255,255,255,0.15);
        box-shadow: none;
    }

.custom-video-block-countdown {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 14px;
    border-radius: 999px;
    background: rgba(255,255,255,0.10);
    border: 1px solid rgba(255,255,255,0.20);
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    font-variant-numeric: tabular-nums;
}

/* =========================================================
   Ad Unmute Button
   ========================================================= */
.custom-video-ad-unmute {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 5;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.25);
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s ease, transform .2s ease;
}

    .custom-video-ad-unmute:hover {
        background: rgba(99,102,241,0.75);
        transform: scale(1.08);
    }

    .custom-video-ad-unmute:active {
        transform: scale(0.95);
    }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 899px) {
    .custom-video-custom-dropdown {
        min-width: 80px;
    }

    .custom-video-custom-dropdown-toggle {
        height: 28px;
        font-size: 11px;
        padding: 0 8px;
    }

    .custom-video-custom-dropdown-item {
        font-size: 11px;
        padding: 6px 8px;
    }

    .custom-video-settings-panel-scroll {
        max-height: 240px;
    }

    .custom-video-btn-stop,
    .custom-video-btn-back,
    .custom-video-btn-fwd {
        display: none !important;
    }

    .custom-video {
        border-radius: 16px;
    }

    .custom-video-controls {
        padding: 10px 12px 12px;
        gap: 6px;
    }

    .custom-video-row {
        gap: 6px;
    }

    .custom-video-btn {
        width: 36px;
        height: 36px;
        border-radius: 10px;
    }

        .custom-video-btn svg {
            width: 18px;
            height: 18px;
        }

    .custom-video-time {
        font-size: 11px;
    }

    .custom-video-volume-bars {
        width: 56px;
    }

    .custom-video-volume-pct {
        display: none;
    }

    .custom-video-volume-wrap {
        padding: 0 8px 0 4px;
        height: 36px;
    }

    .custom-video-center-play {
        width: 64px;
        height: 64px;
    }

        .custom-video-center-play svg {
            width: 26px;
            height: 26px;
        }

    .custom-video-audio-meta-title {
        font-size: 18px;
        max-width: 260px;
    }

    .custom-video-audio-inner {
        gap: 12px;
        padding: 20px 20px 80px 20px;
    }

    .custom-video-waves {
        padding: 0 12px 66px 12px;
        height: 45%;
    }

    .custom-video-seek-feedback {
        width: clamp(56px, 14%, 80px);
        height: clamp(56px, 14%, 80px);
        font-size: 11px;
    }

    .custom-video-seek-feedback-icon {
        font-size: clamp(18px, 4.5%, 24px);
    }

    .custom-video-seek-feedback-text {
        font-size: 10px;
    }

    .custom-video-settings-panel {
        min-width: 220px;
        max-width: 260px;
    }
}

@media (max-width: 520px) {
    .custom-video-volume-wrap {
        padding: 0 4px 0 2px;
    }

    .custom-video-volume-bars {
        width: 42px;
    }

    .custom-video-btn {
        width: 34px;
        height: 34px;
    }

        .custom-video-btn svg {
            width: 16px;
            height: 16px;
        }
}
