/* UHD Series Player HUD */

#uhdLiveHUD {
    position: fixed;
    inset: 0;
    display: none;
    flex-direction: column;
    justify-content: space-between;
    padding: 60px 80px;
    z-index: 2147483647 !important;
    font-family: 'Outfit', sans-serif;
    pointer-events: auto !important;
}

#uhdSeriesHUD {
    position: fixed;
    inset: 0;
    display: none;
    flex-direction: column;
    justify-content: flex-end;
    /* Push everything to bottom */
    padding: 0;
    /* Removing padding here, apply to bottom section */
    background: linear-gradient(0deg, rgba(8, 8, 16, 0.95) 0%, rgba(8, 8, 16, 0.8) 15%, rgba(8, 8, 16, 0.4) 30%, transparent 60%);
    z-index: 2147483647 !important;
    font-family: 'Outfit', sans-serif;
    pointer-events: auto !important;
}

#uhdSeriesHUD.visible,
#uhdLiveHUD.visible {
    display: flex;
}

/* VOD METADATA (Bottom Anchored) */
.uhd-meta-container {
    display: flex;
    align-items: flex-end;
    gap: 25px;
    margin-bottom: 25px;
}

#uhdLogo {
    width: 140px;
    height: 200px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.uhd-meta-text {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-bottom: 5px;
}

.uhd-episode-title {
    font-size: 42px;
    font-weight: 800;
    color: #fff;
    letter-spacing: 0.5px;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.8);
    line-height: 1.1;
}

.uhd-meta-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.uhd-resolution-badge {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    background: rgba(168, 85, 247, 0.3);
    /* Purple hue from website */
    border: 1px solid rgba(168, 85, 247, 0.5);
    padding: 4px 10px;
    border-radius: 6px;
    letter-spacing: 1px;
}

.uhd-dot-sep {
    color: rgba(255, 255, 255, 0.4);
    font-size: 20px;
}

.uhd-category {
    font-size: 20px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.uhd-buffering {
    color: #facc15;
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-top: 5px;
}

/* CENTER LYRICS/SUBTITLES (Absolute Positioned for VOD) */
.uhd-lyrics-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.uhd-lyrics-text {
    font-size: 40px;
    font-weight: 600;
    color: #fff;
    text-align: center;
    text-shadow: 0 2px 15px rgba(0, 0, 0, 0.9);
}

/* BOTTOM SECTION WRAPPER */
.uhd-bottom-section {
    padding: 0 80px 60px 80px;
}

/* BOTTOM PROGRESS SECTION */
.uhd-progress-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
}

.uhd-progress-bar-wrapper {
    display: flex;
    align-items: center;
    gap: 20px;
}

.uhd-time {
    font-size: 20px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    min-width: 70px;
    font-variant-numeric: tabular-nums;
}

.uhd-progress-rail {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
    position: relative;
    cursor: pointer;
}

.uhd-progress-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: #a855f7;
    /* Website primary purple */
    border-radius: 3px;
    width: 0%;
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.5);
}

.uhd-progress-handle {
    position: absolute;
    top: 50%;
    left: 0%;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    transition: transform 0.2s ease;
}

/* PROGRESS FOCUS STATE */
.uhd-progress-rail.focused {
    height: 8px;
    background: rgba(255, 255, 255, 0.25);
}

.uhd-progress-rail.focused .uhd-progress-fill {
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.8);
}

.uhd-progress-rail.focused .uhd-progress-handle {
    width: 26px;
    height: 26px;
    background: #fff;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.8);
}

/* BOTTOM CONTROL BAR */
.uhd-controls-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.uhd-btn-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.uhd-btn {
    height: 55px;
    min-width: 55px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 27px;
    /* Pill shape */
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.uhd-btn:focus,
.uhd-btn.focused {
    background: #fff;
    color: #000;
    transform: scale(1.05);
    outline: none;
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.4);
    border-color: #fff;
}

.focusable-uhd:focus,
.focusable-uhd.focused {
    outline: none;
    box-shadow: 0 0 0 3px #a855f7 !important;
    /* Unified purple focus */
}

/* ICON SPECIFIC BUTTONS */
.uhd-btn i {
    font-size: 26px;
}

.uhd-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 18px;
    background: rgba(255, 255, 255, 0.15);
}

.uhd-badge span {
    font-size: 18px;
    letter-spacing: 1px;
}

.uhd-badge i {
    font-size: 24px;
    opacity: 0.8;
}

.btn-seek i {
    font-size: 32px;
}

/* PLAY/PAUSE SPECIAL BUTTON */
.uhd-btn.play-pause-btn {
    background: #a855f7;
    color: #fff;
    border: none;
    width: 70px;
    height: 70px;
    border-radius: 35px;
    box-shadow: 0 10px 20px rgba(168, 85, 247, 0.4);
}

.uhd-btn.play-pause-btn i {
    font-size: 28px;
}

.uhd-btn.play-pause-btn.focused {
    background: #fff;
    color: #a855f7;
    box-shadow: 0 0 30px #a855f7;
}

.uhd-audio-badge {
    background: rgba(168, 85, 247, 0.2);
    border-color: rgba(168, 85, 247, 0.3);
}

.uhd-sub-badge {
    background: rgba(255, 255, 255, 0.1);
}

/* ============================================
   UHD LIVE TV HUD - PREMIUM SKIN
   ============================================ */

#uhdLiveHUD {
    justify-content: flex-end;
    padding: 0 60px 60px;
    /* Floating from bottom */
    background: linear-gradient(180deg, transparent 0%, transparent 60%, rgba(0, 0, 0, 0.7) 100%);
}

/* Main Info Bar - Premium Floating Glassmorphic Overlay */
.uhd-live-info-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 36px;
    background: linear-gradient(135deg, rgba(15, 12, 35, 0.95) 0%, rgba(25, 15, 55, 0.92) 100%);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-left: 5px solid #a78bfa;
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 40px rgba(139, 92, 246, 0.15);
    backdrop-filter: blur(25px);
    width: 100%;
}

/* LEFT Section: Logo + Clock */
.uhd-live-left {
    display: flex;
    align-items: center;
    gap: 25px;
    min-width: 200px;
}

.uhd-live-logo {
    width: 80px;
    height: 80px;
    object-fit: cover;
    background: #1a1a2e;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 2px;
}

.uhd-live-clock {
    font-size: 32px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 1px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

/* CENTER Section: Channel + Program */
.uhd-live-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.uhd-live-channel-name {
    font-size: 38px;
    font-weight: 800;
    color: #fff;
    letter-spacing: 1.5px;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 800px;
}

/* RIGHT Section: Number + Resolution */
.uhd-live-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    min-width: 200px;
}

.uhd-live-number {
    font-size: 26px;
    font-weight: 800;
    color: #a78bfa;
    background: rgba(139, 92, 246, 0.1);
    padding: 6px 18px;
    border-radius: 10px;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.uhd-live-resolution {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    padding: 4px 12px;
    border-radius: 8px;
    letter-spacing: 1.5px;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
}

/* ============================================
   UHD TRACK SELECTION CARD (Audio/Subs)
   ============================================ */

.uhd-track-card {
    position: fixed;
    right: 80px;
    top: 50%;
    transform: translateY(-50%);
    width: 380px;
    background: rgba(15, 15, 15, 0.9);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
    display: none;
    flex-direction: column;
    padding: 30px;
    z-index: 2147483647 !important;
    animation: slideInRight 0.3s ease-out;
}

.uhd-track-card.active {
    display: flex;
}

@keyframes slideInRight {
    from {
        transform: translate(100px, -50%);
        opacity: 0;
    }

    to {
        transform: translate(0, -50%);
        opacity: 1;
    }
}

.uhd-track-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.uhd-track-card-title {
    display: flex;
    align-items: center;
    gap: 15px;
}

.uhd-track-card-title i {
    font-size: 32px;
    color: #fff;
}

.uhd-track-card-title span {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
}

.uhd-track-close {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.uhd-track-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 600px;
    overflow-y: auto;
    padding-right: 5px;
}

/* Scrollbar */
.uhd-track-list::-webkit-scrollbar {
    width: 4px;
}

.uhd-track-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

.uhd-track-item {
    padding: 15px 25px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 20px;
    font-weight: 600;
    text-align: center;
    transition: all 0.2s;
    cursor: pointer;
}

.uhd-track-item.selected {
    background: #fbbf24;
    color: #000;
    border-color: #fff;
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.4);
}

.uhd-track-item:focus,
.uhd-track-item.focused {
    background: #fff;
    color: #000;
    transform: scale(1.02);
    box-shadow: 0 0 0 4px #fbbf24;
}

/* ============================================
   SWIPE GESTURE SLIDERS (Mobile)
   ============================================ */

.uhd-swipe-slider {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 200px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    display: none;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    padding: 10px 0;
    z-index: 2147483647;
    transition: opacity 0.2s;
    pointer-events: none;
}

.uhd-swipe-slider.left {
    left: 40px;
}

.uhd-swipe-slider.right {
    right: 40px;
}

.uhd-swipe-icon {
    position: absolute;
    bottom: -35px;
    color: #fff;
    font-size: 20px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

.uhd-swipe-track {
    width: 6px;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    position: relative;
    overflow: hidden;
}

.uhd-swipe-fill {
    width: 100%;
    background: #a855f7;
    /* Matching secondary purple */
    position: absolute;
    bottom: 0;
    left: 0;
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.6);
}

/* ============================================
   UP NEXT AUTO-PLAY PROMPT
   ============================================ */

.uhd-up-next-prompt {
    position: fixed !important;
    bottom: 220px !important;
    /* Fixed padding buffer */
    right: 40px !important;
    /* Down right corner */
    background: rgba(15, 15, 20, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 18px 25px;
    /* Smaller padding */
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 20px;
    /* Less spacing */
    z-index: 10001 !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), 0 0 15px rgba(168, 85, 247, 0.3);
    transform: translateY(40px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.uhd-up-next-prompt.visible {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.uhd-up-next-info {
    display: flex;
    flex-direction: column;
}

.uhd-up-next-label {
    font-size: 16px;
    color: #a855f7;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 6px;
}

.uhd-up-next-title {
    font-size: 26px;
    color: #fff;
    font-weight: 800;
    white-space: nowrap;
    max-width: 400px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.uhd-up-next-btn {
    background: #fbbf24;
    color: #000;
    border: none;
    padding: 14px 28px;
    border-radius: 40px;
    font-size: 18px;
    font-weight: 900;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s;
    box-shadow: 0 5px 15px rgba(251, 191, 36, 0.4);
}

.uhd-up-next-btn:active {
    transform: scale(0.95);
}

.uhd-up-next-btn:focus,
.uhd-up-next-btn.focused {
    background: #fff;
    box-shadow: 0 0 0 5px #fbbf24;
    outline: none;
}

/* Custom button specifically for the Next Episode arrow below timeline */
.btn-next-ep-uhd {
    background: rgba(168, 85, 247, 0.2) !important;
    border-color: rgba(168, 85, 247, 0.4) !important;
    color: #d8b4fe !important;
}

.btn-next-ep-uhd:focus,
.btn-next-ep-uhd.focused {
    background: #a855f7 !important;
    border-color: #d8b4fe !important;
    color: #fff !important;
}

/* Hide Play Now button on TV (non-touch) devices */
.touch-only-upnext {
    display: none !important;
}

body.touch-active .touch-only-upnext {
    display: flex !important;
}