:root {
    --bg-dark: #000000;
    --primary: #2563eb;
    --primary-glow: rgba(37, 99, 235, 0.5);
    --accent-red: #ef4444;
    --text-main: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.6);
    --glass-bg: rgba(7, 26, 64, 0.92);
    --glass-border: rgba(255, 255, 255, 0.2);
    --transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);

    /* TV Scaling Factors */
    --tv-base-font: 1.2rem;
    --tv-title-font: 3.5vw;
}

.tv-player-wp-container {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background-color: #000;
    font-family: 'Inter', -apple-system, system-ui, sans-serif;
    color: var(--text-main);
    overflow: hidden;
    font-size: var(--tv-base-font);
}

.tv-player-wp-container .hidden {
    display: none !important;
}

.tv-player-wp-container video {
    width: 100vw;
    height: 100vh;
    object-fit: cover;
}

/* --- LOADING SCREEN (Cinematic V3.1) --- */
.tv-player-wp-container .loading-overlay {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 1.2s ease, visibility 1.2s ease;
}

.tv-player-wp-container .loading-canvas {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(30, 64, 175, 0.25) 0%, transparent 75%);
    z-index: 1;
}

.tv-player-wp-container .loading-content {
    position: relative;
    z-index: 2;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4vh;
}

.tv-player-wp-container .loading-logo {
    width: 35vw;
    max-width: 500px;
    filter: drop-shadow(0 0 50px rgba(255, 255, 255, 0.15));
    animation: loadingPulse 3s infinite ease-in-out;
}

.tv-player-wp-container .loading-shimmer {
    font-size: 1.2vw;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5vw;
    color: rgba(255, 255, 255, 0.25);
    background: linear-gradient(90deg, transparent, #fff, transparent);
    background-size: 80% 100%;
    background-repeat: no-repeat;
    -webkit-background-clip: text;
    background-clip: text;
    animation: shimmer 2.5s infinite linear;
}

.tv-player-wp-container .loading-overlay.fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

@keyframes loadingPulse {
    0% {
        transform: scale(0.96);
        opacity: 0.85;
    }

    50% {
        transform: scale(1);
        opacity: 1;
    }

    100% {
        transform: scale(0.96);
        opacity: 0.85;
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

/* --- MINI-GUIDE (TV Optimized) --- */
.tv-player-wp-container .mini-guide-bar {
    position: absolute;
    bottom: 4vh;
    left: 50%;
    transform: translateX(-50%);
    width: 70vw;
    background: var(--glass-bg);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    z-index: 1000;
    padding: 1.5vh 1.5vw;
    box-shadow: 0 20px 50px rgba(0, 50, 150, 0.4);
}

.tv-player-wp-container .mini-guide-inner {
    display: flex;
    align-items: center;
    gap: 1.5vw;
}

.tv-player-wp-container .mini-logo {
    width: 5vw;
    height: 5vw;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.tv-player-wp-container .mini-number {
    font-size: 2.8vw;
    font-weight: 1000;
    text-shadow: 0 0 20px var(--primary-glow);
}

.tv-player-wp-container .mini-info {
    flex: 1;
    padding: 0 2vw;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: flex-start !important;
    overflow: hidden;
    text-align: left;
}

.tv-player-wp-container .channel-main-name {
    display: block !important;
    font-size: 2vw;
    font-weight: 1000;
    margin-bottom: 0px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.1;
    width: 100%;
}

.tv-player-wp-container .program-now {
    display: block !important;
    font-size: 1.1vw;
    font-weight: 700;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px !important;
    width: 100%;
}

.tv-player-wp-container .mini-right {
    display: flex;
    align-items: center;
    gap: 2vw;
    padding-right: 1vw;
}

.tv-player-wp-container .mini-clock {
    font-size: 1.8vw;
    font-weight: 1000;
    letter-spacing: -1px;
    color: #fff;
}

.tv-player-wp-container .mini-btn-stack {
    display: flex;
    flex-direction: column;
    gap: 0.8vh;
}

.tv-player-wp-container .btn-ver-grade {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 1vh 2vw;
    border-radius: 100px;
    font-size: 0.9vw;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
}

/* CATEGORY TABS (V4.6 Premium) */
.tv-player-wp-container .epg-categories {
    padding: 2vh 5vw;
    display: flex;
    flex-wrap: wrap;
    gap: 1vw;
    justify-content: flex-start;
    align-items: center;
}

.tv-player-wp-container .cat-tab {
    padding: 1.2vh 2.5vw;
    font-size: 0.9vw;
    font-weight: 800;
    border-radius: 100px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.15);
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tv-player-wp-container .cat-tab:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.tv-player-wp-container .cat-tab.active,
.tv-player-wp-container .cat-tab.focused {
    background: var(--primary);
    color: #fff;
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 25px var(--primary-glow);
}

.tv-player-wp-container .btn-ver-grade.focused {
    background: #fff;
    color: #000;
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.3);
    outline: none;
}

.tv-player-wp-container .btn-ver-grade.primary-action {
    background: var(--primary-color);
    border-color: rgba(255, 255, 255, 0.3);
}

/* --- EPG OVERLAY REFINEMENT V4.1 --- */
.tv-player-wp-container .epg-container {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at center, rgba(7, 26, 64, 0.8) 0%, rgba(0, 0, 0, 0.98) 100%);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.4s ease;
}

.tv-player-wp-container .epg-header {
    padding: 3vh 5vw 2vh;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

.tv-player-wp-container .epg-header h2 {
    font-size: 2.2vw;
    font-weight: 1000;
    margin: 0;
    color: #fff;
    text-shadow: 0 0 30px rgba(37, 99, 235, 0.6);
    white-space: nowrap;
}

.tv-player-wp-container .epg-tabs {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    padding: 5px;
}

.tv-player-wp-container .tab {
    padding: 10px 24px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 100px;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s var(--transition-smooth);
}

.tv-player-wp-container .tab.active {
    background: var(--primary);
    color: #fff;
    border-color: #3b82f6;
    box-shadow: 0 0 25px var(--primary-glow);
}

.tv-player-wp-container .tab.focused {
    background: rgba(255, 255, 255, 0.2);
    border-color: #ffffff;
    color: #fff;
    transform: scale(1.05);
}

.tv-player-wp-container .epg-body {
    flex: 1;
    overflow-y: auto;
    scrollbar-width: none;
    padding: 10px;
}

.tv-player-wp-container .epg-body::-webkit-scrollbar {
    display: none;
}

/* CHANNEL GRID & CARDS (V4.3 CLEAN) */
.tv-player-wp-container .epg-grid {
    flex: 1;
    padding: 0 5vw 5vh;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(13vw, 1fr));
    gap: 1.5vw;
    overflow-y: auto;
}

.tv-player-wp-container .channel-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 1.2vh 1vw;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.8vh;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    aspect-ratio: 1.2 / 1;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    cursor: pointer;
}

.tv-player-wp-container .channel-card.focused {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
    transform: scale(1.05);
    box-shadow: 0 0 40px var(--primary-glow);
}

.tv-player-wp-container .channel-card .card-logo {
    width: 5vw;
    height: 5vw;
    object-fit: contain;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.3));
}

.tv-player-wp-container .channel-card .card-content {
    text-align: center;
    width: 100%;
}

.tv-player-wp-container .channel-card .card-number {
    position: absolute;
    top: 0.8vh;
    left: 0.8vh;
    background: var(--primary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7vw;
    font-weight: 1000;
    line-height: 1;
}

.tv-player-wp-container .channel-card .card-name {
    font-size: 1.3vw;
    font-weight: 900;
    margin-bottom: 3px;
    color: #fff;
}

.tv-player-wp-container .channel-card .card-program {
    font-size: 0.85vw;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
}

/* SCHEDULE LIST REFINEMENT V4.0 */
.tv-player-wp-container .schedule-list {
    display: flex;
    flex-direction: column;
    gap: 1vh;
}

.tv-player-wp-container .schedule-item {
    display: flex;
    align-items: center;
    gap: 1.5vw;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    padding: 1.2vh 2vw;
    border-radius: 12px;
    transition: all 0.3s;
}

.tv-player-wp-container .schedule-item .item-time {
    font-size: 1.2vw;
    font-weight: 1000;
    color: var(--primary-color);
    min-width: 5vw;
}

.tv-player-wp-container .schedule-item .item-name {
    font-size: 1.1vw;
    font-weight: 800;
}

.tv-player-wp-container .schedule-item.focused {
    background: rgba(255, 255, 255, 0.1);
    border-color: #fff;
    transform: scale(1.02);
}

.tv-player-wp-container .schedule-item.active {
    border-color: var(--primary-color);
    background: rgba(59, 130, 246, 0.1);
}

/* HINT BAR REFINEMENT */
.tv-player-wp-container .epg-footer {
    padding: 2vh 5vw;
    background: rgba(0, 0, 0, 0.3);
}

.tv-player-wp-container .hint-bar {
    display: flex;
    justify-content: flex-start;
    gap: 2vw;
}

.tv-player-wp-container .hint-item {
    display: flex;
    align-items: center;
    gap: 0.8vw;
    font-size: 0.9vw;
    font-weight: 800;
    color: var(--text-muted);
}

.tv-player-wp-container .hint-item .key {
    background: rgba(37, 99, 235, 0.2);
    padding: 2px 10px;
    border-radius: 4px;
    color: #fff;
    border: 1px solid rgba(37, 99, 235, 0.4);
    font-weight: 900;
}

/* ANIMATIONS */
@keyframes wpSlideUp {
    from {
        transform: translate(-50%, 60px);
        opacity: 0;
    }

    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}