/**
 * Hopzle Video Player Styles
 * Modern, responsive video player with beautiful UI and animations
 */

/* Video Modal */
.video-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease-out;
}

.video-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.video-modal-content {
    position: relative;
    width: 90%;
    max-width: 1200px;
    height: 80%;
    max-height: 80vh;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: scaleIn 0.3s ease-out;
}

/* Video Container */
.video-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.modal-video {
    width: 100%;
    flex: 1;
    background: #000;
    object-fit: contain;
}

/* Video Controls */
.video-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    padding: 20px;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.controls-row {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Progress Bar */
.progress-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.progress-bar {
    position: relative;
    height: 6px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    cursor: pointer;
    transition: height 0.2s ease;
}

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

.progress-filled {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, #ff85d6, #8b5cf6);
    border-radius: 3px;
    transition: width 0.1s ease;
}

.progress-thumb {
    position: absolute;
    top: 50%;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.2s ease;
}

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

.time-display {
    display: flex;
    justify-content: space-between;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
}

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

.control-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.control-btn i {
    font-size: 16px;
}

/* Play/Pause Button - Special Styling */
#play-pause-btn {
    width: 54px;
    height: 54px;
    background: linear-gradient(135deg, #ff85d6, #8b5cf6);
    margin-right: 10px;
}

#play-pause-btn:hover {
    background: linear-gradient(135deg, #ff47b2, #7c3aed);
    transform: scale(1.15);
}

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

.volume-slider-container {
    position: relative;
    width: 80px;
    opacity: 0;
    transform: scaleX(0);
    transform-origin: left;
    transition: all 0.3s ease;
}

.volume-control:hover .volume-slider-container {
    opacity: 1;
    transform: scaleX(1);
}

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

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

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

/* Playback Speed */
.playback-speed {
    margin-left: auto;
}

.speed-select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    backdrop-filter: blur(10px);
}

.speed-select:focus {
    outline: none;
    border-color: #8b5cf6;
}

.speed-select option {
    background: #333;
    color: #fff;
}

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

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #8b5cf6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Video Info */
.video-info {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 60px;
    color: #fff;
    z-index: 10;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.video-modal-content:hover .video-info {
    opacity: 1;
    transform: translateY(0);
}

.video-info h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

.video-info p {
    margin: 0 0 8px 0;
    font-size: 14px;
    opacity: 0.9;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

.video-meta {
    display: flex;
    gap: 15px;
    font-size: 12px;
    opacity: 0.8;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

/* Close Button */
.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    color: #fff;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 15;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.modal-close:hover {
    background: rgba(255, 0, 0, 0.8);
    transform: scale(1.1);
}

.modal-close i {
    font-size: 18px;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

/* Fullscreen Styles */
.video-modal-content:fullscreen {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    border-radius: 0;
}

.video-modal-content:-webkit-full-screen {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    border-radius: 0;
}

.video-modal-content:-moz-full-screen {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    border-radius: 0;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .video-modal-content {
        width: 95%;
        height: 70%;
        border-radius: 8px;
    }

    .video-controls {
        padding: 15px;
    }

    .controls-row {
        gap: 12px;
    }

    .control-buttons {
        gap: 10px;
        justify-content: space-between;
    }

    .control-btn {
        width: 40px;
        height: 40px;
    }

    #play-pause-btn {
        width: 48px;
        height: 48px;
    }

    .time-display {
        font-size: 12px;
    }

    .video-info {
        top: 15px;
        left: 15px;
        right: 55px;
    }

    .video-info h3 {
        font-size: 16px;
    }

    .video-info p {
        font-size: 13px;
    }

    .video-meta {
        font-size: 11px;
        gap: 10px;
    }

    .modal-close {
        top: 10px;
        right: 10px;
        width: 36px;
        height: 36px;
    }

    /* Touch-friendly volume control */
    .volume-slider-container {
        width: 60px;
        opacity: 1;
        transform: scaleX(1);
    }

    .volume-slider {
        height: 6px;
    }

    .volume-slider::-webkit-slider-thumb {
        width: 18px;
        height: 18px;
    }

    .volume-slider::-moz-range-thumb {
        width: 18px;
        height: 18px;
    }
}

@media (max-width: 480px) {
    .video-modal-content {
        width: 100%;
        height: 60%;
        border-radius: 0;
    }

    .control-buttons {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }

    .control-btn {
        width: 36px;
        height: 36px;
    }

    #play-pause-btn {
        width: 44px;
        height: 44px;
        margin-right: 5px;
    }

    .playback-speed {
        margin-left: 0;
        order: 10;
        width: 100%;
        text-align: center;
        margin-top: 8px;
    }

    .speed-select {
        width: 80px;
        font-size: 11px;
        padding: 6px 8px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .video-controls {
        background: rgba(0, 0, 0, 0.95);
    }

    .control-btn {
        background: rgba(255, 255, 255, 0.9);
        color: #000;
    }

    .progress-bar {
        background: #666;
    }

    .progress-filled {
        background: #fff;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .video-modal,
    .video-modal-content,
    .control-btn,
    .progress-thumb,
    .video-info,
    .volume-slider-container {
        transition: none;
        animation: none;
    }

    .loading-spinner {
        animation: none;
        border-top-color: #8b5cf6;
    }
}

/* Focus styles for accessibility */
.control-btn:focus,
.speed-select:focus,
.volume-slider:focus,
.modal-close:focus {
    outline: 2px solid #8b5cf6;
    outline-offset: 2px;
}

.progress-bar:focus {
    outline: 2px solid #8b5cf6;
    outline-offset: 4px;
}

/* Custom scrollbar for select dropdown */
.speed-select::-webkit-scrollbar {
    width: 8px;
}

.speed-select::-webkit-scrollbar-track {
    background: #333;
}

.speed-select::-webkit-scrollbar-thumb {
    background: #666;
    border-radius: 4px;
}

.speed-select::-webkit-scrollbar-thumb:hover {
    background: #888;
}
