/* Remote Control Focus Styles */

/* Focus outline */
.focusable {
    position: relative;
    outline: none;
    cursor: pointer;
    touch-action: manipulation; /* Removes 300ms touch delay on mobile */
}

.focusable:focus,
.focusable.focused {
    outline: 4px solid var(--focus-color);
    outline-offset: 4px;
    transform: scale(1.05);
    z-index: 10;
}

/* Button focus effects */
.btn.focusable:focus,
.btn.focusable.focused {
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

/* Nav button focus */
.nav-btn.focusable:focus,
.nav-btn.focusable.focused {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
}

/* Stream card focus */
.stream-card.focusable:focus,
.stream-card.focusable.focused {
    transform: scale(1.08);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6);
    z-index: 100;
    outline: 4px solid var(--focus-color);
    outline-offset: 2px;
}

/* Filter button focus */
.filter-btn.focusable:focus,
.filter-btn.focusable.focused {
    background: var(--gradient);
    transform: scale(1.1);
}

/* Focus animation */
.focusable {
    transition: all 0.2s ease;
}

/* Focus ring glow effect */
@keyframes focus-glow {
    0%, 100% {
        box-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
    }
    50% {
        box-shadow: 0 0 25px rgba(255, 255, 255, 0.8);
    }
}

.focusable:focus,
.focusable.focused {
    animation: focus-glow 1.5s ease-in-out infinite;
}

/* Disable hover effects on TV */
@media (hover: none) {
    .focusable:hover {
        transform: none;
    }

    .focusable:focus,
    .focusable.focused {
        transform: scale(1.05);
    }
}

/* Focus indicator for player overlay */
#player-overlay.active .focusable:focus {
    background: rgba(255, 255, 255, 0.3);
}

/* Settings focus */
.settings-select.focusable:focus,
.settings-select.focusable.focused {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid var(--focus-color);
}

/* Hero play button focus (special treatment) */
.btn-play.focusable:focus,
.btn-play.focusable.focused {
    transform: scale(1.15);
    box-shadow: 0 0 30px rgba(17, 153, 142, 0.8);
}

/* Focus hint for first-time users */
.focus-hint {
    position: fixed;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    padding: 1rem 2rem;
    border-radius: 10px;
    font-size: 1.2rem;
    z-index: 1000;
    animation: fade-in-out 3s ease;
}

@keyframes fade-in-out {
    0%, 100% {
        opacity: 0;
    }
    10%, 90% {
        opacity: 1;
    }
}

/* Scroll indicators */
.stream-carousel::after {
    content: '\2192';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 3rem;
    color: white;
    padding: 1rem;
    background: linear-gradient(to left, rgba(20,20,20,1) 0%, rgba(20,20,20,0) 100%);
    width: 100px;
    text-align: right;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stream-carousel:focus-within::after {
    opacity: 1;
}

/* Loading state focus */
.focusable[disabled],
.focusable.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Mobile: disable TV-style focus highlighting on browse grid (users tap directly) */
@media screen and (max-width: 768px) {
    .stream-grid .stream-card.focusable:focus,
    .stream-grid .stream-card.focusable.focused {
        transform: none;
        outline: none;
        box-shadow: none;
        animation: none;
    }
}

/* Skip to main content (accessibility) */
.skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--primary-color);
    padding: 1rem 2rem;
    z-index: 10000;
}

.skip-link:focus {
    top: 0;
}
