/**
 * Advanced Video Player Styles
 * Modern, Netflix-inspired player UI
 * 
 * @package fmovie
 * @version 1.0.0
 */

/* Player Container */
.player-container {
    position: relative;
    width: 100%;
    background: #000;
    overflow: hidden;
}

.player-container video {
    width: 100%;
    height: auto;
    display: block;
}

/* Advanced Controls */
.advanced-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) 50%, transparent 100%);
    padding: 40px 20px 20px;
    opacity: 0;
    transform: translateY(100%);
    transition: all 0.3s ease;
    z-index: 10;
}

.advanced-controls.visible,
.player-container:hover .advanced-controls {
    opacity: 1;
    transform: translateY(0);
}

/* Progress Container */
.progress-container {
    margin-bottom: 15px;
}

.progress-bar {
    position: relative;
    width: 100%;
    height: 5px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    cursor: pointer;
    transition: height 0.2s ease;
}

.progress-bar:hover {
    height: 8px;
}

.progress-buffered {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 3px;
    pointer-events: none;
}

.progress-filled {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: #e50914;
    border-radius: 3px;
    pointer-events: none;
}

.progress-handle {
    position: absolute;
    top: 50%;
    right: -6px;
    width: 12px;
    height: 12px;
    background: #e50914;
    border-radius: 50%;
    transform: translateY(-50%) scale(0);
    transition: transform 0.2s ease;
    pointer-events: none;
}

.progress-bar:hover .progress-handle {
    transform: translateY(-50%) scale(1);
}

.time-display {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 8px;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
}

.time-display .separator {
    opacity: 0.6;
}

/* Controls Bottom */
.controls-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.controls-left,
.controls-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Buttons */
.advanced-controls button {
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.advanced-controls button:hover {
    background: rgba(255, 255, 255, 0.1);
}

.advanced-controls button i {
    font-size: 20px;
}

.btn-play i {
    font-size: 24px;
}

/* Volume Control */
.volume-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.volume-slider {
    width: 0;
    opacity: 0;
    transition: all 0.3s ease;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    outline: none;
}

.volume-control:hover .volume-slider {
    width: 80px;
    opacity: 1;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
}

.volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* Quality Selector */
.quality-selector,
.speed-selector {
    position: relative;
}

.quality-menu,
.speed-menu {
    position: absolute;
    bottom: 100%;
    right: 0;
    background: rgba(0, 0, 0, 0.95);
    border-radius: 8px;
    padding: 8px 0;
    margin-bottom: 10px;
    min-width: 120px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.quality-selector:hover .quality-menu,
.speed-selector:hover .speed-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.quality-option,
.speed-option {
    padding: 10px 20px;
    color: #fff;
    cursor: pointer;
    transition: background 0.2s ease;
    font-size: 14px;
}

.quality-option:hover,
.speed-option:hover {
    background: rgba(255, 255, 255, 0.1);
}

.quality-option.active,
.speed-option.active {
    color: #e50914;
    font-weight: 600;
}

.quality-label,
.speed-label {
    font-size: 13px;
    font-weight: 500;
}

/* Skip Indicator */
.skip-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 15px 25px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: fadeInOut 1s ease;
    pointer-events: none;
    z-index: 20;
}

.skip-indicator i {
    font-size: 24px;
}

@keyframes fadeInOut {

    0%,
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }

    20%,
    80% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Player Notification */
.player-notification {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    animation: slideInRight 0.3s ease;
    z-index: 20;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Resume Prompt */
.resume-prompt {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.95);
    color: #fff;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    z-index: 20;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.resume-prompt p {
    margin: 0 0 20px;
    font-size: 16px;
    font-weight: 500;
}

.resume-prompt button {
    background: #e50914;
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin: 0 8px;
    transition: all 0.2s ease;
}

.resume-prompt .btn-start-over {
    background: rgba(255, 255, 255, 0.1);
}

.resume-prompt button:hover {
    transform: scale(1.05);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Fullscreen Styles */
.player-container:fullscreen {
    width: 100vw;
    height: 100vh;
}

.player-container:fullscreen video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Picture-in-Picture Active */
.player-container.pip-active {
    /* Styles when PiP is active */
}

/* Next Episode Overlay */
.next-episode-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 30;
    animation: fadeIn 0.3s ease;
}

.next-episode-content {
    text-align: center;
    max-width: 500px;
    padding: 40px;
}

.next-episode-info {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
}

.next-episode-thumbnail {
    width: 120px;
    height: 180px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.next-episode-text {
    text-align: left;
    flex: 1;
}

.next-episode-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    margin: 0 0 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.next-episode-title {
    color: #fff;
    font-size: 24px;
    margin: 0;
    font-weight: 600;
    line-height: 1.3;
}

.countdown-container {
    position: relative;
    display: inline-block;
    margin: 30px 0;
}

.countdown-circle {
    transform: rotate(-90deg);
}

.countdown-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.2);
    stroke-width: 4;
}

.countdown-progress {
    fill: none;
    stroke: #e50914;
    stroke-width: 4;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s linear;
}

.countdown-number {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 32px;
    font-weight: 700;
}

.next-episode-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.next-episode-actions button {
    background: #e50914;
    color: #fff;
    border: none;
    padding: 14px 28px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.next-episode-actions .btn-cancel {
    background: rgba(255, 255, 255, 0.1);
}

.next-episode-actions button:hover {
    transform: scale(1.05);
}

.next-episode-actions button i {
    font-size: 18px;
}

/* Next Episode Button (appears 30s before end) */
.next-episode-button {
    position: absolute;
    bottom: 100px;
    right: 20px;
    background: rgba(0, 0, 0, 0.9);
    border-radius: 8px;
    padding: 15px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 25;
    animation: slideInRight 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.next-episode-button:hover {
    background: rgba(0, 0, 0, 0.95);
    border-color: #e50914;
    transform: translateX(-5px);
}

.next-episode-button.hidden {
    opacity: 0;
    transform: translateX(100%);
    pointer-events: none;
}

.next-episode-preview {
    display: flex;
    align-items: center;
    gap: 15px;
}

.next-episode-preview i {
    font-size: 32px;
    color: #e50914;
}

.next-episode-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.next-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.next-title {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
}

/* Loading Spinner */
.player-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #e50914;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 15;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .advanced-controls {
        padding: 30px 15px 15px;
    }

    .controls-left,
    .controls-right {
        gap: 5px;
    }

    .advanced-controls button {
        padding: 6px;
    }

    .advanced-controls button i {
        font-size: 18px;
    }

    .btn-play i {
        font-size: 22px;
    }

    .volume-control:hover .volume-slider {
        width: 60px;
    }

    .time-display {
        font-size: 12px;
    }

    .quality-label,
    .speed-label {
        display: none;
    }

    .skip-indicator {
        padding: 12px 20px;
        font-size: 14px;
    }

    .resume-prompt {
        padding: 20px;
        max-width: 90%;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .player-container {
        background: #000;
    }
}

/* Accessibility */
.advanced-controls button:focus {
    outline: 2px solid #e50914;
    outline-offset: 2px;
}

/* Smooth Transitions */
* {
    -webkit-tap-highlight-color: transparent;
}

/* Custom Scrollbar for Menus */
.quality-menu::-webkit-scrollbar,
.speed-menu::-webkit-scrollbar {
    width: 6px;
}

.quality-menu::-webkit-scrollbar-track,
.speed-menu::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.quality-menu::-webkit-scrollbar-thumb,
.speed-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.quality-menu::-webkit-scrollbar-thumb:hover,
.speed-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}