/* YouTube Custom Player Styles */

.ycp-player-container {
    position: relative;
    max-width: 100%;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.ycp-video-wrapper {
    position: relative;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.ycp-video-player {
    width: 100%;
    height: 100%;
    position: relative;
}

.ycp-video-player iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* Custom Controls */
.ycp-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;
}

.ycp-video-wrapper:hover .ycp-controls,
.ycp-video-wrapper.playing .ycp-controls {
    opacity: 1;
    pointer-events: all;
}

/* Progress Bar */
.ycp-progress-bar {
    position: relative;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    cursor: pointer;
    margin-bottom: 15px;
    overflow: hidden;
}

.ycp-progress-filled {
    height: 100%;
    background: #ff0000;
    border-radius: 2px;
    transition: width 0.1s ease;
    position: relative;
}

.ycp-progress-markers {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    pointer-events: none;
}

.ycp-progress-marker {
    position: absolute;
    top: 0;
    width: 2px;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    pointer-events: all;
}

.ycp-progress-marker:hover {
    background: #fff;
    transform: scaleX(2);
}

/* Main Controls */
.ycp-controls-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.ycp-controls-left,
.ycp-controls-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Buttons */
.ycp-btn {
    background: none;
    border: none;
    color: #fff;
    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;
}

.ycp-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

.ycp-btn:active {
    transform: scale(0.95);
}

.ycp-btn.playing {
    background: rgba(255, 255, 255, 0.1);
}

/* Icons */
.ycp-icon-play,
.ycp-icon-pause,
.ycp-icon-rewind,
.ycp-icon-forward,
.ycp-icon-volume,
.ycp-icon-volume-low,
.ycp-icon-volume-mute,
.ycp-icon-fullscreen {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.ycp-icon-play {
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8 5v14l11-7z"/></svg>') no-repeat center;
    background-size: contain;
}

.ycp-icon-pause {
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M6 19h4V5H6v14zm8-14v14h4V5h-4z"/></svg>') no-repeat center;
    background-size: contain;
    display: none;
}

.ycp-icon-rewind {
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 5V1L7 6l5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8z"/></svg>') no-repeat center;
    background-size: contain;
}

.ycp-icon-forward {
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 5V1L7 6l5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8z"/></svg>') no-repeat center;
    background-size: contain;
    transform: scaleX(-1);
}

.ycp-icon-volume {
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77z"/></svg>') no-repeat center;
    background-size: contain;
}

.ycp-icon-volume-low {
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18.5 12c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM5 9v6h4l5 5V4L9 9H5z"/></svg>') no-repeat center;
    background-size: contain;
}

.ycp-icon-volume-mute {
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M16.5 12c0-1.77-1.02-3.29-2.5-4.03v2.21l2.45 2.45c.03-.2.05-.41.05-.63zm2.5 0c0 .94-.2 1.82-.54 2.64l1.51 1.51C20.63 14.91 21 13.5 21 12c0-4.28-2.99-7.86-7-8.77v2.06c2.89.86 5 3.54 5 6.71zM4.27 3L3 4.27 7.73 9H3v6h4l5 5v-6.73l4.25 4.25c-.67.52-1.42.93-2.25 1.18v2.06c1.38-.31 2.63-.95 3.69-1.81L19.73 21 21 19.73l-9-9L4.27 3zM12 4L9.91 6.09 12 8.18V4z"/></svg>') no-repeat center;
    background-size: contain;
}

.ycp-icon-fullscreen {
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"/></svg>') no-repeat center;
    background-size: contain;
}

/* Volume Control */
.ycp-volume-control {
    position: relative;
    display: flex;
    align-items: center;
}

.ycp-volume-slider {
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.9);
    padding: 10px;
    border-radius: 4px;
    margin-left: 10px;
    display: none;
    z-index: 1000;
}

.ycp-volume-control:hover .ycp-volume-slider {
    display: block;
}

.ycp-volume-range {
    width: 80px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.ycp-volume-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
}

.ycp-volume-range::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* Time Display */
.ycp-time {
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

/* Quality and Speed Selectors */
.ycp-quality-select,
.ycp-speed-select {
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 12px;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
}

.ycp-quality-select:hover,
.ycp-speed-select:hover {
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(0, 0, 0, 0.8);
}

.ycp-quality-select option,
.ycp-speed-select option {
    background: #000;
    color: #fff;
}

/* Fullscreen Styles */
.ycp-video-wrapper.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    border-radius: 0;
}

.ycp-video-wrapper.fullscreen .ycp-controls {
    padding: 30px 20px 20px;
}

/* Error State */
.ycp-error {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    background: #f8f9fa;
    color: #dc3545;
    font-size: 16px;
    text-align: center;
    border-radius: 8px;
}

/* Loading State */
.ycp-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: #6c757d;
    font-size: 16px;
}

.ycp-loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #e9ecef;
    border-top: 2px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .ycp-controls {
        padding: 15px 10px 10px;
    }
    
    .ycp-controls-main {
        gap: 10px;
    }
    
    .ycp-controls-left,
    .ycp-controls-right {
        gap: 5px;
    }
    
    .ycp-btn {
        min-width: 32px;
        height: 32px;
        padding: 6px;
    }
    
    .ycp-icon-play,
    .ycp-icon-pause,
    .ycp-icon-rewind,
    .ycp-icon-forward,
    .ycp-icon-volume,
    .ycp-icon-volume-low,
    .ycp-icon-volume-mute,
    .ycp-icon-fullscreen {
        width: 16px;
        height: 16px;
    }
    
    .ycp-time {
        font-size: 12px;
    }
    
    .ycp-quality-select,
    .ycp-speed-select {
        padding: 4px 8px;
        font-size: 11px;
    }
    
    .ycp-volume-slider {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .ycp-controls-right {
        display: none;
    }
    
    .ycp-controls-left {
        justify-content: center;
        width: 100%;
    }
}

/* Custom Theme Colors */
.ycp-player-container[data-theme-color="#ff0000"] .ycp-progress-filled {
    background: #ff0000;
}

.ycp-player-container[data-theme-color="#00ff00"] .ycp-progress-filled {
    background: #00ff00;
}

.ycp-player-container[data-theme-color="#0000ff"] .ycp-progress-filled {
    background: #0000ff;
}

.ycp-player-container[data-theme-color="#ffff00"] .ycp-progress-filled {
    background: #ffff00;
}

.ycp-player-container[data-theme-color="#ff00ff"] .ycp-progress-filled {
    background: #ff00ff;
}

.ycp-player-container[data-theme-color="#00ffff"] .ycp-progress-filled {
    background: #00ffff;
}

/* Accessibility */
.ycp-btn:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

.ycp-progress-bar:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .ycp-controls {
        background: rgba(0, 0, 0, 0.95);
    }
    
    .ycp-btn {
        border: 1px solid #fff;
    }
    
    .ycp-progress-bar {
        background: rgba(255, 255, 255, 0.5);
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .ycp-controls,
    .ycp-btn,
    .ycp-progress-filled {
        transition: none;
    }
    
    .ycp-btn:hover {
        transform: none;
    }
} 