/* style.css - Core TV Layout, Scaling, Focus System & Animations */
@import url('home.css?v=1.1.7');
@import url('vod-portal.css?v=1.1.7');
@import url('live.css?v=2.4.0');
@import url('vod.css?v=1.1.8');
@import url('details.css?v=1.1.8');
@import url('dialogs.css?v=1.3.0');

:root {
    --bg-main: #090D16;
    --bg-card: #151D32;
    --primary: #FFC400;
    --primary-glow: rgba(255, 196, 0, 0.45);
    --primary-border: #FFE082;
    --text-white: #FFFFFF;
    --text-muted: #94A3B8;
    --border-color: rgba(255, 255, 255, 0.12);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-user-select: none;
}

body, html {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden !important;
    background-color: var(--bg-main);
    color: var(--text-white);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Khmer OS Battambang", "Noto Sans Khmer", sans-serif;
    position: relative;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* 1080p TV Master Canvas (Auto-Scales cleanly to fit any screen resolution) */
#app {
    width: 1920px;
    height: 1080px;
    position: absolute;
    top: 0;
    left: 0;
    transform-origin: 0 0;
    overflow: hidden;
    flex-shrink: 0;
    background: #0F172A;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.9);
}

/* Universal Remote D-Pad Focus Highlighting */
.focusable {
    outline: none;
    transition: transform 0.22s cubic-bezier(0.2, 0, 0.2, 1), 
                box-shadow 0.22s ease, 
                border-color 0.22s ease,
                background-color 0.22s ease;
}

.focusable:not(.drawer-cat-item):not(.drawer-ch-card):focus,
.focusable:not(.drawer-cat-item):not(.drawer-ch-card).focused {
    outline: none !important;
    border-color: #FFFFFF !important;
    transform: scale(1.06) !important;
    box-shadow: 0 0 28px rgba(255, 255, 255, 0.5), 0 12px 30px rgba(0, 0, 0, 0.8) !important;
    z-index: 100 !important;
}

/* Dedicated Focus Styles for Drawer List Items (Never scale, Never clip left/right) */
#live-drawer-panel .drawer-cat-item:focus,
#live-drawer-panel .drawer-cat-item.focused,
.drawer-cat-item:focus,
.drawer-cat-item.focused {
    outline: none !important;
    transform: none !important;
    border: 2px solid #FFC400 !important;
    box-shadow: inset 0 0 0 1px rgba(255, 196, 0, 0.6), 0 0 14px rgba(255, 196, 0, 0.35) !important;
    background: rgba(255, 196, 0, 0.22) !important;
    color: #FFFFFF !important;
    border-radius: 12px !important;
}

#live-drawer-panel .drawer-ch-card:focus,
#live-drawer-panel .drawer-ch-card.focused,
.drawer-ch-card:focus,
.drawer-ch-card.focused {
    outline: none !important;
    transform: none !important;
    border: 2px solid #FFC400 !important;
    box-shadow: inset 0 0 0 1px rgba(255, 196, 0, 0.6), 0 0 14px rgba(255, 196, 0, 0.35) !important;
    background: rgba(255, 196, 0, 0.22) !important;
    border-radius: 14px !important;
}

/* View visibility toggles */
.view-container {
    width: 1920px;
    height: 1080px;
    position: absolute;
    top: 0;
    left: 0;
    transition: opacity 0.25s ease;
}

.view-container.hidden,
.hidden {
    display: none !important;
}

/* Custom TV Slim Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.18);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Global Loading Spinner (Minimal & Fast) */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(9, 13, 22, 0.9);
    backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    z-index: 9999;
}

.spinner {
    width: 72px;
    height: 72px;
    border: 6px solid rgba(255, 255, 255, 0.12);
    border-top: 6px solid var(--primary);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    font-size: 22px;
    color: #FFFFFF;
    font-weight: 700;
}
