/* ═══ Custom Video Player — YouTube-style ═══ */

.vp {
    position: relative;
    width: 100%;
    height: 100%;
    background: #000;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    border-radius: inherit;
    outline: none;
    cursor: default;
}

.vp video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* ── Big center play button ── */

.vp-big-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 68px;
    height: 68px;
    background: rgba(0, 0, 0, 0.55);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.2s, background 0.15s, transform 0.15s;
    z-index: 3;
    padding: 0;
}

.vp-big-play:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: translate(-50%, -50%) scale(1.07);
}

.vp-big-play svg {
    width: 30px;
    height: 30px;
    fill: #fff;
    margin-left: 3px;
}

.vp.is-playing .vp-big-play {
    opacity: 0;
    pointer-events: none;
}

/* ── Loading spinner ── */

.vp-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 44px;
    height: 44px;
    border: 3px solid rgba(255, 255, 255, 0.25);
    border-top-color: #fff;
    border-radius: 50%;
    animation: vp-spin 0.75s linear infinite;
    opacity: 0;
    pointer-events: none;
    z-index: 3;
}

.vp.is-buffering .vp-spinner {
    opacity: 1;
}

.vp.is-buffering .vp-big-play {
    opacity: 0;
    pointer-events: none;
}

@keyframes vp-spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ── Controls bar ── */

.vp-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    padding: 20px 0 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    opacity: 1;
    transition: opacity 0.3s;
    z-index: 4;
}

.vp.is-idle .vp-controls {
    opacity: 0;
    pointer-events: none;
}

.vp.is-idle {
    cursor: none;
}

/* ── Progress bar — large clickable wrapper with thin visual track ── */

.vp-progress {
    position: relative;
    width: 100%;
    padding: 8px 12px;
    cursor: pointer;
    box-sizing: border-box;
}

.vp-progress-track {
    position: relative;
    height: 3px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 2px;
    transition: height 0.1s;
}

.vp-progress:hover .vp-progress-track,
.vp-progress.is-dragging .vp-progress-track {
    height: 6px;
}

.vp-progress-buffered {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 2px;
    pointer-events: none;
}

.vp-progress-played {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: #FF7A1A;
    border-radius: 2px;
    pointer-events: none;
}

.vp-progress-thumb {
    position: absolute;
    top: 50%;
    width: 14px;
    height: 14px;
    background: #FF7A1A;
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.1s;
    pointer-events: none;
    z-index: 1;
}

.vp-progress:hover .vp-progress-thumb,
.vp-progress.is-dragging .vp-progress-thumb {
    transform: translate(-50%, -50%) scale(1);
}

/* ── Bottom row ── */

.vp-row {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 40px;
    padding: 0 8px;
}

.vp-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.9;
    transition: opacity 0.15s;
    border-radius: 4px;
    line-height: 0;
}

.vp-btn:hover {
    opacity: 1;
}

.vp-btn svg {
    width: 24px;
    height: 24px;
    fill: #fff;
}

/* ── Time display ── */

.vp-time {
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    line-height: 1;
    padding: 0 4px;
}

/* ── Volume ── */

.vp-vol {
    display: flex;
    align-items: center;
    gap: 0;
}

.vp-vol-slider-wrap {
    width: 0;
    overflow: hidden;
    transition: width 0.2s ease;
    display: flex;
    align-items: center;
}

.vp-vol:hover .vp-vol-slider-wrap,
.vp-vol.is-active .vp-vol-slider-wrap {
    width: 60px;
}

.vp-vol-slider {
    -webkit-appearance: none;
    appearance: none;
    display: block;
    width: 56px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
    margin: 0 4px;
    vertical-align: middle;
}

.vp-vol-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
}

.vp-vol-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    border: none;
    cursor: pointer;
}

/* ── Spacer ── */

.vp-spacer {
    flex: 1;
}

/* ── Responsive ── */

@media (max-width: 480px) {
    .vp-big-play {
        width: 56px;
        height: 56px;
    }

    .vp-big-play svg {
        width: 24px;
        height: 24px;
    }

    .vp-controls {
        padding: 16px 0 0;
    }

    .vp-row {
        height: 36px;
        padding: 0 4px;
    }

    .vp-btn {
        padding: 6px;
    }

    .vp-btn svg {
        width: 20px;
        height: 20px;
    }

    .vp-time {
        font-size: 12px;
    }
}
