/* ============================================
   Product Video Showcase - Frontend Player
   Beautiful & Modern Video Player Styles
   ============================================ */

/* === Base Wrapper === */
.pvs-video-wrapper {
    position: relative;
    width: 100%;
    margin: 20px auto;
    border-radius: 16px;
    overflow: hidden;
    background: #000;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    direction: ltr;
    isolation: isolate;
    aspect-ratio: 16 / 9;
}

/* === Player Container === */
.pvs-player-container {
    position: relative;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.pvs-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* === Cover Overlay === */
.pvs-cover-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity 0.5s ease;
}

.pvs-cover-overlay.pvs-hidden {
    opacity: 0;
    pointer-events: none;
}

.pvs-cover-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pvs-cover-gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        180deg,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 0.15) 50%,
        rgba(0, 0, 0, 0.6) 100%
    );
}

/* === Play Button on Cover === */
.pvs-play-button {
    position: relative;
    z-index: 2;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    outline: none;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pvs-play-button:hover {
    transform: scale(1.15);
}

.pvs-play-button:active {
    transform: scale(0.95);
}

.pvs-play-icon {
    width: 80px;
    height: 80px;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.4));
}

.pvs-play-circle {
    fill: rgba(255, 255, 255, 0.2);
    stroke: rgba(255, 255, 255, 0.9);
    stroke-width: 2.5;
    transition: fill 0.3s ease;
}

.pvs-play-button:hover .pvs-play-circle {
    fill: rgba(255, 255, 255, 0.35);
}

.pvs-play-triangle {
    fill: #fff;
}

/* Play Ripple Effect */
.pvs-play-ripple {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.4);
    animation: pvs-ripple 2s ease-out infinite;
}

@keyframes pvs-ripple {
    0% {
        width: 80px;
        height: 80px;
        opacity: 1;
    }
    100% {
        width: 140px;
        height: 140px;
        opacity: 0;
    }
}

/* Cover Title */
.pvs-cover-title {
    position: absolute;
    bottom: 24px;
    left: 24px;
    right: 24px;
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
    z-index: 2;
    text-align: center;
}

/* === Controls === */
.pvs-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 20;
    padding: 0 12px 10px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.pvs-player-container:hover .pvs-controls,
.pvs-controls.pvs-controls-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Progress Bar */
.pvs-progress-bar {
    position: relative;
    width: 100%;
    height: 5px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: height 0.15s ease;
}

.pvs-progress-bar:hover {
    height: 7px;
}

.pvs-progress-buffer {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 3px;
    transition: width 0.1s linear;
    pointer-events: none;
}

.pvs-progress-filled {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    border-radius: 3px;
    transition: width 0.05s linear;
    pointer-events: none;
}

.pvs-progress-input {
    position: absolute;
    top: -4px;
    left: 0;
    width: 100%;
    height: 14px;
    margin: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
    -webkit-appearance: none;
    appearance: none;
}

/* Controls Bottom Row */
.pvs-controls-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.pvs-controls-left,
.pvs-controls-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Control Buttons */
.pvs-ctrl-btn {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    outline: none;
}

.pvs-ctrl-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.1);
}

.pvs-ctrl-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Volume */
.pvs-volume-container {
    display: flex;
    align-items: center;
    gap: 2px;
}

.pvs-volume-slider-wrapper {
    width: 0;
    overflow: hidden;
    transition: width 0.3s ease;
}

.pvs-volume-container:hover .pvs-volume-slider-wrapper {
    width: 70px;
}

.pvs-volume-slider {
    width: 65px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.pvs-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.3);
}

.pvs-volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    border: none;
}

/* Time Display */
.pvs-time {
    color: rgba(255, 255, 255, 0.85);
    font-size: 12px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    padding: 0 4px;
}

.pvs-time-separator {
    margin: 0 3px;
    opacity: 0.6;
}

/* Video Title Bar */
.pvs-video-title-bar {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    font-weight: 500;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* === Center Indicator === */
.pvs-center-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 64px;
    height: 64px;
    background: rgba(0, 0, 0, 0.55);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 15;
    opacity: 0;
    transition: none;
}

.pvs-center-indicator.pvs-show {
    animation: pvs-center-pop 0.5s ease forwards;
}

@keyframes pvs-center-pop {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 1;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.3);
        opacity: 0;
    }
}

.pvs-center-indicator svg {
    width: 28px;
    height: 28px;
    fill: #fff;
    display: none;
}

.pvs-center-indicator svg.pvs-active {
    display: block;
}

/* === Loading Spinner === */
.pvs-loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 14;
    display: none;
}

.pvs-loading-spinner.pvs-visible {
    display: block;
}

.pvs-spinner {
    width: 44px;
    height: 44px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: pvs-spin 0.8s linear infinite;
}

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

/* ============================================
   THEMES
   ============================================ */

/* --- Modern Dark (Default) --- */
.pvs-theme-modern-dark {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.pvs-theme-modern-dark .pvs-progress-filled {
    background: linear-gradient(90deg, #ff4757, #ff6b81);
}

.pvs-theme-modern-dark .pvs-play-circle {
    stroke: #ff4757;
}

.pvs-theme-modern-dark .pvs-play-ripple {
    border-color: rgba(255, 71, 87, 0.4);
}

.pvs-theme-modern-dark .pvs-volume-slider::-webkit-slider-thumb {
    background: #ff4757;
}

/* --- Modern Light --- */
.pvs-theme-modern-light {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.pvs-theme-modern-light .pvs-controls {
    background: linear-gradient(transparent, rgba(255, 255, 255, 0.95));
}

.pvs-theme-modern-light .pvs-ctrl-btn {
    color: #333;
}

.pvs-theme-modern-light .pvs-ctrl-btn:hover {
    background: rgba(0, 0, 0, 0.08);
}

.pvs-theme-modern-light .pvs-progress-bar {
    background: rgba(0, 0, 0, 0.12);
}

.pvs-theme-modern-light .pvs-progress-buffer {
    background: rgba(0, 0, 0, 0.08);
}

.pvs-theme-modern-light .pvs-progress-filled {
    background: linear-gradient(90deg, #2196F3, #42A5F5);
}

.pvs-theme-modern-light .pvs-time {
    color: rgba(0, 0, 0, 0.7);
}

.pvs-theme-modern-light .pvs-video-title-bar {
    color: rgba(0, 0, 0, 0.5);
}

.pvs-theme-modern-light .pvs-play-circle {
    stroke: #2196F3;
    fill: rgba(33, 150, 243, 0.15);
}

.pvs-theme-modern-light .pvs-play-ripple {
    border-color: rgba(33, 150, 243, 0.4);
}

.pvs-theme-modern-light .pvs-volume-slider {
    background: rgba(0, 0, 0, 0.15);
}

.pvs-theme-modern-light .pvs-volume-slider::-webkit-slider-thumb {
    background: #2196F3;
}

/* --- Gradient Purple --- */
.pvs-theme-gradient-purple {
    box-shadow: 0 8px 40px rgba(123, 44, 191, 0.35);
}

.pvs-theme-gradient-purple .pvs-controls {
    background: linear-gradient(transparent, rgba(45, 10, 80, 0.92));
}

.pvs-theme-gradient-purple .pvs-progress-filled {
    background: linear-gradient(90deg, #a855f7, #ec4899);
}

.pvs-theme-gradient-purple .pvs-play-circle {
    stroke: #a855f7;
    fill: rgba(168, 85, 247, 0.2);
}

.pvs-theme-gradient-purple .pvs-play-button:hover .pvs-play-circle {
    fill: rgba(168, 85, 247, 0.35);
}

.pvs-theme-gradient-purple .pvs-play-ripple {
    border-color: rgba(168, 85, 247, 0.4);
}

.pvs-theme-gradient-purple .pvs-cover-gradient {
    background: linear-gradient(
        180deg,
        rgba(45, 10, 80, 0) 0%,
        rgba(45, 10, 80, 0.3) 60%,
        rgba(45, 10, 80, 0.8) 100%
    );
}

.pvs-theme-gradient-purple .pvs-volume-slider::-webkit-slider-thumb {
    background: #a855f7;
}

.pvs-theme-gradient-purple .pvs-spinner {
    border-top-color: #a855f7;
}

/* --- Gradient Blue --- */
.pvs-theme-gradient-blue {
    box-shadow: 0 8px 40px rgba(37, 99, 235, 0.3);
}

.pvs-theme-gradient-blue .pvs-controls {
    background: linear-gradient(transparent, rgba(15, 23, 42, 0.92));
}

.pvs-theme-gradient-blue .pvs-progress-filled {
    background: linear-gradient(90deg, #3b82f6, #06b6d4);
}

.pvs-theme-gradient-blue .pvs-play-circle {
    stroke: #3b82f6;
    fill: rgba(59, 130, 246, 0.2);
}

.pvs-theme-gradient-blue .pvs-play-button:hover .pvs-play-circle {
    fill: rgba(59, 130, 246, 0.35);
}

.pvs-theme-gradient-blue .pvs-play-ripple {
    border-color: rgba(59, 130, 246, 0.4);
}

.pvs-theme-gradient-blue .pvs-cover-gradient {
    background: linear-gradient(
        180deg,
        rgba(15, 23, 42, 0) 0%,
        rgba(15, 23, 42, 0.3) 60%,
        rgba(15, 23, 42, 0.8) 100%
    );
}

.pvs-theme-gradient-blue .pvs-volume-slider::-webkit-slider-thumb {
    background: #3b82f6;
}

.pvs-theme-gradient-blue .pvs-spinner {
    border-top-color: #3b82f6;
}

/* --- Neon Glow --- */
.pvs-theme-neon-glow {
    box-shadow:
        0 0 20px rgba(0, 255, 136, 0.15),
        0 8px 32px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(0, 255, 136, 0.15);
}

.pvs-theme-neon-glow .pvs-controls {
    background: linear-gradient(transparent, rgba(0, 10, 5, 0.92));
}

.pvs-theme-neon-glow .pvs-progress-filled {
    background: linear-gradient(90deg, #00ff88, #00ccff);
    box-shadow: 0 0 8px rgba(0, 255, 136, 0.5);
}

.pvs-theme-neon-glow .pvs-progress-bar:hover .pvs-progress-filled {
    box-shadow: 0 0 14px rgba(0, 255, 136, 0.6);
}

.pvs-theme-neon-glow .pvs-play-circle {
    stroke: #00ff88;
    fill: rgba(0, 255, 136, 0.1);
    filter: drop-shadow(0 0 8px rgba(0, 255, 136, 0.4));
}

.pvs-theme-neon-glow .pvs-play-button:hover .pvs-play-circle {
    fill: rgba(0, 255, 136, 0.2);
    filter: drop-shadow(0 0 16px rgba(0, 255, 136, 0.6));
}

.pvs-theme-neon-glow .pvs-play-ripple {
    border-color: rgba(0, 255, 136, 0.3);
}

.pvs-theme-neon-glow .pvs-cover-gradient {
    background: linear-gradient(
        180deg,
        rgba(0, 10, 5, 0) 0%,
        rgba(0, 10, 5, 0.4) 60%,
        rgba(0, 10, 5, 0.9) 100%
    );
}

.pvs-theme-neon-glow .pvs-ctrl-btn:hover {
    background: rgba(0, 255, 136, 0.1);
    color: #00ff88;
    text-shadow: 0 0 8px rgba(0, 255, 136, 0.5);
}

.pvs-theme-neon-glow .pvs-volume-slider::-webkit-slider-thumb {
    background: #00ff88;
    box-shadow: 0 0 6px rgba(0, 255, 136, 0.6);
}

.pvs-theme-neon-glow .pvs-spinner {
    border-top-color: #00ff88;
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
}

.pvs-theme-neon-glow .pvs-center-indicator {
    background: rgba(0, 20, 10, 0.6);
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.2);
}

/* ============================================
   Fullscreen Styles
   ============================================ */
.pvs-video-wrapper:fullscreen,
.pvs-video-wrapper:-webkit-full-screen {
    border-radius: 0;
    max-width: 100% !important;
}

.pvs-video-wrapper:fullscreen .pvs-video,
.pvs-video-wrapper:-webkit-full-screen .pvs-video {
    object-fit: contain;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
    .pvs-video-wrapper {
        border-radius: 10px;
        margin: 12px auto;
    }

    .pvs-play-icon {
        width: 60px;
        height: 60px;
    }

    .pvs-play-ripple {
        width: 60px;
        height: 60px;
    }

    @keyframes pvs-ripple {
        0% { width: 60px; height: 60px; opacity: 1; }
        100% { width: 110px; height: 110px; opacity: 0; }
    }

    .pvs-cover-title {
        font-size: 14px;
        bottom: 16px;
        left: 16px;
        right: 16px;
    }

    .pvs-controls {
        padding: 0 8px 6px;
    }

    .pvs-ctrl-btn svg {
        width: 18px;
        height: 18px;
    }

    .pvs-time {
        font-size: 11px;
    }

    .pvs-video-title-bar {
        display: none;
    }

    .pvs-center-indicator {
        width: 52px;
        height: 52px;
    }

    .pvs-center-indicator svg {
        width: 22px;
        height: 22px;
    }
}

@media (max-width: 480px) {
    .pvs-play-icon {
        width: 48px;
        height: 48px;
    }

    .pvs-volume-container:hover .pvs-volume-slider-wrapper {
        width: 50px;
    }

    .pvs-volume-slider {
        width: 45px;
    }

    .pvs-btn-pip {
        display: none !important;
    }
}
