/* ========================================
   Enhanced Media Player Styles
   ======================================== */

/* Audio Player Styles */
.audio-player-enhanced {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    color: white;
    margin-bottom: 1.5rem;
}

.audio-player-enhanced__header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.audio-player-enhanced__content {
    font-size: 1.1rem;
    margin-bottom: 5px;
    font-weight: 500;
}

.audio-player-enhanced__language {
    font-size: 0.9rem;
    opacity: 0.9;
}

.audio-player-enhanced__controls {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.audio-player-enhanced__play-button {
    width: 50px;
    height: 50px;
    min-width: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.2rem;
}

.audio-player-enhanced__play-button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.audio-player-enhanced__play-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.audio-player-enhanced__progress {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.audio-player-enhanced__time {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    opacity: 0.9;
}

.audio-player-enhanced__secondary-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Video Player Styles */
.video-player-enhanced {
    position: relative;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    margin-bottom: 1.5rem;
}

.video-player-enhanced video {
    width: 100%;
    height: auto;
    display: block;
}

.video-player-enhanced__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 50%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.video-player-enhanced:hover .video-player-enhanced__overlay,
.video-player-enhanced.paused .video-player-enhanced__overlay {
    opacity: 1;
    pointer-events: all;
}

.video-player-enhanced__play-overlay {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease;
    font-size: 2rem;
    color: #667eea;
}

.video-player-enhanced__play-overlay:hover {
    transform: scale(1.1);
}

.video-player-enhanced__controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    display: flex;
    flex-direction: column;
    gap: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-player-enhanced:hover .video-player-enhanced__controls,
.video-player-enhanced.paused .video-player-enhanced__controls {
    opacity: 1;
}

.video-player-enhanced__controls-bottom {
    display: flex;
    align-items: center;
    gap: 15px;
    color: white;
}

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

.media-progress-bar:hover {
    height: 8px;
}

.media-progress-bar__buffered {
    position: absolute;
    height: 100%;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 3px;
    pointer-events: none;
}

.media-progress-bar__fill {
    position: absolute;
    height: 100%;
    background: var(--bg-white, white);
    border-radius: 3px;
    transition: width 0.1s linear;
    pointer-events: none;
}

.media-progress-bar__thumb {
    position: absolute;
    width: 14px;
    height: 14px;
    background: var(--bg-white, white);
    border-radius: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}

.media-progress-bar:hover .media-progress-bar__thumb {
    opacity: 1;
}

/* Media Controls */
.media-control-button {
    background: transparent;
    border: none;
    color: white;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.media-control-button:hover {
    background: rgba(255, 255, 255, 0.2);
}

.media-control-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

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

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

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

.volume-control__slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: var(--bg-white, white);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* Playback Speed Control */
.playback-speed-control {
    position: relative;
}

.playback-speed-control__button {
    min-width: 60px;
    text-align: center;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    color: white;
    cursor: pointer;
    font-size: 0.9rem;
}

.playback-speed-control__dropdown {
    position: absolute;
    bottom: 100%;
    left: 0;
    margin-bottom: 8px;
    background: rgba(0, 0, 0, 0.95);
    border-radius: 6px;
    padding: 8px 0;
    min-width: 100px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
}

.playback-speed-control__option {
    padding: 8px 16px;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 0.9rem;
}

.playback-speed-control__option:hover {
    background: rgba(255, 255, 255, 0.1);
}

.playback-speed-control__option--active {
    background: rgba(102, 126, 234, 0.5);
}

/* Media Availability Badge */
.media-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.media-badge__icon {
    font-size: 1.2rem;
    display: inline-flex;
    align-items: center;
}

.media-badge__icon--available {
    color: #10b981;
}

.media-badge__icon--unavailable {
    color: #9ca3af;
    opacity: 0.5;
}

.media-badge__label {
    font-size: 0.85rem;
}

.media-badge--small .media-badge__icon {
    font-size: 1rem;
}

.media-badge--large .media-badge__icon {
    font-size: 1.5rem;
}

/* Loading Spinner */
.media-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.media-loading__spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: media-spin 0.8s linear infinite;
}

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

/* Media Error */
.media-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}

.media-error__icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.media-error__message {
    color: #ef4444;
    margin-bottom: 15px;
}

.media-error__retry {
    background: #ef4444;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.media-error__retry:hover {
    background: #dc2626;
}

/* Responsive Design */
@media (max-width: 768px) {
    .audio-player-enhanced {
        padding: 15px;
    }
    
    .audio-player-enhanced__controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .audio-player-enhanced__secondary-controls {
        justify-content: space-between;
        width: 100%;
    }
    
    .video-player-enhanced__controls {
        padding: 10px;
    }
    
    .video-player-enhanced__play-overlay {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .volume-control__slider {
        width: 60px;
    }
}

/* Dark mode support */
[data-theme="dark"] .media-error {
    background: rgba(239, 68, 68, 0.2);
}

/* Accessibility */
.media-control-button:focus,
.media-progress-bar:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Hide native controls since we're building custom ones */
.audio-player-enhanced audio::-webkit-media-controls-panel,
.video-player-enhanced video::-webkit-media-controls-panel {
    display: none !important;
}

.audio-player-enhanced audio::-webkit-media-controls-play-button,
.video-player-enhanced video::-webkit-media-controls-play-button {
    display: none !important;
}

/* Fullscreen video adjustments */
.video-player-enhanced:fullscreen {
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-player-enhanced:fullscreen video {
    max-height: 100vh;
    max-width: 100vw;
}

/* Media Availability Indicator */
.media-availability-indicator {
    display: flex;
    justify-content: center;
    padding: 0.75rem;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 8px;
}

/* Proverb Enhanced Media Section */
.proverb-enhanced-media-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 2rem 0;
}

[data-theme="dark"] .proverb-enhanced-media-section {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

[data-theme="dark"] .media-availability-indicator {
    background: rgba(102, 126, 234, 0.2);
}

/* Proverb Media Section Enhanced Responsive */
@media (max-width: 768px) {
    .proverb-media-section-enhanced {
        padding: 1rem;
    }
}


