/* Custom Video Player - YouTube-style */

.custom-video-player {
    position: relative;
    width: 100%;
    background: #000;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--uw-white-3);
    margin: 10px 0;
}

.custom-player-video {
    width: 100%;
    max-height: 500px;
    display: block;
    object-fit: contain;
    cursor: pointer;
}

/* Video Controls Container */
.player-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    padding: 40px 12px 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.custom-video-player:hover .player-controls,
.custom-video-player.show-controls .player-controls,
.custom-video-player .player-controls:hover {
    opacity: 1;
    pointer-events: all;
}

/* Progress Bar */
.player-progress {
    height: 5px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    cursor: pointer;
    margin-bottom: 8px;
    position: relative;
    transition: height 0.2s ease;
    user-select: none;
}

.player-progress:hover {
    height: 8px;
}

/* Prevent text selection on progress bar */
.player-progress::selection {
    background: transparent;
}

.player-progress::-moz-selection {
    background: transparent;
}

/* Buffered progress indicator */
.player-buffered-bar {
    position: absolute;
    height: 100%;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50px;
    width: 0%;
    transition: width 0.3s ease;
    z-index: 1;
}

.player-progress-bar {
    position: absolute;
    height: 100%;
    background: var(--uw-blurple-1);
    border-radius: 50px;
    width: 0%;
    transition: width 0.1s linear;
    z-index: 2;
}

/* Control Buttons Row */
.player-controls-row {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
}

.player-btn {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.player-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.player-btn i {
    font-size: 20px;
    font-family: 'Material Symbols Rounded';
}

/* Time Display */
.player-time {
    font-size: 13px;
    color: #fff;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
    user-select: none;
}

/* Volume Controls */
.player-volume-container {
    display: flex;
    align-items: center;
    gap: 4px;
}

.player-volume-slider {
    width: 0;
    height: 6px;
    border-radius: 50px;
    cursor: pointer;
    transition: width 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
    position: relative;
    outline: none;
    /* Background will be set by JavaScript for fill effect */
}

/* Remove all default focus/selection/active styling */
.player-volume-slider:focus {
    outline: none;
}

.player-volume-slider:focus-visible {
    outline: none;
}

.player-volume-slider:active {
    outline: none;
}

.player-volume-slider::-moz-focus-outer {
    border: 0;
}

.player-volume-slider::-moz-focus-inner {
    border: 0;
}

.player-volume-slider::selection {
    background: transparent;
}

.player-volume-slider::-moz-selection {
    background: transparent;
}

/* Prevent white background on webkit browsers */
.player-volume-slider::-webkit-slider-runnable-track:active {
    background: transparent;
}

.player-volume-slider::-webkit-slider-runnable-track:focus {
    background: transparent;
}

.player-volume-container:hover .player-volume-slider {
    width: 60px;
}

/* Webkit slider thumb - removed, using fill only */
.player-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 0;
    height: 0;
    background: transparent;
    border: none;
    cursor: pointer;
}

/* Firefox slider thumb - removed, using fill only */
.player-volume-slider::-moz-range-thumb {
    width: 0;
    height: 0;
    background: transparent;
    border: none;
    cursor: pointer;
}

/* Webkit slider fill - transparent to show background gradient */
.player-volume-slider::-webkit-slider-runnable-track {
    height: 4px;
    background: transparent !important;
    border-radius: 50px;
    border: none;
}

.player-volume-slider::-webkit-slider-runnable-track:active {
    background: transparent !important;
}

.player-volume-slider::-webkit-slider-runnable-track:focus {
    background: transparent !important;
}

/* Firefox slider fill - transparent to show background gradient */
.player-volume-slider::-moz-range-track {
    height: 4px;
    background: transparent !important;
    border-radius: 50px;
    border: none;
}

.player-volume-slider::-moz-range-progress {
    height: 4px;
    background: var(--uw-blurple-1);
    border-radius: 50px;
}

/* Additional Firefox range styling */
.player-volume-slider::-moz-range-track:active {
    background: transparent !important;
}

.player-volume-slider::-moz-range-track:focus {
    background: transparent !important;
}

/* Spacer to push right controls to the right */
.player-controls-spacer {
    flex: 1;
}

/* Settings Menu */
.player-settings-container {
    position: relative;
}

.player-settings-menu {
    position: absolute;
    bottom: 100%;
    right: 0;
    background: rgba(28, 28, 28, 0.98);
    border-radius: 20px;
    padding: 8px 0;
    margin-bottom: 8px;
    min-width: 150px;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.player-settings-menu.active {
    display: block;
}

.player-settings-item {
    padding: 10px 16px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.2s ease;
}

.player-settings-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.quality-option {
    padding: 8px 16px;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 6px 12px;
    border-radius: 50px;
}

.quality-option:hover {
    background: rgba(255, 255, 255, 0.1);
}

.quality-option.active {
    background: var(--uw-blurple-1);
    color: var(--uw-white-1);
}


/* Loading State */
.player-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 14px;
    display: none;
}

.custom-player-video:not([src]) + .player-loading {
    display: block;
}

/* Muted Indicator */
.player-muted-indicator {
    position: absolute;
    bottom: 60px;
    left: 12px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 6px 12px;
    border-radius: 50px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;

    margin-bottom: 12px;
}

.custom-video-player:hover .player-muted-indicator {
    opacity: 1;
}

.player-muted-indicator.hidden {
    display: none;
}

/* Fullscreen Styles */
.custom-video-player:fullscreen {
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-video-player:fullscreen .custom-player-video {
    width: 100%;
    height: 100%;
    max-height: 100vh;
    object-fit: contain;
}

.custom-video-player:fullscreen .player-controls {
    opacity: 0;
}

.custom-video-player:fullscreen:hover .player-controls,
.custom-video-player:fullscreen.show-controls .player-controls {
    opacity: 1;
}

/* Webkit fullscreen support */
.custom-video-player:-webkit-full-screen {
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-video-player:-webkit-full-screen .custom-player-video {
    width: 100%;
    height: 100%;
    max-height: 100vh;
    object-fit: contain;
}

.custom-video-player:-webkit-full-screen .player-controls {
    opacity: 0;
}

.custom-video-player:-webkit-full-screen:hover .player-controls {
    opacity: 1;
}

/* Moz fullscreen support */
.custom-video-player:-moz-full-screen {
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-video-player:-moz-full-screen .custom-player-video {
    width: 100%;
    height: 100%;
    max-height: 100vh;
    object-fit: contain;
}

.custom-video-player:-moz-full-screen .player-controls {
    opacity: 0;
}

.custom-video-player:-moz-full-screen:hover .player-controls {
    opacity: 1;
}

/* MS fullscreen support */
.custom-video-player:-ms-fullscreen {
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-video-player:-ms-fullscreen .custom-player-video {
    width: 100%;
    height: 100%;
    max-height: 100vh;
    object-fit: contain;
}

/* Prevent selection during video scrubbing */
body.video-scrubbing,
body.video-scrubbing * {
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    cursor: pointer !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .player-volume-slider {
        display: none;
    }
    
    .player-time {
        font-size: 11px;
    }
    
    .player-btn i {
        font-size: 18px;
    }
}

