
/* === BẮT ĐẦU: CSS CHO POPUP UP NEXT TỰ ĐỘNG === */
.up-next-container {
    position: absolute;
    bottom: 30px; 
    right: 40px;
    width: 420px;
    background: rgba(15, 15, 15, 0.95); /* Tối hơn chút để nổi bật nội dung */
    border: 2px solid transparent;
    border-radius: 8px;
    z-index: 1050;
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: column;
    flex-direction: column;
    box-shadow: 0 15px 50px rgba(0,0,0,0.9);
    
    -webkit-transition: -webkit-transform 0.3s ease-in-out, border-color 0.2s ease;
    transition: transform 0.3s ease-in-out, border-color 0.2s ease;
    -webkit-transform: translateY(0);
    transform: translateY(0);
}
.up-next-container.ui-visible {
    -webkit-transform: translateY(-120px);
    transform: translateY(-120px);
}

/* KHI TOÀN BỘ POPUP ĐƯỢC FOCUS */
.up-next-container.focus {
    border-color: rgba(255, 255, 255, 0.8) !important; /* Màu trắng sáng tinh tế */
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.1) !important;
    transform: scale(1.02);
    outline: none !important;
}

.up-next-content {
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: row;
    flex-direction: row;
    -webkit-align-items: center;
    align-items: center;
    padding: 20px;
}

.up-next-thumb {
    width: 140px;
    height: 79px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 20px;
    background-color: #04101a;
    -webkit-flex-shrink: 0;
    flex-shrink: 0;
}

.up-next-info {
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: column;
    flex-direction: column;
    -webkit-justify-content: center;
    justify-content: center;
    -webkit-flex-grow: 1;
    flex-grow: 1;
    overflow: hidden;
}

/* Dòng 1: UP NEXT: S1 E2 */
.up-next-label {
    font-size: 14px;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 8px;
    font-weight: 800;
}

/* Dòng 2: Tên tập phim (Tự động rớt tối đa 2 dòng) */
.up-next-title {
    font-size: 20px;
    color: #fff;
    font-weight: bold;
    line-height: 1.3;
    margin-bottom: 5px;
    white-space: normal; 
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.up-next-progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
}

.up-next-fill {
    width: 100%;
    height: 100%;
    background: #14f195;
}

/* Thanh tiến trình toả sáng thêm khi popup được focus */
.up-next-container.focus .up-next-fill {
    box-shadow: 0 0 10px #14f195;
}
/* === KẾT THÚC: CSS CHO POPUP UP NEXT === */
/* ==========================================
   CSS CHO TOAST NOTIFICATION (TỰ ĐỘNG ẨN)
   ========================================== */
.toast-container {
    position: fixed;
    top: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px); /* Bắt đầu ở vị trí thấp hơn */
    background: rgba(20, 20, 20, 0.95);
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
    border-left: 4px solid #14f195; /* Màu xanh mặc định */
    z-index: 9999;
    display: flex;
    align-items: center;
    font-size: 16px;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Class kích hoạt hiệu ứng nổi lên */
.toast-container.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast-icon {
    margin-right: 12px;
    display: flex;
    align-items: center;
}

/* Các biến thể màu sắc */
.toast-error { border-left-color: #e50914; }
.toast-success { border-left-color: #14f195; }
.toast-warning { border-left-color: #f39c12; }
.toast-info { border-left-color: #3498db; }

/* Khung chứa ảnh */
.up-next-thumb {
    width: 200px;           /* Hoặc kích thước bạn đang dùng */
    height: 112px;          /* Tỉ lệ 16:9 cho đẹp */
    background-color: #2a2a2a; /* Màu nền xám đậm khi thiếu ảnh */
    display: block;
    object-fit: cover;      /* Đảm bảo ảnh không bị méo */
    border-radius: 4px;
    position: relative;
}

/* Hiệu ứng hiển thị mượt mà */
#up-next-img {
    transition: opacity 0.3s ease;
}

	/* Patch v8 visual tweaks (ES5-safe): stronger dim for headers & unselected items */
	#audio-sub-panel h4 { color: rgba(255,255,255,0.45) !important; } /* ~30% dimmer */
	#audio-sub-panel li { color: rgba(255,255,255,0.55) !important; } /* ~30% dimmer */
	#audio-sub-panel li.selected { color: #fff !important; font-weight: bold; }

/* === SubSource / OpenSubtitles source badges trong subtitle panel === */
.sub-source-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: bold;
    padding: 1px 5px;
    border-radius: 3px;
    margin-right: 6px;
    vertical-align: middle;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}
.sub-source-badge-os {
    background: rgba(3, 166, 120, 0.25);
    color: #03a678;
    border: 1px solid rgba(3, 166, 120, 0.5);
}
.sub-source-badge-ss {
    background: rgba(255, 165, 0, 0.2);
    color: #ffa500;
    border: 1px solid rgba(255, 165, 0, 0.45);
}
