#player-container {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    background: #000;
    z-index: 9999;
    overflow: hidden;
}

.video-container {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0; left: 0;
    background: #000;
}

.video-container .video-js,
.video-container .vjs-tech {
    width: 100% !important;
    height: 100% !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    padding-top: 0 !important;
}

.video-container video {
    width: 100% !important;
    height: 100% !important;
    position: absolute !important;
    top: 0 !important; left: 0 !important;
    object-fit: contain;
}

.vjs-loading-spinner { display: none !important; }
.vjs-big-play-button { display: none !important; }
.vjs-control-bar    { display: none !important; }

.controls-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding-bottom: 8px;
    background: linear-gradient(rgba(0,0,0,0) 0%, rgba(0,0,0,0.5) 40%, rgba(0,0,0,0.92) 100%);
    transition: opacity 0.4s ease;
    z-index: 10;
    min-height: 120px;
}
.controls-container.hidden { opacity: 0; pointer-events: none; }

.progress-controls {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    padding: 0 16px 6px;
}

.progress-bar {
    flex: 1;
    height: 4px;
    background: rgba(255,255,255,0.25);
    display: flex;
    align-items: center;
    cursor: pointer;
    border-radius: 2px;
    position: relative;
    margin: 0 10px;
    transition: height 0.15s ease;
}
.progress-bar:hover { height: 6px; }

.watched-bar {
    background: var(--primary-color);
    height: 100%;
    border-radius: 3px;
    position: absolute;
    left: 0; top: 0;
    transition: width 0.2s linear;
}

.playhead {
    width: clamp(12px, 1.5vw, 20px);
    height: clamp(12px, 1.5vw, 20px);
    background: var(--primary-color);
    border-radius: 50%;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    transition: left 0.2s linear;
    box-shadow: 0 0 4px rgba(0,0,0,0.6);
}

.time-remaining {
    font-size: 13px;
    min-width: 72px;
    text-align: right;
    color: rgba(255,255,255,0.8);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    letter-spacing: 0.03em;
}

.controls {
    width: 100%;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding: 4px 8px 8px;
    gap: 2px;
}

.controls button {
    background: none;
    outline: none;
    box-shadow: none;
    border: none;
    width: 44px;
    height: 44px;
    opacity: 0.85;
    transition: opacity 0.15s, transform 0.15s;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-radius: 50%;
}
.controls button:hover { opacity: 1; transform: scale(1.12); background: rgba(255,255,255,0.1); }

.controls button svg {
    fill: white;
    stroke: white;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    width: 100%;
    height: 100%;
}

.controls button.volume svg path,
.controls button.full-screen svg,
.controls button.back-btn-player svg,
.controls button.audio-tracks svg { fill: none; }

.controls button.audio-tracks { display: none; }
.track-selector-popup { display: none !important; }

.controls button.rewind svg,
.controls button.fast-forward svg { stroke: none; }

.play-pause .paused  { display: block; }
.play-pause .playing { display: none;  }
.volume .muted { display: none; }
.full-screen .minimize { display: none; }

.controls .title {
    flex: 1;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    overflow: hidden;
    white-space: nowrap;
    margin: 0 4px;
}
.controls .title .series  { color: #fefefe; font-weight: bold; overflow: hidden; text-overflow: ellipsis; }
.controls .title .episode { color: #a1a1a1; font-size: 0.8em; }

.loading-spinner {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    display: none;
    z-index: 20;
    pointer-events: none;
}

.spinner-ring {
    width: 64px; height: 64px;
    border: 5px solid rgba(255,255,255,0.15);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

.seek-feedback {
    position: absolute;
    top: 50%;
    transform: translateY(-50%) scale(0.8);
    opacity: 0;
    z-index: 9999;
    pointer-events: none;
    transition: all 0.25s ease;
}

.seek-feedback.show {
    transform: translateY(-50%) scale(1);
    opacity: 1;
}

.seek-feedback-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    width: 90px;
    height: 90px;

    border-radius: 50%;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(6px);

    color: #fff;
    font-size: 14px;
    font-weight: 500;
}

.seek-feedback svg {
    margin-bottom: 4px;
}

.seek-text {
    font-size: 13px;
    opacity: 0.9;
}

.controls button.playback-speed {
    width: 44px;
    height: 44px;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.controls button.playback-speed .speed-icon svg {
    width: 60%;
    height: 100%;
    flex-shrink: 0;
    fill: white;
    stroke: white;
    stroke-width: 2;
}

#speed-label {
    font-size: 0.8em;
    font-weight: 700;
    line-height: 1;
    display: inline-block;
    min-width: 20px;
    text-align: center;
}

.speed-popup .speed-option {
    font-size: 15px;
    padding: 12px 20px;
}

.speed-popup {
    position: absolute;
    bottom: 65px; 
    right: 12px;
    background: rgba(20, 20, 20, 0.95);
    border-radius: 12px;
    padding: 6px 0;
    z-index: 10000;
    display: none; 
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.1);
    min-width: 110px;
    overflow: hidden;
    z-index: 2147483647 !important; 
}

.speed-option {
    padding: 10px 20px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    text-align: center;
    transition: background 0.2s ease;
}

.speed-option:hover {
    background: rgba(255,255,255,0.15);
}

.speed-option.active {
    color: var(--primary-color);
    font-weight: bold;

}

@media (max-width: 768px) {
    .speed-popup {
        position: fixed;
        top: 50%;
        left: 50%;
        bottom: auto;
        right: auto;
        transform: translate(-50%, -50%);
        width: 85%;
        max-width: 320px;
        background: #222;
        border-radius: 2px;
        padding: 10px 0;
        min-width: unset;
    }
    
    .controls button.playback-speed{
        width: 48px;
        height: 48px;
    }

    .speed-popup::before {
        display: none; 
    }

    .speed-options-container {
        flex-direction: column;
        padding: 0;
    }

    .speed-options-container::after {
        display: none;
    }

    .speed-option {
        display: flex;
        align-items: center;
        padding: 14px 20px;
        text-align: left;
        font-size: 16px;
        color: #fff;
        width: 100%;
        padding-top: 14px;
    }

    .speed-option::before {
        position: static;
        transform: none;
        margin-right: 15px;
        width: 18px;
        height: 18px;
        background: transparent;
        border: 2px solid #757575;
    }

    .speed-option.active::before {
        background: #fff;
        border: 4px solid #222; 
        box-shadow: 0 0 0 2px #fff;
        width: 18px;
        height: 18px;
        top: auto;
    }
}

.pp-feedback {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;

    z-index: 9999;
    pointer-events: none;

    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.pp-feedback.show {
    opacity: 1;
    transform: scale(1);
}

.pp-feedback-inner {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.pp-feedback svg {
    width: 40px;
    height: 40px;
    fill: #fff;
}

.pp-feedback .playing {
    display: none;
}