/* Overlay Video Player Styles */

.video-overlay-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-overlay-popup.visible {
    opacity: 1;
}

.overlay-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.overlay-window {
    position: relative;
    width: 90%;
    max-width: 1200px;
    max-height: 90%;
    background: #1a1a1a;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.video-overlay-popup.visible .overlay-window {
    transform: scale(1);
}

.overlay-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: #2a2a2a;
    border-bottom: 1px solid #333;
}

.overlay-title {
    margin: 0;
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    max-width: calc(100% - 40px);
}

.overlay-close-btn {
    background: none;
    border: none;
    color: #999;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.2s ease;
    line-height: 1;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.overlay-close-btn:hover {
    background: #444;
    color: #fff;
}

.overlay-video-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    overflow: hidden;
}

/* Ensure the video player inherits BaseVideoPlayer styles */
.overlay-video-container .main-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.overlay-video-container .video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.overlay-video-container:hover .video-overlay,
.overlay-video-container.paused .video-overlay {
    opacity: 1;
}

.overlay-video-container .video-title {
    color: #fff;
    font-size: 24px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 8px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    max-width: 80%;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

.overlay-video-container .video-info {
    color: #ccc;
    font-size: 16px;
    text-align: center;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.overlay-video-container .play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: auto;
}

.overlay-video-container .play-button-large {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 80px;
    height: 80px;
    font-size: 32px;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.overlay-video-container .play-button-large:hover {
    background: #fff;
    transform: scale(1.1);
}

.overlay-video-container .video-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #fff;
}

/* Video Controls for Overlay */
.overlay-video-container .video-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    padding: 20px 15px 15px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.overlay-video-container:hover .video-controls,
.overlay-video-container.paused .video-controls {
    opacity: 1;
    pointer-events: auto;
}

.overlay-video-container .progress-container {
    margin-bottom: 12px;
}

.overlay-video-container .progress-bar {
    position: relative;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    cursor: pointer;
    margin-bottom: 8px;
}

.overlay-video-container .progress-filled {
    height: 100%;
    background: #e50914;
    border-radius: 2px;
    transition: width 0.1s ease;
}

.overlay-video-container .progress-thumb {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: #e50914;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.overlay-video-container .progress-bar:hover .progress-thumb {
    opacity: 1;
}

.overlay-video-container .time-display {
    display: flex;
    justify-content: space-between;
    color: #fff;
    font-size: 12px;
    font-family: 'Courier New', monospace;
}

.overlay-video-container .controls-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.overlay-video-container .controls-center {
    flex: 1;
    text-align: center;
    padding: 0 20px;
}

.overlay-video-container .video-name {
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

.overlay-video-container .control-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
}

.overlay-video-container .control-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.overlay-video-container .volume-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.overlay-video-container .volume-slider {
    width: 80px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

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

.overlay-video-container .volume-percentage {
    color: #ccc;
    font-size: 11px;
    font-family: 'Courier New', monospace;
    min-width: 30px;
    text-align: right;
}

/* Random video button special styling */
.overlay-video-container .random-video-btn {
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.overlay-video-container .random-video-btn:hover {
    background: rgba(255, 215, 0, 0.2);
    border-color: rgba(255, 215, 0, 0.5);
}

/* Loading spinner for overlay */
.overlay-video-container .loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top: 4px solid #e50914;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive design */
@media (max-width: 768px) {
    .overlay-window {
        width: 95%;
        max-height: 95%;
    }
    
    .overlay-header {
        padding: 12px 15px;
    }
    
    .overlay-title {
        font-size: 16px;
    }
    
    .overlay-video-container .video-title {
        font-size: 20px;
    }
    
    .overlay-video-container .controls-center {
        padding: 0 10px;
    }
    
    .overlay-video-container .volume-slider {
        width: 60px;
    }
}

@media (max-width: 480px) {
    .overlay-video-container .controls-center {
        display: none; /* Hide video name on very small screens */
    }
    
    .overlay-video-container .volume-percentage {
        display: none; /* Hide percentage on very small screens */
    }
}