/* Watch Page Styling (Separate from Detail) */
.watch-page {
    position: fixed;
    inset: 0;
    z-index: 2200;
    background: #000;
    display: flex;
    flex-direction: column;
    visibility: visible;
    opacity: 1;
    transition: opacity 0.3s;
}

.watch-page.hidden {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

.watch-header {
    height: 50px;
    background: #111;
    display: flex;
    align-items: center;
    padding: 0 15px;
    border-bottom: 1px solid #333;
    gap: 15px;
    z-index: 10;
}

.watch-back-btn {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 4px;
}

.watch-back-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.watch-title {
    font-size: 1rem;
    color: #ddd;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

.watch-content {
    flex: 1;
    display: flex;
    overflow: hidden;
    position: relative;
}

.watch-main {
    flex: 1;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 100%;
}

.video-container-fullscreen {
    width: 100%;
    height: 100%;
}

/* Override detail.css .video-container khi ở fullscreen */
.video-container-fullscreen .video-container {
    width: 100%;
    height: 100%;
    padding-top: 0 !important;
    margin-bottom: 0 !important;
    border-radius: 0 !important;
    position: relative;
}

.video-container-fullscreen .video-player {
    position: relative !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;
}

.video-container-fullscreen .plyr {
    width: 100%;
    height: 100%;
}

.video-container-fullscreen .plyr__video-wrapper {
    height: 100%;
}

.video-container-fullscreen .plyr--video {
    height: 100%;
}

.video-container-fullscreen video {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;
}

/* Quality Selector Overlay */
.quality-selector {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 20;
}

.quality-btn {
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    backdrop-filter: blur(4px);
    transition: all 0.2s;
}

.quality-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    border-color: var(--accent);
}

.quality-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    overflow: hidden;
    min-width: 120px;
    backdrop-filter: blur(8px);
}

.quality-menu.hidden {
    display: none;
}

.quality-option {
    padding: 8px 16px;
    color: #ccc;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.15s;
}

.quality-option:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.quality-option.active {
    color: var(--accent);
    font-weight: 600;
    background: rgba(var(--accent-rgb, 123, 97, 255), 0.15);
}

.watch-sidebar {
    display: none;
}

.sidebar-header {
    padding: 12px 15px;
    background: #222;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h3 {
    margin: 0;
    font-size: 0.9rem;
    color: #eee;
    text-transform: uppercase;
    font-weight: 600;
}

/* Toggle Switch */
.toggle-switch {
    display: flex;
    align-items: center;
    cursor: pointer;
    gap: 8px;
    user-select: none;
}

.toggle-switch input {
    display: none;
}

.slider {
    width: 32px;
    height: 18px;
    background: #555;
    border-radius: 20px;
    position: relative;
    transition: .3s;
}

.slider::before {
    content: "";
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: .3s;
}

input:checked+.slider {
    background: var(--accent);
}

input:checked+.slider::before {
    transform: translateX(14px);
}

.label-text {
    font-size: 0.8rem;
    color: #ccc;
}


/* Episode List Vertical */
.episode-list-vertical {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

/* Custom Scrollbar for sidebar */
.episode-list-vertical::-webkit-scrollbar {
    width: 6px;
}

.episode-list-vertical::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.episode-list-vertical::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 3px;
}

.episode-list-vertical::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

.ep-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 10px 12px;
    text-align: left;
    background: #252525;
    margin-bottom: 6px;
    border: 1px solid #333;
    border-radius: 4px;
    color: #ccc;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.ep-item:hover {
    background: #333;
    border-color: #555;
}

.ep-item.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    font-weight: 600;
}

.ep-name {
    flex: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .watch-content {
        flex-direction: column;
    }

    .watch-sidebar {
        width: 100%;
        height: 40%;
        border-left: none;
        border-top: 1px solid #333;
    }

    .watch-main {
        height: 60%;
    }
}