:root {
    --bg-dark: #0a0a0f;
    --bg-panel: rgba(20, 20, 30, 0.7);
    --primary: #6366f1;
    --primary-hover: #818cf8;
    --text-main: #ffffff;
    --text-muted: #a1a1aa;
    --glass-border: rgba(255, 255, 255, 0.08);
    --focus-ring: #fff;
    --ad-color: #f59e0b;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow: hidden;
    /* Important for Smart TV to avoid standard scrolling */
    user-select: none;
}

#app {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--bg-panel);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem;
    z-index: 10;
    transition: transform 0.3s ease;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 3rem;
    color: var(--primary);
    font-size: 2rem;
}

.logo-text {
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.5px;
}

.nav-links {
    list-style: none;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    color: var(--text-muted);
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.2s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.nav-item i {
    font-size: 1.5rem;
}

.nav-item.active {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.bottom-ad {
    margin-top: auto;
}

.ad-placeholder {
    background: rgba(255, 255, 255, 0.05);
    border: 1px dashed var(--text-muted);
    border-radius: 12px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    padding: 1rem;
}

/* Main Content */
#main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-y: auto;
    /* Web scroll fallback */
    overflow-x: hidden;
}

/* Hide scrollbar for TV feel */
#main-content::-webkit-scrollbar {
    display: none;
}

#main-content {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 3rem;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 20;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent);
}

.welcome-msg {
    font-size: 1.2rem;
    font-weight: 600;
}

.status-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.5rem;
}

/* Hero Section */
.hero-section {
    position: relative;
    height: 60vh;
    min-height: 400px;
    display: flex;
    align-items: flex-end;
    padding: 3rem;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -2;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, #0a0a0f 20%, transparent 60%),
        linear-gradient(to top, #0a0a0f 10%, transparent 50%);
    z-index: -1;
}

.hero-content {
    max-width: 600px;
}

.badge {
    background: var(--primary);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
    display: inline-block;
}

.hero-title {
    font-size: 4rem;
    line-height: 1.1;
    margin-bottom: 1rem;
}

.hero-desc {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    line-height: 1.5;
}

.hero-btn {
    background: var(--text-main);
    color: #000;
    border: 3px solid transparent;
    padding: 1rem 2rem;
    border-radius: 30px;
    font-size: 1.2rem;
    font-weight: 700;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* Content Scroll System */
.content-scroll {
    padding: 0 3rem 4rem 3rem;
    display: flex;
    flex-direction: column;
    gap: 3rem;
    transform: translateY(0);
    transition: transform 0.3s ease;
}

/* Ad Banner Row */
.ad-banner-row {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(245, 158, 11, 0.05));
    border: 2px solid transparent;
    border-radius: 16px;
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.ad-banner-row::before {
    content: "PUBLICIDAD";
    position: absolute;
    top: 0;
    right: 0;
    background: var(--ad-color);
    color: #000;
    font-size: 0.6rem;
    font-weight: 800;
    padding: 0.2rem 0.5rem;
    border-bottom-left-radius: 8px;
}

.banner-content h3 {
    color: var(--ad-color);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

/* Rows and Cards */
.row-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.cards-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: max-content;
    gap: 1.5rem;
    padding-bottom: 1rem;
}

.card {
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    border: 3px solid transparent;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    cursor: pointer;
    width: 100%;
}

/* Specific Card types */
.tv-card {
    aspect-ratio: 16 / 9;
    height: auto;
    background: var(--bg-panel);
}

.tv-card .card-bg {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.channel-num {
    font-size: 3rem;
    opacity: 0.8;
}

.tv-card .card-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    font-weight: 600;
}

.vod-card {
    aspect-ratio: 2 / 3;
    height: auto;
}

.vod-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.vod-card .card-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    font-weight: 600;
}

/* ==== FOCUS STATES (CRITICAL FOR SMART TV) ==== */
.focusable.focused {
    transform: scale(1.05);
    border-color: var(--focus-ring);
    box-shadow: 0 10px 30px rgba(255, 255, 255, 0.15), 0 0 0 4px rgba(255, 255, 255, 0.3);
    z-index: 50;
}

.nav-item.focusable.focused {
    transform: scale(1.02);
    background: rgba(255, 255, 255, 0.1);
}

.hero-btn.focusable.focused {
    background: var(--primary);
    color: white;
    border-color: white;
}

/* Player Overlay */
#player-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

#player-overlay.hidden {
    display: none;
}

.video-container {
    width: 100%;
    height: 100%;
    position: relative;
}

.video-container.hidden {
    display: none;
}

video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* Prevents cropping on mobile portrait mode */
}

.ad-badge {
    position: absolute;
    top: 2rem;
    left: 2rem;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: bold;
    z-index: 10;
}

.skip-ad-container {
    position: absolute;
    bottom: 3rem;
    right: 3rem;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 1rem 2rem;
    border-radius: 8px;
    color: white;
    font-weight: bold;
    z-index: 10;
    cursor: pointer;
    opacity: 0.5;
    pointer-events: none;
    transition: all 0.3s;
}

.skip-ad-container.active {
    opacity: 1;
    pointer-events: auto;
}

.skip-ad-container.focused {
    border-color: white;
    background: var(--primary);
}

.close-player {
    position: absolute;
    top: 2rem;
    left: 2rem;
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid transparent;
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
}

.close-player:hover,
.close-player.focused {
    background: rgba(255, 255, 255, 0.2);
    border-color: white;
}

/* Responsiveness for Smartphones */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -100%;
        height: 100%;
        z-index: 1000;
    }

    .hero-title {
        font-size: 2.2rem;
    }

    .hero-section {
        padding: 1.5rem;
        height: 40vh;
    }

    .content-scroll {
        padding: 0 1rem 2rem 1rem;
    }

    .top-bar {
        padding: 1rem;
    }

    .cards-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .channel-num {
        font-size: 2rem;
    }

    /* Player Adjustments */
    .close-player {
        top: 1rem;
        left: 1rem;
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    .skip-ad-container {
        bottom: 2rem;
        right: 1rem;
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }

    .ad-badge {
        top: 1rem;
        right: 1rem;
        left: auto;
        font-size: 0.9rem;
    }
}