/* Main CSS for Neo Skola TV App - TV-optimized */

/* Global reset and TV-safe area basics */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* TV-optimized root settings */
:root {
    /* TV-safe area (10% margins) */
    --tv-safe-area-horizontal: 5%;
    --tv-safe-area-vertical: 5%;

    /* Common TV resolutions */
    --hd-width: 1280px;
    --full-hd-width: 1920px;
    --ultra-hd-width: 3840px;

    /* Font sizes that work well across TV distances */
    /* Chrome 75 compatible - use fallback values for min() function */
    --font-large: 32px; /* Fallback for min(32px, 4vw) */
    --font-medium: 24px; /* Fallback for min(24px, 3vw) */
    --font-small: 16px; /* Fallback for min(16px, 2.5vw) */
    --font-xs: 14px; /* Fallback for min(14px, 2vw) */

    /* Brand colors */
    --primary-color: #ED1C24;
    /* Red accent color */
    --secondary-color: #ffffff;
    /* White */
    --accent-color: #ED1C24;
    /* Red */
    --dark-bg: #000000;
    /* Black background */
    --light-text: #ffffff;
    /* White text */
}

html {
    /* Force hardware acceleration */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    margin: 0;
    padding: 0;
    /* Apply the custom font */
    font-family: 'Brandon Grotesque', sans-serif;
    background-color: var(--dark-bg);
    color: var(--light-text);
    overflow: hidden;
    /* Prevent scrolling on the body */

    /* For spatial navigation on TVs */
    nav-index: 0;
}

#app {
    width: 100%;
    height: 100vh;
    position: relative;
    overflow: hidden;

    /* Chrome 75 compatible - remove aspect-ratio (not supported) */
    /* aspect-ratio: 16/9; - Not supported in Chrome 75 */
    max-width: 100%;
    max-height: 100%;
    margin: 0 auto;
}

/* Focus states for TV remote navigation */
:focus {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

button:focus, a:focus {
    box-shadow: 0 0 0 3px rgba(237, 28, 36, 0.5);
}

/* Common TV-optimized components */
button {
    font-size: var(--font-small);
    padding: 12px 30px;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: var(--primary-color);
    color: white;
}

/* Loading indicator - Chrome 75 compatible */
.loading-initial {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--dark-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: var(--font-large);
    color: var(--light-text);
    text-align: center;
    font-weight: bold;
    z-index: 9999;
}

/* Enhanced loading spinner - Chrome 75 compatible */
.loading-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--dark-bg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-family: 'Brandon Grotesque', sans-serif;
    z-index: 9999;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.loading-logo {
    margin-bottom: 30px;
    font-size: 48px;
    font-weight: bold;
    color: var(--primary-color);
    letter-spacing: 2px;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    margin-bottom: 20px;
    position: relative;
}

.loading-spinner-ring {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(237, 28, 36, 0.1);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: loading-spin 1s linear infinite;
}

/* Chrome 75 compatible keyframe animation */
@keyframes loading-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    font-size: var(--font-medium);
    color: var(--light-text);
    margin-top: 10px;
    opacity: 0.8;
}

.loading-dots {
    display: inline-block;
    font-size: var(--font-medium);
    color: var(--light-text);
}

.loading-dots::after {
    content: '';
    animation: loading-dots 1.5s steps(4, end) infinite;
}

/* Chrome 75 compatible dots animation */
@keyframes loading-dots {
    0%, 20% { content: ''; }
    40% { content: '.'; }
    60% { content: '..'; }
    80%, 100% { content: '...'; }
}

/* TV-safe loading progress bar */
.loading-progress {
    width: 300px;
    height: 4px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    margin-top: 20px;
    overflow: hidden;
    position: relative;
}

.loading-progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #ff4444);
    border-radius: 2px;
    animation: loading-progress 2s ease-in-out infinite;
}

/* Chrome 75 compatible progress animation */
@keyframes loading-progress {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

/* Pulsing effect for the logo */
.loading-logo {
    animation: loading-pulse 2s ease-in-out infinite;
}

@keyframes loading-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.05); }
}

/* Alternative simple loading for low-power devices */
.loading-simple {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--dark-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: var(--font-large);
    color: var(--light-text);
    text-align: center;
    font-weight: bold;
    z-index: 9999;
}

.loading-simple-text {
    animation: loading-fade 1.5s ease-in-out infinite;
}

@keyframes loading-fade {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* TV-specific responsive loading adjustments */
/* Standard HD TVs (720p) */
@media screen and (max-width: 1280px) {
    .loading-logo {
        font-size: 36px;
        margin-bottom: 20px;
    }
    
    .loading-progress {
        width: 250px;
    }
    
    .loading-text {
        font-size: var(--font-small);
    }
}

/* Full HD TVs (1080p) */
@media screen and (min-width: 1281px) and (max-width: 1920px) {
    .loading-logo {
        font-size: 48px;
        margin-bottom: 30px;
    }
    
    .loading-progress {
        width: 300px;
    }
    
    .loading-text {
        font-size: var(--font-medium);
    }
}

/* 4K UHD TVs */
@media screen and (min-width: 1921px) {
    .loading-logo {
        font-size: 64px;
        margin-bottom: 40px;
    }
    
    .loading-spinner {
        width: 80px;
        height: 80px;
    }
    
    .loading-spinner-ring {
        width: 80px;
        height: 80px;
        border-width: 6px;
    }
    
    .loading-progress {
        width: 400px;
        height: 6px;
    }
    
    .loading-text {
        font-size: var(--font-large);
    }
}

/* Spatial navigation for TV remotes */
.focusable {
    nav-index: 1;
}

/* Media queries for different TV resolutions */
/* Standard HD TVs (720p) */
@media screen and (max-width: 1280px) {
    #app {
        font-size: var(--font-small);
    }
}

/* Full HD TVs (1080p) */
@media screen and (min-width: 1281px) and (max-width: 1920px) {
    #app {
        font-size: var(--font-medium);
    }
}

/* 4K UHD TVs */
@media screen and (min-width: 1921px) {
    #app {
        font-size: var(--font-large);
    }
}

/* Different aspect ratios */
/* For 4:3 TVs (older models) */
@media screen and (aspect-ratio: 4/3) {
    #app {
        padding: calc(var(--tv-safe-area-vertical) * 1.5) var(--tv-safe-area-horizontal);
    }
}

/* For ultra-wide TVs */
@media screen and (aspect-ratio: 21/9) {
    #app {
        padding: var(--tv-safe-area-vertical) calc(var(--tv-safe-area-horizontal) * 2);
    }
}