/* Video Player Container */
.custom-video-player {
    position: relative;
    width: 100%;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 16/9;
    /* Default aspect ratio, can be overridden */
}

/* Video Element */
.custom-video-player video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    /* Ensure video fits within container without cropping */
}

/* Big Play Button (Center Overlay) */
.video-big-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.2s;
    opacity: 0;
    pointer-events: none;
    /* Let clicks pass through to video unless paused */
}

.custom-video-player.paused .video-big-play-btn {
    opacity: 1;
    pointer-events: auto;
}

.video-big-play-btn:hover {
    background: var(--primary-color, #1877f2);
    transform: translate(-50%, -50%) scale(1.1);
}

/* Controls Overlay (Bottom) */
.video-controls-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    padding: 20px 15px 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.3s;
}

.custom-video-player:hover .video-controls-overlay,
.custom-video-player.paused .video-controls-overlay {
    opacity: 1;
}

/* Progress Bar */
.video-progress-bar {
    width: 100%;
    height: 5px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2.5px;
    cursor: pointer;
    position: relative;
}

.video-progress-fill {
    height: 100%;
    background: var(--primary-color, #1877f2);
    border-radius: 2.5px;
    width: 0%;
    position: relative;
    pointer-events: none;
}

.video-progress-handle {
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    position: absolute;
    right: -6px;
    top: -3.5px;
    transform: scale(0);
    transition: transform 0.2s;
    pointer-events: none;
}

.video-progress-bar:hover .video-progress-handle {
    transform: scale(1);
}

/* Controls Row */
.video-controls-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: white;
    font-size: 14px;
}

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

/* Buttons */
.video-control-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 16px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.9;
    transition: opacity 0.2s;
}

.video-control-btn:hover {
    opacity: 1;
}

/* Volume Slider */
.video-volume-container {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 0;
    overflow: hidden;
    transition: width 0.2s;
}

.video-volume-wrapper:hover .video-volume-container {
    width: 80px;
}

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

.video-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
}

/* Time Display */
.video-time {
    font-family: monospace;
    font-size: 12px;
    opacity: 0.9;
}

/* Spinner */
.video-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: video-spin 1s linear infinite;
    display: none;
    pointer-events: none;
}

.custom-video-player.loading .video-spinner {
    display: block;
}

@keyframes video-spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}