/* TV Style Sheet - Fully compatible with old 2017 Smart TV web browsers */

* {
    margin: 0;
    padding: 0;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

body.tv-body {
    background-color: #0d0d0d;
    color: #e0e0e0;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 18px;
    overflow: hidden;
    width: 100%;
    height: 100vh;
}

/* Float columns for maximum backward compatibility */
.tv-sidebar {
    width: 33%;
    height: 100%;
    float: left;
    background-color: #141414;
    border-right: 2px solid #222;
    position: relative;
    padding-bottom: 20px;
}

.tv-workspace {
    width: 67%;
    height: 100%;
    float: right;
    background-color: #080808;
    position: relative;
    padding: 20px;
}

/* Header Info on Sidebar */
.tv-header {
    padding: 25px 20px;
    background-color: #1c1c1c;
    border-bottom: 2px solid #2a2a2a;
}

.tv-title {
    font-size: 26px;
    color: #8b5cf6;
    font-weight: bold;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.tv-subtitle {
    font-size: 14px;
    color: #888;
}

.tv-search-input {
    width: 100%;
    padding: 12px 15px;
    background-color: #222;
    border: 2px solid #333;
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
    margin: 12px 0;
    outline: none;
}

.tv-search-input.focused {
    background-color: #2a2a2a;
    border-color: #8b5cf6;
    animation: neonPulse 1.5s infinite ease-in-out;
}

/* Channel scroll list */
.tv-channel-list {
    height: calc(100% - 160px);
    overflow-y: auto;
    padding: 10px;
}

/* Channel Row Item */
.tv-channel-item {
    display: block;
    width: 100%;
    padding: 15px;
    margin-bottom: 10px;
    background-color: #1f1f1f;
    border: 2px solid transparent;
    border-radius: 8px;
    text-align: left;
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
    outline: none;
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
}

/* Active stream playing marker */
.tv-channel-item.active {
    background-color: #291d4a;
    border-color: #5b21b6;
    color: #fff;
}

.tv-channel-item.focused {
    background-color: #3b286e;
    color: #fff;
    animation: neonPulse 1.5s infinite ease-in-out;
    -webkit-transform: scale(1.02) translate3d(0, 0, 0);
    transform: scale(1.02) translate3d(0, 0, 0);
}

.tv-channel-logo {
    width: 45px;
    height: 35px;
    float: left;
    margin-right: 15px;
    border-radius: 4px;
    background-color: #000;
}

.tv-channel-info {
    overflow: hidden;
}

.tv-channel-name {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tv-channel-meta {
    font-size: 13px;
    color: #777;
}

/* Right side Video Workspace */
.player-container {
    width: 100%;
    position: relative;
    background-color: #000;
    border: 2px solid #222;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 16/9;
}

.tv-video-element {
    width: 100%;
    height: 100%;
    display: block;
}

/* Overlay message over video */
.status-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 10;
    text-align: center;
    display: block; /* Managed by JS show/hide */
}

.status-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 22px;
    color: #e0e0e0;
    font-weight: bold;
}

/* Info under player */
.tv-info-widget {
    margin-top: 20px;
    background-color: #141414;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #222;
}

.tv-active-title {
    font-size: 24px;
    color: #fff;
    margin-bottom: 8px;
}

.tv-active-desc {
    font-size: 15px;
    color: #999;
    line-height: 1.4;
    margin-bottom: 20px;
}

/* TV Button controls toolbar */
.tv-toolbar {
    margin-top: 15px;
}

.tv-btn {
    display: inline-block;
    padding: 12px 24px;
    margin-right: 12px;
    background-color: #222;
    border: 2px solid transparent;
    border-radius: 8px;
    color: #ccc;
    font-size: 16px;
    font-weight: bold;
    outline: none;
    cursor: pointer;
}

.tv-btn.focused {
    background-color: #8b5cf6;
    color: #fff;
    animation: neonPulse 1.5s infinite ease-in-out;
}

.tv-btn:active {
    background-color: #7c3aed;
}

/* Scrollbar support */
.tv-channel-list {
    scrollbar-width: thin;
    scrollbar-color: #8b5cf6 #0d0d0d;
}
.tv-channel-list::-webkit-scrollbar {
    width: 8px;
}
.tv-channel-list::-webkit-scrollbar-track {
    background: #0d0d0d;
    border-radius: 8px;
}
.tv-channel-list::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #8b5cf6, #6d28d9);
    border-radius: 8px;
}
.tv-channel-list::-webkit-scrollbar-thumb:hover {
    background: #a78bfa;
}

/* Status Dot styling for channel items */
.tv-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    float: right;
    margin-top: 10px;
    margin-left: 10px;
}
.tv-status-dot.online {
    background-color: #22c55e; /* Green */
}
.tv-status-dot.offline {
    background-color: #ef4444; /* Red */
}
.tv-status-dot.checking {
    background-color: #64748b; /* Slate gray */
    opacity: 0.5;
}

.tv-latency-badge {
    display: inline-block;
    padding: 4px 8px;
    background-color: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 6px;
    color: #c084fc;
    font-size: 12px;
    font-weight: bold;
    vertical-align: middle;
    margin-top: -4px;
}

/* Vibrant pulsing focus glow for lean-back TV navigation */
@keyframes neonPulse {
    0% {
        border-color: #8b5cf6;
        box-shadow: 0 0 10px rgba(139, 92, 246, 0.6), 0 0 20px rgba(139, 92, 246, 0.3);
    }
    50% {
        border-color: #d946ef;
        box-shadow: 0 0 20px rgba(217, 70, 239, 0.9), 0 0 35px rgba(217, 70, 239, 0.5);
    }
    100% {
        border-color: #8b5cf6;
        box-shadow: 0 0 10px rgba(139, 92, 246, 0.6), 0 0 20px rgba(139, 92, 246, 0.3);
    }
}


