/* Custom Video Player */
.custom-video-player {
    position: relative;
    width: 100%;
    background: var(--dark-3);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    /* Fixed aspect ratio for watch page */
    aspect-ratio: 16 / 9;
    background-color: #000;
}

/* For hero section - maintain aspect ratio but allow different sizes */
.custom-video-player.hero {
    aspect-ratio: 16 / 9;
}

/* For responsive containers that need different aspect ratios */
.custom-video-player.watch {
    aspect-ratio: 16 / 9;
    max-width: 100%;
}

.custom-video-player video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: var(--dark-3);
    cursor: pointer;
}

/* For hero video that needs to cover */
.custom-video-player.hero video {
    object-fit: cover;
}

/* Video Controls Container */
.video-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.7) 60%, transparent 100%);
    padding: 15px 20px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    z-index: 10;
}

.custom-video-player:hover .video-controls,
.video-controls.visible {
    transform: translateY(0);
}

/* Control Buttons */
.control-buttons {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.control-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
}

.control-btn:hover {
    color: var(--gold);
    transform: scale(1.1);
}

.control-btn:active {
    transform: scale(0.95);
}

/* Play/Pause Button */
.play-pause-btn {
    background: var(--gold-gradient);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
}

.play-pause-btn:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-gold);
}

/* Time Display */
.time-display {
    color: var(--text-primary);
    font-size: 0.85rem;
    font-family: monospace;
    display: flex;
    gap: 5px;
    align-items: center;
    flex-shrink: 0;
}

.current-time,
.duration {
    color: var(--text-secondary);
}

.time-separator {
    color: var(--gold);
}

/* Progress Bar Container */
.progress-container {
    width: 100%;
    margin-bottom: 10px;
    cursor: pointer;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
    position: relative;
    transition: height 0.2s ease;
}

.progress-bar:hover {
    height: 6px;
}

.progress-filled {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: var(--gold-gradient);
    border-radius: 2px;
    width: 0%;
    transition: width 0.1s linear;
}

.progress-buffered {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
    width: 0%;
}

/* Volume Control */
.volume-control {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

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

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: var(--gold);
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
}

.volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    background: var(--gold-light);
}

/* Speed Control */
.speed-control {
    position: relative;
    flex-shrink: 0;
}

.speed-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.speed-btn:hover {
    color: var(--gold);
    background: rgba(201, 168, 76, 0.1);
}

.speed-dropdown {
    position: absolute;
    bottom: 100%;
    left: 0;
    background: var(--dark-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 5px 0;
    min-width: 80px;
    display: none;
    z-index: 20;
    margin-bottom: 5px;
}

.speed-dropdown.show {
    display: block;
}

.speed-option {
    padding: 8px 15px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.85rem;
    transition: var(--transition);
    text-align: center;
}

.speed-option:hover {
    background: var(--gold-gradient);
    color: var(--dark);
}

.speed-option.active {
    color: var(--gold);
    font-weight: bold;
}

/* Fullscreen Button */
.fullscreen-btn {
    margin-left: auto;
    flex-shrink: 0;
}

/* Loading Indicator */
.video-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    display: none;
}

.video-loading.show {
    display: block;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(201, 168, 76, 0.2);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Big Play Button (Center) */
.big-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: rgba(0,0,0,0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    z-index: 5;
    opacity: 0;
    visibility: hidden;
}

.big-play-btn.show {
    opacity: 1;
    visibility: visible;
}

.big-play-btn:hover {
    transform: translate(-50%, -50%) scale(1.1);
    background: rgba(201, 168, 76, 0.9);
}

.big-play-btn i {
    font-size: 2.5rem;
    color: white;
    margin-left: 5px;
}

/* Video Info Overlay */
.video-info {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(0,0,0,0.7);
    padding: 8px 15px;
    border-radius: var(--radius-sm);
    backdrop-filter: blur(10px);
    pointer-events: none;
    z-index: 5;
}

.video-info h3 {
    color: var(--gold);
    font-size: 0.9rem;
    margin: 0;
    font-weight: 500;
}

/* For iframe support (YouTube, etc.) */
.custom-video-player iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .custom-video-player {
        aspect-ratio: 16 / 9;
        border-radius: var(--radius-sm);
    }
    
    .video-controls {
        padding: 10px 15px;
    }
    
    .control-buttons {
        gap: 8px;
    }
    
    .volume-control {
        display: none; /* Hide volume slider on mobile, keep only volume button */
    }
    
    .speed-control {
        display: none; /* Hide speed control on mobile */
    }
    
    .time-display {
        font-size: 0.7rem;
    }
    
    .control-btn {
        width: 28px;
        height: 28px;
        font-size: 0.9rem;
    }
    
    .play-pause-btn {
        width: 35px;
        height: 35px;
    }
    
    .big-play-btn {
        width: 60px;
        height: 60px;
    }
    
    .big-play-btn i {
        font-size: 1.8rem;
    }
    
    .progress-bar {
        height: 3px;
    }
    
    .progress-bar:hover {
        height: 4px;
    }
}

/* Small Mobile Devices */
@media (max-width: 480px) {
    .control-buttons {
        gap: 5px;
    }
    
    .time-display {
        font-size: 0.65rem;
    }
    
    .control-btn {
        width: 25px;
        height: 25px;
        font-size: 0.8rem;
    }
    
    .play-pause-btn {
        width: 32px;
        height: 32px;
    }
    
    .volume-control {
        display: none;
    }
    
    .speed-control {
        display: none;
    }
}

/* Landscape mode on mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .custom-video-player {
        aspect-ratio: 16 / 9;
        max-height: 85vh;
    }
}

/* Fullscreen mode */
.custom-video-player:fullscreen {
    aspect-ratio: auto;
    width: 100vw;
    height: 100vh;
    border-radius: 0;
}

.custom-video-player:fullscreen video {
    object-fit: contain;
}

.custom-video-player:fullscreen .video-controls {
    padding: 20px 30px;
}