/* Player Container */
#player-modal {
    user-select: none;
}

/* Custom Controls Container */
.player-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px 24px;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 30;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Show controls only when class is present */
#player-modal.show-controls .player-controls,
#player-modal.show-controls #player-header {
    opacity: 1;
}

/* Move subtitles up when controls are visible */
#player-modal.show-controls video::-webkit-media-text-track-container {
    transform: translateY(-80px);
    transition: transform 0.3s ease;
}

#player-modal:not(.show-controls) video::-webkit-media-text-track-container {
    transform: translateY(0);
    transition: transform 0.3s ease;
}

/* Progress Bar */
.progress-container {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    transition: height 0.2s;
}

.progress-container:hover {
    height: 8px;
}

.progress-bar {
    height: 100%;
    background: #E50914;
    border-radius: 3px;
    width: 0%;
    position: relative;
    box-shadow: 0 0 10px rgba(229, 9, 20, 0.5);
}

.progress-bar::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%) scale(0);
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
}

.progress-container:hover .progress-bar::after {
    transform: translateY(-50%) scale(1);
}

/* Buttons & Time */
.controls-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.left-controls, .right-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.control-btn {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1.2rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.control-btn:active {
    transform: scale(0.95);
}

.time-display {
    font-size: 0.9rem;
    font-weight: 500;
    color: #ddd;
    font-variant-numeric: tabular-nums;
}

/* Volume Slider */
.volume-container {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 0;
    overflow: hidden;
    transition: width 0.3s ease;
}

.volume-wrapper:hover .volume-container {
    width: 100px;
}

.volume-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    outline: none;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
}

/* Loading Spinner Override for Player */
#player-loader .loader {
    width: 60px;
    height: 60px;
    border-width: 4px;
}

/* Header Glass Style */
#player-header {
    background: linear-gradient(to bottom, rgba(0,0,0,0.8), transparent);
    padding-top: 20px;
}

#player-header button {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Episodes List Drawer */
#player-episodes-list.show {
    transform: translateY(0);
}

/* Next Episode Button Visibility Logic */
#next-ep-btn {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#player-modal.show-controls #next-ep-btn {
    opacity: 1;
    pointer-events: auto;
}

#next-ep-btn.force-visible {
    opacity: 1 !important;
    pointer-events: auto !important;
}

.ep-card-player {
    min-width: 200px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.ep-card-player:hover {
    background: rgba(255,255,255,0.1);
    transform: translateY(-2px);
}

.ep-card-player.active {
    border-color: #E50914;
    background: rgba(229, 9, 20, 0.1);
}
