/* TV-specific styles for Samsung Tizen */
body {
    background-color: #000;
    cursor: none;
    -webkit-user-select: none;
    user-select: none;
}

@media screen and (pointer: fine) {
    body {
        cursor: auto;
    }
}

/* Live TV Page Container */
.tv-player-container {
    width: 100%;
    height: 100%;
    position: relative;
    background: #000;
}

/* Back control — always above video, below sidebar drawer */
.tv-back-bar {
    position: absolute;
    top: 28px;
    left: 28px;
    z-index: 25;
    pointer-events: auto;
}

.tv-back-btn {
    border: none;
    padding: 0;
    cursor: pointer;
    color: #fff;
}

.tv-back-btn .material-icons {
    font-size: 32px;
}

#tv-player {
    width: 100%;
    height: 100%;
    object-fit: fill; /* TVs often use fill for full-screen feel */
    position: absolute;
    top: 0;
    left: 0;
}

/* Status Overlays (Loading/Error) */
.tv-status-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(0,0,0,0.85);
    z-index: 10;
    backdrop-filter: blur(8px);
}

.tv-spinner {
    width: 90px;
    height: 90px;
    border: 10px solid rgba(255,255,255,0.1);
    border-top: 10px solid var(--accent-orange, #ff9800);
    border-radius: 50%;
    animation: tv-spin 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
    margin-bottom: 25px;
    box-shadow: 0 0 20px rgba(255, 152, 0, 0.2);
}

.tv-status-text {
    color: white;
    font-size: 36px;
    font-weight: 600;
    letter-spacing: 1px;
    text-shadow: 0 4px 8px rgba(0,0,0,0.6);
}

@keyframes tv-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Now Playing Info Bar (Premium Top Right - Android Style) */
.tv-info-bar {
    position: absolute;
    top: 40px;
    right: 40px;
    padding: 12px 28px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 12px;
    z-index: 15;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.tv-info-bar.active {
    opacity: 1;
}

.tv-channel-name {
    color: white;
    font-size: 26px;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

/* Channel Sidebar (Sliding Drawer - Left Side - Android Style) */
.tv-side-menu {
    position: absolute;
    top: 0;
    left: 0;
    width: 380px;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(25px);
    z-index: 20;
    padding: 50px 0;
    transform: translateX(-100%);
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    border-right: 1px solid rgba(255,255,255,0.1);
}

.tv-side-menu.active {
    transform: translateX(0);
}

.tv-side-header {
    padding: 0 40px 25px;
    display: flex;
    align-items: center;
    border-bottom: 2px solid rgba(255,255,255,0.1);
    margin-bottom: 20px;
}

.tv-side-header span {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: 1px;
    color: #fff;
}

.tv-channel-list {
    overflow-y: auto;
    height: calc(100% - 100px);
    padding: 0 20px;
}

.tv-channel-item {
    padding: 18px 25px;
    margin-bottom: 8px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s;
    border: 2px solid transparent;
    background: transparent;
}

.tv-channel-item.focusable:focus,
.tv-channel-item.focusable.focused {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.02);
}

.tv-channel-logo {
    width: 64px;
    height: 44px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    padding: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.tv-channel-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.tv-channel-title {
    font-size: 26px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.tv-channel-item.active-channel {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent-orange, #ff9800);
}

.tv-retry-btn {
    margin-top: 40px;
    padding: 18px 50px;
    background: var(--accent-orange, #ff9800);
    color: #000;
    font-weight: 900;
    border-radius: 40px;
    font-size: 28px;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 25px rgba(255, 152, 0, 0.4);
}

.tv-retry-btn.focusable:focus {
    transform: scale(1.15);
    box-shadow: 0 15px 40px rgba(255, 152, 0, 0.6);
}

/* Modals Refined (From original but styled for dark theme) */
.modal-overlay {
    position: fixed; top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.85);
    display: flex; justify-content: center; align-items: center;
    z-index: 9999;
    backdrop-filter: blur(15px);
}

.modal-content {
    background: rgba(25, 28, 35, 0.98);
    border: 2px solid rgba(255,255,255,0.15);
    border-radius: 24px;
    padding: 60px;
    width: 900px; max-width: 95%;
    color: white;
    box-shadow: 0 30px 100px rgba(0,0,0,1);
}

/* Scrollbar styling */
.tv-channel-list::-webkit-scrollbar {
    width: 8px;
}
.tv-channel-list::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.02);
}
.tv-channel-list::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
}