/* ========== khflix-Playlist Styles ========== */
.khflix-Playlist-episode-section {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 15px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    margin-top: 25px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.khflix-Playlist-episode-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    width: 100%;
    min-height: 40px;
    gap: 10px;
}

.khflix-Playlist-episode-title {
    color: #fff;
    font-size: 20px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    margin: 0;
    padding: 0;
    line-height: 1;
    white-space: nowrap;
}

.khflix-Playlist-episode-title span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    line-height: 1;
}

.khflix-Playlist-episode-badge {
    background: linear-gradient(135deg, #e74c3c, #f39c12);
    color: #fff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: bold;
    flex-shrink: 0;
    white-space: nowrap;
    line-height: 1;
}

.khflix-Playlist-scroll-container {
    position: relative;
    display: flex;
    align-items: center;
}

.khflix-Playlist-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 8px 4px;
    cursor: grab;
    scrollbar-width: thin;
    scrollbar-color: #e74c3c #1a1a2e;
    -webkit-overflow-scrolling: touch;
    flex: 1;
}

.khflix-Playlist-scroll:active {
    cursor: grabbing;
}

.khflix-Playlist-scroll::-webkit-scrollbar {
    height: 5px;
}

.khflix-Playlist-scroll::-webkit-scrollbar-track {
    background: #1a1a2e;
    border-radius: 10px;
}

.khflix-Playlist-scroll::-webkit-scrollbar-thumb {
    background: #e74c3c;
    border-radius: 10px;
}

/* ========== Episode Button ========== */
.khflix-Playlist-button {
    box-sizing: border-box;
    position: relative;
    -webkit-user-select: none;
    user-select: none;
    cursor: pointer;
    outline: none;
    border: none;
    -webkit-tap-highlight-color: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    white-space: nowrap;
    text-decoration: none;
    vertical-align: baseline;
    text-align: center;
    margin: 0;
    min-width: 48px;
    height: 36px;
    line-height: 30px;
    padding: 4px 10px;
    border-radius: 6px;
    overflow: hidden;
    transform: translate3d(0, 0, 0);
    transition: background 400ms cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s ease;
    flex-shrink: 0;
    background: #1a1a2e;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    font-family: inherit;
}

.khflix-Playlist-button:hover {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    border-color: #e74c3c;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.4);
}

.khflix-Playlist-button:active {
    transform: translateY(0px);
    box-shadow: 0 2px 6px rgba(231, 76, 60, 0.3);
}

.khflix-Playlist-button.khflix-Playlist-active {
    background: linear-gradient(135deg, #e74c3c, #f39c12);
    border-color: #f39c12;
    box-shadow: 0 3px 10px rgba(231, 76, 60, 0.5);
}

/* ========== CC Icon ========== */
.khflix-Playlist-cc-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 14px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    font-size: 8px;
    font-weight: bold;
    letter-spacing: 0.5px;
    line-height: 1;
    color: #fff;
    flex-shrink: 0;
    text-transform: uppercase;
}

.khflix-Playlist-button.khflix-Playlist-active .khflix-Playlist-cc-icon {
    background: rgba(255, 255, 255, 0.3);
}

/* ========== Episode Number ========== */
.khflix-Playlist-number {
    font-size: 14px;
    font-weight: bold;
    line-height: 1;
    display: block;
}

/* ========== Play Indicator ========== */
.khflix-Playlist-indicator {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 5px;
    height: 5px;
    background: #2ecc71;
    border-radius: 50%;
    opacity: 0;
    transition: all 0.3s ease;
}

.khflix-Playlist-button.khflix-Playlist-active .khflix-Playlist-indicator {
    opacity: 1;
    animation: khflix-Playlist-blink 1s infinite;
}

@keyframes khflix-Playlist-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ========== Error Indicator - បង្ហាញតែភាគដែលមានបញ្ហា ========== */
.khflix-Playlist-error-indicator {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    background: #ff0000;
    border-radius: 50%;
    color: #fff;
    font-size: 9px;
    font-weight: bold;
    display: none;
    align-items: center;
    justify-content: center;
    line-height: 1;
    z-index: 10;
    box-shadow: 0 0 8px rgba(255, 0, 0, 0.8);
}

.khflix-Playlist-button.khflix-Playlist-error {
    border-color: #ff0000 !important;
    box-shadow: 0 0 8px rgba(255, 0, 0, 0.5) !important;
}

.khflix-Playlist-button.khflix-Playlist-error .khflix-Playlist-error-indicator {
    display: inline-flex !important;
    animation: khflix-error-blink 0.5s step-end infinite;
}

@keyframes khflix-error-blink {
    0%, 100% { 
        opacity: 1; 
        transform: scale(1); 
    }
    50% { 
        opacity: 0.2; 
        transform: scale(1.3); 
    }
}

.khflix-Playlist-button.khflix-Playlist-error .khflix-Playlist-cc-icon,
.khflix-Playlist-button.khflix-Playlist-error .khflix-Playlist-number {
    opacity: 0.6;
}

/* ========== Navigation Arrows ========== */
.khflix-Playlist-nav {
    box-sizing: border-box;
    position: relative;
    -webkit-user-select: none;
    user-select: none;
    cursor: pointer;
    outline: none;
    border: none;
    -webkit-tap-highlight-color: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    text-decoration: none;
    vertical-align: baseline;
    text-align: center;
    margin: 0;
    min-width: 32px;
    width: 32px;
    height: 32px;
    line-height: 32px;
    padding: 0;
    border-radius: 50%;
    overflow: hidden;
    transform: translate3d(0, 0, 0);
    transition: background 400ms cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s ease;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 14px;
    z-index: 10;
}

.khflix-Playlist-nav:hover {
    background: #e74c3c;
    border-color: #e74c3c;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.4);
}

.khflix-Playlist-nav:active {
    transform: scale(0.95);
    box-shadow: 0 2px 6px rgba(231, 76, 60, 0.3);
}

.khflix-Playlist-nav.khflix-Playlist-left {
    margin-right: 4px;
}

.khflix-Playlist-nav.khflix-Playlist-right {
    margin-left: 4px;
}

/* ========== លាក់ Related Button ========== */
.jw-related-btn,
.jw-related,
.jw-overlay.jw-related,
.jw-card-container.jw-related,
.jw-nextup-container,
.jw-nextup,
.jw-related-shelf,
.jw-shelf-widget {
    display: none !important;
}

/* ========== Responsive Design ========== */
@media (max-width: 600px) {
    .khflix-Playlist-button {
        min-width: 42px;
        height: 32px;
        padding: 3px 8px;
    }
    .khflix-Playlist-number {
        font-size: 12px;
    }
    .khflix-Playlist-cc-icon {
        width: 16px;
        height: 12px;
        font-size: 7px;
    }
    .khflix-Playlist-nav {
        min-width: 28px;
        width: 28px;
        height: 28px;
        line-height: 28px;
        font-size: 12px;
    }
    .khflix-Playlist-episode-section {
        padding: 15px;
    }
    .khflix-Playlist-episode-title {
        font-size: 16px;
    }
    .khflix-Playlist-episode-badge {
        font-size: 11px;
        padding: 5px 10px;
    }
}