@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
    /* Color Palette */
    --bg-base: #060608;
    --bg-surface: #0c0c10;
    --bg-surface-hover: #14141a;
    --bg-card: rgba(18, 18, 24, 0.45);
    --border-color: rgba(255, 255, 255, 0.05);
    --border-color-hover: rgba(255, 255, 255, 0.1);
    
    --accent-primary: #00ff88;      /* Neon Green */
    --accent-secondary: #00d2ff;    /* Electric Cyan */
    --accent-tertiary: #ff2d55;     /* Hot Pink */
    
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --text-muted: #475569;
    
    /* Typography */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
    
    /* Glassmorphism */
    --glass-bg: rgba(12, 12, 16, 0.8);
    --glass-border: rgba(255, 255, 255, 0.06);
    --glass-blur: blur(25px);
    
    /* Layout Constants */
    --header-height: 64px;
    --bottom-nav-height: 64px;
    --sidebar-width: 230px;
    
    /* Transitions */
    --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-quick: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-body);
    overflow: hidden; /* Controlamos el scroll en los contenedores */
    min-height: 100vh;
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--bg-surface-hover);
    border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

/* ==========================================
   ELEMENTOS DE INTERFAZ COMUNES
   ========================================== */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: -0.01em;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 10px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition-quick);
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), #00e575);
    color: #000;
}
.btn-primary:hover {
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.3);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--border-color-hover);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}
.btn-ghost:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.badge-live {
    background: var(--accent-tertiary);
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    text-transform: uppercase;
    animation: pulse 1.8s infinite;
}

.badge-stream {
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.65; }
}

/* ==========================================
   ESTRUCTURA DE APLICACIÓN (MOBILE-FIRST POR DEFECTO)
   ========================================== */

#app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
    position: relative;
}

/* Ocultar elementos de escritorio por defecto */
.main-header,
.main-sidebar {
    display: none;
}

/* Barra superior móvil */
.mobile-header-bar {
    height: 56px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 10;
    flex-shrink: 0;
}

.mobile-header-bar .logo {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.25rem;
    color: #fff;
    text-decoration: none;
}
.mobile-header-bar .logo span {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.mobile-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-secondary), var(--accent-tertiary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: #fff;
}

/* Barra de navegación inferior móvil (Bottom Tab Bar) */
.mobile-bottom-nav {
    height: var(--bottom-nav-height);
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border-top: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-around;
    align-items: center;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 99;
    transition: var(--transition-smooth);
}

.mobile-nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.7rem;
    font-weight: 600;
    gap: 4px;
    width: 25%;
    height: 100%;
    transition: var(--transition-quick);
}

.mobile-nav-link svg {
    opacity: 0.7;
    transition: var(--transition-quick);
    stroke: var(--text-secondary);
}

.mobile-nav-link.active {
    color: var(--accent-primary);
}

.mobile-nav-link.active svg {
    opacity: 1;
    transform: translateY(-2px);
    stroke: var(--accent-primary);
}

/* Área de Contenido Principal */
.main-content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 16px;
    padding-bottom: calc(var(--bottom-nav-height) + 16px);
    display: flex;
    flex-direction: column;
    gap: 24px;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

/* ==========================================
   DISEÑO DE COMPONENTES DEL HOME (MOBILE)
   ========================================== */

/* Hero Player */
.hero-player-block {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
    aspect-ratio: 16/9;
    border: 1px solid var(--border-color);
}
.player-mockup, .player-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.player-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(6,6,8,0.9) 15%, rgba(6,6,8,0.3) 60%, transparent);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 16px;
}
.player-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.player-title {
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.2;
}
.player-desc {
    display: none; /* Oculto en móvil por espacio */
}

/* Carruseles Deslizables en Móvil */
.carousel-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.section-header h2 {
    font-size: 1.15rem;
}
.view-all-link {
    font-size: 0.8rem;
    color: var(--accent-primary);
    cursor: pointer;
}

.carousel-grid {
    display: flex;
    overflow-x: auto;
    gap: 14px;
    padding-bottom: 8px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none; /* ocultar scroll en firefox */
}
.carousel-grid::-webkit-scrollbar {
    display: none; /* ocultar scroll en chrome/safari */
}

.match-card {
    flex: 0 0 240px; /* Ancho fijo para deslizar en móvil */
    scroll-snap-align: start;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition-quick);
}
.match-card:hover {
    border-color: var(--border-color-hover);
    transform: translateY(-2px);
}
.card-thumbnail {
    position: relative;
    aspect-ratio: 16/10;
    background: linear-gradient(135deg, #111d42, #162050);
    display: flex;
    align-items: center;
    justify-content: center;
}
.card-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.card-badges {
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    display: flex;
    justify-content: space-between;
    z-index: 2;
}
.card-info {
    padding: 12px;
}
.card-league {
    font-size: 0.7rem;
    color: var(--accent-secondary);
    font-weight: 700;
    text-transform: uppercase;
}
.card-teams {
    font-size: 0.85rem;
    font-weight: 700;
    margin-top: 4px;
}

/* Mosaico de Canales (Multiview) */
.channels-grid {
    display: grid;
    grid-template-columns: 1fr; /* Una columna en móvil */
    gap: 12px;
}
.channel-card {
    position: relative;
    aspect-ratio: 16/9;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
}
.channel-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.7;
}
.channel-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}
.channel-info h4 {
    font-size: 0.9rem;
}

/* Noticias y Highlights */
.news-grid-block {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.news-card-featured {
    position: relative;
    aspect-ratio: 16/9;
    border-radius: 12px;
    overflow: hidden;
}
.news-card-featured img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.6;
}
.news-content {
    position: absolute;
    inset: 0;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    background: linear-gradient(to top, rgba(0,0,0,0.85), transparent);
}
.news-content h3 {
    font-size: 1.05rem;
    margin-top: 6px;
}
.news-card-small {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 12px;
    border-radius: 8px;
}
.news-card-small h4 {
    font-size: 0.75rem;
    color: var(--accent-secondary);
}
.news-card-small p {
    font-size: 0.8rem;
    margin-top: 4px;
    font-weight: 600;
}

/* Menú de Ligas */
.leagues-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.league-item {
    display: flex;
    justify-content: space-between;
    padding: 14px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    text-decoration: none;
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
}
.league-item span {
    color: var(--accent-primary);
    font-size: 0.75rem;
}



/* ==========================================
   CONFIGURACIONES ESPECÍFICAS DE LAYOUTS (MÓVIL)
   ========================================== */




/* ==========================================
   RESPONSIVE: ESTILOS DE ESCRITORIO (DESKTOP)
   ========================================== */

@media (min-width: 768px) {
    /* Mostrar Header y Sidebar de escritorio, esconder móviles */
    .main-header {
        display: flex;
        grid-area: header;
        background: var(--glass-bg);
        backdrop-filter: var(--glass-blur);
        border-bottom: 1px solid var(--glass-border);
        align-items: center;
        justify-content: space-between;
        padding: 0 24px;
        z-index: 100;
    }
    
    .main-sidebar {
        display: flex;
        grid-area: sidebar;
        background: var(--bg-surface);
        border-right: 1px solid var(--border-color);
        padding: 24px 16px;
        flex-direction: column;
        gap: 32px;
    }

    /* Estilos del Header Escritorio */
    .logo {
        display: flex;
        align-items: center;
        gap: 10px;
        font-size: 1.35rem;
        font-weight: 800;
        color: var(--text-primary);
        text-decoration: none;
        font-family: var(--font-heading);
    }
    .logo span {
        background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
    }
    .search-bar {
        display: flex;
        align-items: center;
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid var(--border-color);
        padding: 8px 16px;
        border-radius: 99px;
        width: 320px;
        gap: 10px;
        transition: var(--transition-quick);
    }
    .search-bar:focus-within {
        border-color: var(--accent-primary);
        background: rgba(255, 255, 255, 0.06);
    }
    .search-bar input {
        background: transparent;
        border: none;
        color: var(--text-primary);
        outline: none;
        width: 100%;
        font-size: 0.85rem;
    }
    .user-profile {
        display: flex;
        align-items: center;
        gap: 12px;
    }
    .user-avatar {
        width: 36px;
        height: 36px;
        border-radius: 50%;
        background: linear-gradient(135deg, var(--accent-secondary), var(--accent-tertiary));
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 700;
        color: #ffffff;
        font-size: 0.85rem;
        border: 1.5px solid var(--border-color);
    }

    /* Estilos del Menú Lateral Escritorio */
    .nav-section {
        display: flex;
        flex-direction: column;
        gap: 6px;
    }
    .nav-section-title {
        font-size: 0.7rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.08em;
        color: var(--text-muted);
        padding-left: 10px;
        margin-bottom: 6px;
    }
    .nav-link {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 10px 12px;
        border-radius: 8px;
        color: var(--text-secondary);
        text-decoration: none;
        font-weight: 600;
        font-size: 0.9rem;
        transition: var(--transition-quick);
        border-left: 3px solid transparent;
    }
    .nav-link svg {
        stroke: var(--text-secondary);
    }
    .nav-link:hover, .nav-link.active {
        color: var(--text-primary);
        background: var(--bg-surface-hover);
    }
    .nav-link.active {
        border-left-color: var(--accent-primary);
        color: var(--accent-primary);
    }
    .nav-link.active svg {
        stroke: var(--accent-primary);
    }

    .mobile-header-bar,
    .mobile-bottom-nav,
    .mobile-search-wrap {
        display: none !important;
    }
    
    body {
        overflow: hidden;
    }

    #app-container {
        display: grid;
        grid-template-rows: var(--header-height) 1fr;
        grid-template-columns: var(--sidebar-width) 1fr;
        grid-template-areas: 
            "header header"
            "sidebar main";
        height: 100vh;
    }

    .main-content {
        grid-area: main;
        padding: 32px;
        max-height: calc(100vh - var(--header-height));
        overflow-y: auto;
        display: flex;
        flex-direction: column;
        gap: 32px;
    }

    /* --- HOME LAYOUT: Cinematic Carousel (Desktop) --- */
    .hero-player-block { display: block; aspect-ratio: 21/9; }
    .carousel-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        overflow-x: visible;
        gap: 20px;
    }
    .carousel-grid .match-card {
        flex: auto;
    }
}
