/**
 * Enhanced Video Controls CSS
 * Brand new, modern floating video control system
 * Designed specifically for YouTube overlay integration
 * Version: 20250125-001
 */

/* Main Control Container */
.enhanced-video-controls {
    position: absolute;
    top: 60px;
    right: 10px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.9), rgba(20, 20, 20, 0.9));
    border-radius: 10px;
    padding: 8px;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 
        0 6px 15px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    z-index: 1000;
    pointer-events: auto;
    width: 120px; /* Much more compact for 2 buttons */
    max-width: 70vw;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Hover zone in top-right corner */
.panel-hover-zone {
    position: absolute;
    top: 0;
    right: 0;
    width: 80px;
    height: 80px;
    z-index: 998;
    background: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 0 0 0 20px;
}

/* Subtle hint when hovering over panel */
.panel:hover .panel-hover-zone {
    background: rgba(76, 175, 80, 0.1);
}

/* Control icon hint */
.panel-hover-zone::after {
    content: '⚙️';
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 16px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.panel:hover .panel-hover-zone::after {
    opacity: 0.6;
}

/* Show controls only when hovering over the hover zone */
.panel-hover-zone:hover .enhanced-video-controls {
    opacity: 1;
    visibility: visible;
    transform: scale(1.02);
}

/* Hide controls by default */
.enhanced-video-controls {
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Control Rows */
.control-row {
    display: flex;
    align-items: center;
    gap: 8px; /* Slightly more space for 2 buttons */
    margin-bottom: 0; /* No margin needed for single row */
    justify-content: center; /* Center the 2 buttons */
}

.control-row:last-child {
    margin-bottom: 0;
}

/* Primary Controls Row */
.primary-controls {
    justify-content: center;
    flex-wrap: wrap;
}

/* Progress Bar Row */
.progress-row {
    position: relative;
    margin: 20px 0;
}

/* Time Display */
.time-display {
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    min-width: 80px;
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 6px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Control Buttons */
.control-btn {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 
        0 4px 12px rgba(76, 175, 80, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.control-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.control-btn:hover::before {
    left: 100%;
}

.control-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 
        0 8px 20px rgba(76, 175, 80, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.4);
}

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

/* Special button styles */
.play-pause-btn {
    background: linear-gradient(135deg, #FF5722, #E64A19);
    box-shadow: 
        0 4px 12px rgba(255, 87, 34, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.play-pause-btn:hover {
    box-shadow: 
        0 8px 20px rgba(255, 87, 34, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.mute-btn {
    background: linear-gradient(135deg, #9C27B0, #7B1FA2);
    box-shadow: 
        0 4px 12px rgba(156, 39, 176, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.mute-btn:hover {
    box-shadow: 
        0 8px 20px rgba(156, 39, 176, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* Seek buttons */
.seek-btn {
    background: linear-gradient(135deg, #2196F3, #1976D2);
    box-shadow: 
        0 4px 12px rgba(33, 150, 243, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.seek-btn:hover {
    box-shadow: 
        0 8px 20px rgba(33, 150, 243, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* Progress Bar */
.progress-container {
    position: relative;
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    overflow: hidden;
    cursor: pointer;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
    border-radius: 4px;
    transition: width 0.1s ease;
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 12px;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3));
    border-radius: 0 4px 4px 0;
}

.progress-handle {
    position: absolute;
    top: 50%;
    right: -6px;
    width: 10px;
    height: 10px;
    background: #ffffff;
    border-radius: 50%;
    transform: translateY(-50%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.progress-container:hover .progress-handle {
    opacity: 1;
}

/* Volume Control */
.volume-container {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 100px;
}

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

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 10px;
    height: 10px;
    background: #4CAF50;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
}

.volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.volume-slider::-moz-range-thumb {
    width: 10px;
    height: 10px;
    background: #4CAF50;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* Secondary Controls */
.secondary-controls {
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.secondary-btn {
    width: 40px;
    height: 40px;
    font-size: 14px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.secondary-btn:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1));
    border-color: rgba(255, 255, 255, 0.4);
}

/* Speed Control */
.speed-control {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ffffff;
    font-size: 14px;
}

.speed-select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #ffffff;
    padding: 4px 8px;
    font-size: 12px;
    cursor: pointer;
}

.speed-select:focus {
    outline: none;
    border-color: #4CAF50;
}

/* Loading State */
.control-btn.loading {
    position: relative;
    pointer-events: none;
}

.control-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Error State */
.control-btn.error {
    background: linear-gradient(135deg, #F44336, #D32F2F);
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .enhanced-video-controls {
        min-width: 90vw;
        padding: 15px;
    }
    
    .control-btn {
        width: 45px;
        height: 45px;
        font-size: 16px;
    }
    
    .secondary-btn {
        width: 35px;
        height: 35px;
        font-size: 12px;
    }
    
    .time-display {
        font-size: 12px;
        padding: 4px 8px;
    }
}

@media (max-width: 480px) {
    .enhanced-video-controls {
        min-width: 95vw;
        padding: 12px;
    }
    
    .control-row {
        gap: 10px;
    }
    
    .control-btn {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }
    
    .secondary-btn {
        width: 30px;
        height: 30px;
        font-size: 10px;
    }
}

/* Accessibility */
.control-btn:focus {
    outline: 2px solid #4CAF50;
    outline-offset: 2px;
}

.enhanced-video-controls:focus-within {
    outline: 2px solid #4CAF50;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .enhanced-video-controls {
        background: #000000;
        border: 2px solid #ffffff;
    }
    
    .control-btn {
        border: 2px solid #ffffff;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .enhanced-video-controls,
    .control-btn,
    .progress-bar {
        transition: none;
    }
    
    .control-btn::before {
        display: none;
    }
}
