/* ==========================================================================
   GALIPTV — Design System Accesible y Multidispositivo (Móvil, PC, Alexa, TV, Firestick)
   ========================================================================== */

:root {
    /* Paleta de Colores Sobria, Elegante y Accesible (WCAG AAA) */
    --bg-main:         #0c0e12;  /* Negro carbón cálido y profundo */
    --surface-card:    #161922;  /* Contenedor oscuro sobrio */
    --surface-hover:   #212634;  /* Estado interactivo */
    --surface-border:  #2e3446;  /* Bordes limpios sin brillo neón */

    /* Colores de Acento (Clásicos, elegantes y de alto contraste) */
    --accent-blue:     #2563eb;  /* Azul accesible */
    --accent-blue-hvr: #1d4ed8;
    --accent-red:      #dc2626;  /* Rojo cine sobrio */

    /* Tipografía y Textos de Alto Contraste */
    --text-primary:    #ffffff;  /* Blanco puro para máxima legibilidad */
    --text-secondary:  #e2e8f0;  /* Gris muy claro (nunca apagado) */
    --text-muted:      #94a3b8;  /* Texto de apoyo fácil de leer */

    /* Anchos y Alturas Estándar de Accesibilidad (Mínimo 48px touch target) */
    --target-min-h:    48px;
    --target-nav-h:    52px;
    --header-height:   76px;
    --bottom-nav-h:    72px;

    /* Bordes y Esquinas Ligeramente Redondeadas (Sin exageración) */
    --radius-sm:       8px;
    --radius-md:       12px;
    --radius-lg:       16px;
    --radius-pill:     999px;

    /* Transición Suave y Discreta */
    --transition-fast: 0.15s ease-out;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    height: 100%;
    width: 100%;
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    overflow: hidden;
    user-select: none;
    -webkit-font-smoothing: antialiased;
}

/* Indicador de Foco de Alta Visibilidad para Mandos de TV (D-Pad), Firestick y Teclado */
*:focus-visible,
body.using-dpad *:focus {
    outline: 4px solid #00f2fe !important;
    outline-offset: 3px !important;
    box-shadow: 0 0 20px rgba(0, 242, 254, 0.85) !important;
    z-index: 50;
}

.app {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    width: 100vw;
    position: relative;
    overflow: hidden;
    background: var(--bg-main);
}

.hidden {
    display: none !important;
}

/* ==========================================================================
   HEADER PRINCIPAL & LOGO GALIPTV
   ========================================================================== */
.app-header {
    height: 84px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    background: rgba(15, 18, 25, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 100;
    gap: 24px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 24px;
}

/* Logotipo Oficial GaliPTV (Más grande y prominente) */
.header-logo {
    display: flex;
    align-items: center;
    cursor: pointer;
    outline: none;
    padding: 2px;
    border-radius: var(--radius-md);
    transition: transform var(--transition-fast);
}

.header-logo:hover,
.header-logo:focus-visible {
    transform: scale(1.04);
}

.header-logo-img {
    height: 58px;
    width: auto;
    object-fit: contain;
    filter: none !important;
    transition: transform var(--transition-fast);
}

/* Navegación Principal Estilo Streaming (Píldoras Elegantes) */
.top-nav-tabs {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.04);
    padding: 6px;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.top-nav-tabs .nav-tab {
    height: 44px;
    padding: 0 20px;
    border-radius: var(--radius-pill);
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all var(--transition-fast);
    outline: none;
}

.top-nav-tabs .nav-tab:hover,
.top-nav-tabs .nav-tab:focus-visible {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
}

.top-nav-tabs .nav-tab.active {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.4);
}

.top-nav-tabs .nav-tab.active .tab-icon {
    stroke: #ffffff;
}

.header-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

/* Campo de Búsqueda Integrado de Alto Nivel */
.search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 16px;
    color: #38bdf8;
    pointer-events: none;
    transition: color var(--transition-fast);
}

.search-wrap input {
    height: 46px;
    background: rgba(255, 255, 255, 0.05);
    border: 1.5px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-pill);
    padding: 0 20px 0 48px;
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    width: 290px;
    outline: none;
    transition: all var(--transition-fast);
}

.search-wrap input:hover {
    border-color: rgba(56, 189, 248, 0.6);
    background: rgba(255, 255, 255, 0.08);
}

.search-wrap input:focus {
    border-color: #00f2fe;
    background: #131722;
    width: 360px;
    box-shadow: 0 0 20px rgba(0, 242, 254, 0.35);
}

.search-wrap input::placeholder {
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
}

/* ==========================================================================
   BARRA DE SUB-CATEGORÍAS INTEGRADA (SUB-HEADER)
   ========================================================================== */
.filter-bar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 32px;
    background: rgba(12, 14, 18, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    z-index: 90;
}

.filter-bar-title {
    display: none; /* Oculto para mantener un diseño minimalista de catálogo */
}

.scroll-btn {
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    border-radius: 50%;
    width: 34px;
    height: 34px;
    cursor: pointer;
    flex-shrink: 0;
    transition: all var(--transition-fast);
    padding: 0;
}

.scroll-btn:hover, .scroll-btn:focus {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
    border-color: #3b82f6;
}

@media (min-width: 768px) {
    .scroll-btn {
        display: flex;
    }
}

.pills-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 2px 0;
}

.pills-scroll::-webkit-scrollbar {
    display: none;
}
.pills-scroll {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.pill-item {
    height: 36px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    padding: 0 16px;
    border-radius: var(--radius-pill);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    outline: none;
    display: inline-flex;
    align-items: center;
    transition: all var(--transition-fast);
}

.pill-item:hover,
.pill-item:focus-visible {
    color: var(--text-primary);
    border-color: rgba(56, 189, 248, 0.5);
    background: rgba(255, 255, 255, 0.08);
}

.pill-item.active {
    background: #3b82f6;
    color: #ffffff;
    border-color: #3b82f6;
    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.4);
}

/* ==========================================================================
   ÁREA DE CONTENIDO PRINCIPAL
   ========================================================================== */
.app-main {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 28px 28px 40px;
    scroll-behavior: smooth;
}

.app-main::-webkit-scrollbar {
    width: 10px;
}
.app-main::-webkit-scrollbar-track {
    background: var(--bg-main);
}
.app-main::-webkit-scrollbar-thumb {
    background: var(--surface-border);
    border-radius: var(--radius-pill);
}

/* ==========================================================================
   LOADER
   ========================================================================== */
.loader-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 50vh;
    gap: 16px;
    text-align: center;
}

.loader-ring {
    width: 56px;
    height: 56px;
    border: 5px solid var(--surface-border);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loader-text {
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 700;
}

.loader-subtext {
    color: var(--text-muted);
    font-size: 15px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==========================================================================
   DESTACADO (HERO SPOTLIGHT BANNER)
   ========================================================================== */
.hero-banner {
    position: relative;
    width: 100%;
    min-height: 320px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 36px;
    background: var(--surface-card);
    border: 2px solid var(--surface-border);
    display: flex;
    align-items: flex-end;
}

.hero-backdrop {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center top;
    filter: brightness(0.6);
    transition: background-image 0.4s ease;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(12, 14, 18, 0.95) 0%, rgba(12, 14, 18, 0.5) 60%, transparent 100%),
                linear-gradient(90deg, rgba(12, 14, 18, 0.95) 0%, transparent 70%);
}

.hero-content {
    position: relative;
    z-index: 2;
    padding: 36px 40px;
    max-width: 700px;
}

.hero-badge {
    display: inline-block;
    background: var(--accent-red);
    color: #ffffff;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 1px;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    text-transform: uppercase;
}

.hero-title {
    font-size: 36px;
    font-weight: 900;
    line-height: 1.2;
    margin-bottom: 12px;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-subtitle {
    font-size: 17px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 24px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-actions {
    display: flex;
    gap: 16px;
}

.btn-primary {
    height: 54px;
    background: var(--accent-blue);
    color: #ffffff;
    border: none;
    padding: 0 32px;
    border-radius: var(--radius-pill);
    font-size: 18px;
    font-weight: 800;
    font-family: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    outline: none;
    transition: all var(--transition-fast);
}

.btn-primary:hover,
.btn-primary:focus-visible {
    background: var(--accent-blue-hvr);
    transform: scale(1.02);
}

.btn-secondary {
    height: 54px;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #ffffff;
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    padding: 0 26px;
    border-radius: var(--radius-pill);
    font-size: 16px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    outline: none;
    transition: all var(--transition-fast);
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.02);
}

/* ── Hero Logo Box (Fix for oversized channel logos) ── */
.hero-brand-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.hero-logo-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1.5px solid rgba(255, 255, 255, 0.22);
    border-radius: var(--radius-md);
    padding: 8px 16px;
    max-height: 80px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.hero-logo-img {
    max-height: 60px;
    max-width: 180px;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5));
}

/* ── Live EPG Schedule Box in Hero Carousel ── */
.hero-epg-box {
    background: rgba(18, 22, 30, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1.5px solid rgba(255, 255, 255, 0.14);
    border-radius: var(--radius-md);
    padding: 16px 22px;
    margin-top: 14px;
    margin-bottom: 22px;
    max-width: 580px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

/* ── Hero Desktop Grid Layout (Side-by-Side EPG) ── */
@media (min-width: 900px) {
    .hero-banner {
        min-height: 360px;
        height: auto;
    }

    .hero-content {
        padding: 36px 44px;
        max-width: 100%;
        display: grid;
        grid-template-columns: 1fr 420px;
        grid-template-areas:
            "brand brand"
            "title epg"
            "subtitle epg"
            "actions epg";
        align-items: end;
        gap: 0 32px;
    }

    .hero-brand-wrap { grid-area: brand; }
    .hero-title { grid-area: title; margin-bottom: 8px; font-size: 34px; }
    .hero-subtitle { grid-area: subtitle; margin-bottom: 20px; font-size: 16px; }
    .hero-actions { grid-area: actions; }
    .hero-epg-box { grid-area: epg; margin: 0; }
}

@media (max-width: 899px) {
    .hero-epg-box {
        max-width: 100%;
        margin-top: 12px;
        margin-bottom: 16px;
    }
}

.hero-epg-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.live-dot-pulse {
    width: 10px;
    height: 10px;
    background-color: #ff3b30;
    border-radius: 50%;
    box-shadow: 0 0 10px #ff3b30;
    animation: pulseRed 1.5s infinite;
}

@keyframes pulseRed {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.7); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 8px rgba(255, 59, 48, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 59, 48, 0); }
}

.epg-live-label {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1px;
    color: #ff3b30;
    text-transform: uppercase;
}

.epg-current-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
    line-height: 1.3;
}

.epg-progress-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.epg-time {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}

.epg-bar-wrap {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    overflow: hidden;
}

.epg-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6 0%, #60a5fa 100%);
    border-radius: 4px;
    transition: width 0.4s ease;
}

.epg-next-info {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── EPG Schedule Modal Styles ── */
.epg-box {
    max-width: 650px;
    width: 90%;
}

.epg-modal-body {
    padding: 20px 24px;
    max-height: 65vh;
    overflow-y: auto;
}

.epg-schedule-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.epg-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.epg-item.is-current {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.15);
}

.epg-item-time {
    font-size: 15px;
    font-weight: 700;
    color: var(--accent-blue);
    min-width: 100px;
}

.epg-item-content {
    flex: 1;
}

.epg-item-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.epg-item-genre {
    font-size: 13px;
    color: var(--text-muted);
}

.epg-item-tag {
    font-size: 11px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    background: var(--accent-blue);
    color: #fff;
    text-transform: uppercase;
}

.hero-dots {
    position: absolute;
    bottom: 24px;
    right: 36px;
    display: flex;
    gap: 10px;
    z-index: 10;
}

.hero-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    border: 2px solid transparent;
    cursor: pointer;
    outline: none;
    transition: all var(--transition-fast);
}

.hero-dot.active,
.hero-dot:hover {
    background: var(--accent-blue);
    width: 32px;
    border-radius: var(--radius-pill);
}

/* ==========================================================================
   FILAS DE CONTENIDO Y GRID
   ========================================================================== */
.rows-container {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.category-row {
    margin-bottom: 12px;
}

.row-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.row-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.see-more-btn {
    height: var(--target-min-h);
    background: var(--surface-card);
    border: 2px solid var(--surface-border);
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    padding: 0 20px;
    border-radius: var(--radius-pill);
    transition: all var(--transition-fast);
}

.see-more-btn:hover,
.see-more-btn:focus-visible {
    color: var(--text-primary);
    border-color: #3b82f6;
    background: var(--surface-hover);
}

.row-cards {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding: 6px 4px 16px;
}

.row-cards::-webkit-scrollbar { display: none; }
.row-cards { -ms-overflow-style: none; scrollbar-width: none; }

.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 24px;
    padding-top: 10px;
}

.no-results {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-secondary);
    text-align: center;
    padding: 60px 20px;
}

/* ==========================================================================
   SISTEMA DE TARJETAS (CARDS)
   ========================================================================== */
.card {
    background: var(--surface-card);
    border: 2px solid var(--surface-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    outline: none;
    position: relative;
    transition: transform var(--transition-fast), border-color var(--transition-fast);
    flex-shrink: 0;
    width: 200px;
}

.items-grid .card {
    width: 100%;
}

.card:hover,
.card:focus-visible {
    transform: translateY(-4px) scale(1.02);
    border-color: var(--accent-blue);
    z-index: 10;
}

.card-poster {
    width: 100%;
    position: relative;
    background: #1c212d;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-poster.poster-portrait {
    aspect-ratio: 2/3;
}

.card-poster.poster-landscape {
    aspect-ratio: 16/9;
}

.card-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-poster.poster-landscape img {
    object-fit: contain;
    padding: 12px;
}

.poster-fallback {
    font-size: 36px;
    font-weight: 900;
    color: var(--text-muted);
    text-transform: uppercase;
}

.card-tag {
    position: absolute;
    top: 6px;
    left: 6px;
    background: rgba(12, 14, 18, 0.75);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    z-index: 5;
    pointer-events: none;
}

/* En tarjetas de canales (formato apaisado), etiqueta súper pequeña e indiscreta para no tapar el logotipo del canal */
.poster-landscape .card-tag {
    top: 4px;
    left: 4px;
    font-size: 9px;
    padding: 1px 5px;
    background: rgba(0, 0, 0, 0.65);
    border: none;
    color: #94a3b8;
    opacity: 0.8;
}

.card-rating {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(12, 14, 18, 0.92);
    color: #FACC15;
    font-size: 13px;
    font-weight: 900;
    padding: 4px 9px;
    border-radius: 6px;
    border: 1px solid rgba(250, 204, 21, 0.45);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    gap: 4px;
    letter-spacing: 0.3px;
    backdrop-filter: blur(4px);
    z-index: 2;
}

.card-info {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: var(--surface-card);
}

.card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-group {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==========================================================================
   NAVEGACIÓN INFERIOR (MÓVIL / SMART TV REMOTE)
   ========================================================================== */
.bottom-nav {
    display: none; /* Oculto en pantallas grandes, visible en móviles */
    height: var(--bottom-nav-h);
    flex-shrink: 0;
    background: #11141c;
    border-top: 2px solid var(--surface-border);
    align-items: stretch;
    justify-content: space-around;
    padding: 0 12px;
    z-index: 100;
}

.bottom-nav .nav-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    color: var(--text-muted);
    outline: none;
    position: relative;
}

.tab-indicator {
    width: 32px;
    height: 4px;
    background: var(--accent-blue);
    border-radius: var(--radius-pill);
    position: absolute;
    top: 0;
    transform: scaleX(0);
    transition: transform var(--transition-fast);
}

.bottom-nav .nav-tab.active {
    color: var(--text-primary);
}

.bottom-nav .nav-tab.active .tab-indicator {
    transform: scaleX(1);
}

.tab-icon {
    width: 24px;
    height: 24px;
    stroke: var(--text-muted);
}

.bottom-nav .nav-tab.active .tab-icon {
    stroke: #3b82f6;
}

.tab-label {
    font-size: 14px;
    font-weight: 700;
}

/* ==========================================================================
   MODALES (REPRODUCTOR Y SERIES)
   ========================================================================== */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(8, 10, 14, 0.95);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 1;
    transition: opacity var(--transition-fast);
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-box {
    background: var(--surface-card);
    border: 2px solid var(--surface-border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 1100px;
    max-height: 90dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 28px;
    background: #11141c;
    border-bottom: 2px solid var(--surface-border);
    gap: 16px;
}

.modal-title-wrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: hidden;
}

.modal-badge {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1px;
    color: #3b82f6;
}

.modal-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}



/* Botón de Cerrar Grande */
.btn-close {
    height: var(--target-min-h);
    padding: 0 24px;
    border-radius: var(--radius-pill);
    background: var(--accent-red);
    border: none;
    color: #ffffff;
    font-size: 16px;
    font-weight: 800;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
    white-space: nowrap;
    transition: all var(--transition-fast);
}

.btn-close:hover,
.btn-close:focus-visible {
    background: #b91c1c;
    transform: scale(1.02);
}



/* MODAL DE SERIES */
.series-body {
    display: flex;
    gap: 28px;
    padding: 28px;
    overflow-y: auto;
}

.series-cover-col {
    width: 220px;
    flex-shrink: 0;
}

.series-cover-col img {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    border-radius: var(--radius-md);
    border: 2px solid var(--surface-border);
}

.series-info-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.season-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

.season-label {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.season-select {
    height: var(--target-min-h);
    background: var(--bg-main);
    border: 2px solid var(--surface-border);
    color: var(--text-primary);
    padding: 0 20px;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    outline: none;
}

.episodes-heading {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-secondary);
}

.episodes-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
}

.episode-item {
    min-height: 56px;
    padding: 12px 20px;
    background: var(--bg-main);
    border: 2px solid var(--surface-border);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    cursor: pointer;
    outline: none;
    transition: all var(--transition-fast);
}

.episode-item:hover,
.episode-item:focus-visible {
    border-color: var(--accent-blue);
    background: var(--surface-hover);
}

/* ==========================================================================
   NUEVO REPRODUCTOR CUSTOM (FULLSCREEN & GLASSMORPHISM)
   ========================================================================== */
.player-fullscreen-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #000;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.player-fullscreen-overlay.hidden {
    display: none;
}

.custom-player-container {
    position: relative;
    width: 100%;
    height: 100%;
    background: #000;
    overflow: hidden;
}

.custom-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

/* Interfaz superpuesta (UI Layer) */
.player-ui-layer {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px 30px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 20%, rgba(0,0,0,0) 70%, rgba(0,0,0,0.9) 100%);
    opacity: 1;
    transition: opacity 0.4s ease;
    z-index: 10;
}

.player-ui-layer.idle {
    opacity: 0;
    cursor: none;
}

/* Header del reproductor */
.player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.player-header-title {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-back {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    width: 48px;
    height: 48px;
}

.player-title {
    font-size: 24px;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

/* Centro (Loader) */
.player-center-play {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.player-loader {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(255,255,255,0.2);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.player-loader.hidden {
    display: none;
}

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

/* Controles inferiores */
.player-controls-bottom {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
}

/* Barra de progreso */
.player-progress-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
}

.player-progress-wrapper.hidden {
    visibility: hidden;
}

.player-time {
    font-size: 14px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: #ddd;
    width: 50px;
    text-align: center;
}

.player-progress-bg {
    flex: 1;
    height: 6px;
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
    position: relative;
    cursor: pointer;
    transition: height 0.2s;
}

.player-progress-bg:hover {
    height: 8px;
}

.player-progress-buffer {
    position: absolute;
    top: 0; left: 0; bottom: 0;
    background: rgba(255,255,255,0.4);
    border-radius: 3px;
    width: 0%;
}

.player-progress-fill {
    position: absolute;
    top: 0; left: 0; bottom: 0;
    background: var(--accent-blue);
    border-radius: 3px;
    width: 0%;
    box-shadow: 0 0 10px var(--accent-blue);
}

.player-progress-thumb {
    position: absolute;
    top: 50%;
    left: 0%;
    transform: translate(-50%, -50%) scale(0);
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    transition: transform 0.1s;
}

.player-progress-bg:hover .player-progress-thumb {
    transform: translate(-50%, -50%) scale(1);
}

/* Fila de controles */
.player-controls-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.player-controls-left, .player-controls-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.player-btn {
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    transition: all 0.2s;
}

.player-btn:hover {
    background: rgba(255,255,255,0.15);
    transform: scale(1.05);
}

.player-btn.hidden {
    display: none;
}

/* Slider volumen */
.player-vol-slider {
    width: 80px;
    cursor: pointer;
    accent-color: var(--accent-blue);
}

/* Menús flotantes */
.player-menu-wrapper {
    position: relative;
}

.player-menu {
    position: absolute;
    bottom: 55px;
    right: 0;
    background: rgba(20, 20, 25, 0.85);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 10px;
    min-width: 180px;
    max-height: 250px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 5px;
    transform-origin: bottom center;
    animation: menuIn 0.2s ease;
}

@keyframes menuIn {
    from { opacity: 0; transform: translateY(10px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.player-menu.hidden {
    display: none;
}

.player-menu-item {
    background: transparent;
    border: none;
    color: #ccc;
    text-align: left;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    transition: all 0.2s;
}

.player-menu-item:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.player-menu-item.active {
    background: var(--accent-blue);
    color: #fff;
}


.episode-num {
    font-size: 16px;
    font-weight: 800;
    color: #3b82f6;
}

.episode-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    flex: 1;
}

.episode-play {
    font-size: 15px;
    font-weight: 800;
    color: var(--accent-blue);
    background: rgba(37, 99, 235, 0.15);
    padding: 6px 14px;
    border-radius: var(--radius-pill);
}

/* ==========================================================================
   MODAL DE DETALLES (SINOPSIS Y METADATOS OMDB)
   ========================================================================== */
.detail-box {
    max-width: 860px;
    width: 90%;
}

.detail-body {
    display: flex;
    gap: 28px;
    padding: 28px;
    overflow-y: auto;
    max-height: 75vh;
}

.detail-cover-col {
    width: 220px;
    flex-shrink: 0;
}

.detail-cover-col img {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    border-radius: var(--radius-md);
    border: 2px solid var(--surface-border);
    box-shadow: var(--shadow-lg);
    background: var(--surface-card);
}

.detail-info-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.detail-meta-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.detail-rating-badge {
    background: #FEF08A;
    color: #854D0E;
    font-size: 16px;
    font-weight: 900;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.detail-meta-tag {
    background: var(--surface-hover);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--surface-border);
}

.detail-credits {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 15px;
    color: var(--text-secondary);
}

.detail-credit-item strong {
    color: var(--text-primary);
}

.detail-plot-wrap {
    background: rgba(255, 255, 255, 0.03);
    padding: 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--surface-border);
}

.detail-plot-heading {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-plot-text {
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin: 0;
}

.detail-actions {
    margin-top: 8px;
}

.detail-play-btn {
    width: 100%;
    min-height: 56px;
    font-size: 18px;
    font-weight: 900;
    letter-spacing: 0.5px;
}

/* ==========================================================================
   RESPONSIVE & MULTI-DEVICE DESIGN (PC, ALEXA SHOW, TV/FIRESTICK, MOBILE)
   ========================================================================== */

/* --- 1. PC & ESCRITORIO DE PANTALLA ANCHA (>= 1025px) --- */
@media (min-width: 1025px) {
    html, body {
        padding: 0 !important;
        margin: 0 !important;
        width: 100vw;
        height: 100dvh;
        overflow: hidden;
    }

    .app {
        width: 100%;
        height: 100%;
        border-radius: 0;
        box-shadow: none;
        border: none;
    }

    .items-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 24px;
    }
    
    .card {
        width: 200px;
    }

    .hero-banner {
        height: 380px;
    }

    .hero-title {
        font-size: 38px;
    }
}

/* --- 2. ALEXA CON PANTALLA & PANTALLAS TÁCTILES MEDIANAS (Echo Show 8, 10, 15: 768px - 1024px) --- */
@media (min-width: 768px) and (max-width: 1024px) {
    .app-header {
        padding: 0 20px;
    }

    .nav-tab {
        min-height: 52px;
        padding: 0 20px;
        font-size: 16px;
    }

    .items-grid {
        grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
        gap: 18px;
    }

    .card {
        width: 170px;
    }

    .card-title {
        font-size: 15px;
    }

    .hero-banner {
        height: 320px;
    }

    .hero-title {
        font-size: 30px;
    }

    .btn-primary {
        min-height: 54px;
        font-size: 17px;
    }
}

/* --- 3. DISPOSITIVOS MÓVILES (TELÉFONOS < 768px) --- */
@media (max-width: 767px) {
    .app-header {
        height: 60px;
        padding: 0 10px;
        gap: 6px;
    }

    .header-left {
        gap: 6px;
        flex-shrink: 0;
    }

    .header-logo-img {
        height: 44px;
    }

    .header-right {
        flex: 1;
        display: flex;
        justify-content: flex-end;
    }

    .search-wrap {
        width: 100%;
        max-width: 210px;
    }

    .search-wrap input {
        width: 100%;
        font-size: 12px;
        height: 38px;
        padding-left: 36px;
        padding-right: 10px;
        background: rgba(30, 41, 59, 0.9);
        border: 2px solid #38bdf8;
        box-shadow: 0 0 12px rgba(56, 189, 248, 0.3);
    }

    .search-icon {
        left: 10px;
        width: 16px;
        height: 16px;
        color: #38bdf8;
    }

    .search-wrap input:focus {
        width: 100%;
        border-color: #00f2fe;
        box-shadow: 0 0 18px rgba(0, 242, 254, 0.5);
    }

    /* Categorías más pequeñas y compactas en el formato más pequeño */
    .filter-bar {
        padding: 6px 10px;
        gap: 6px;
        background: #0b0e14;
        border-bottom: 1px solid var(--surface-border);
    }

    .filter-bar-title {
        display: none; /* Ocultar título "Categorías:" en móvil para maximizar espacio */
    }

    .pills-scroll {
        gap: 6px;
        padding: 1px 0;
    }

    .pill-item {
        height: 30px;
        padding: 0 10px;
        font-size: 12px;
        font-weight: 700;
        border-width: 1px;
        border-radius: var(--radius-pill);
    }

    .top-nav-tabs {
        display: none; /* Se usa la barra inferior */
    }

    .bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: var(--bottom-nav-h);
        background: #11141c;
        border-top: 1px solid var(--surface-border);
        z-index: 1000;
        justify-content: space-around;
        align-items: center;
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    .app-main {
        padding: 12px 12px calc(var(--bottom-nav-h) + 20px + env(safe-area-inset-bottom, 0px));
    }

    /* Filas de contenido y scroll horizontal en móvil */
    .rows-container {
        gap: 20px;
    }

    .row-header {
        margin-bottom: 8px;
    }

    .row-title {
        font-size: 17px;
    }

    .see-more-btn {
        height: 32px;
        font-size: 12px;
        padding: 0 12px;
    }

    .row-cards {
        gap: 12px;
        padding: 4px 0 12px;
    }

    /* Tarjetas compactas en horizontal (entran 3+ canales por pantalla en lugar de solo 2) */
    .row-cards .card {
        width: 125px;
        max-width: 125px;
        flex-shrink: 0;
    }

    .row-cards .card .card-title {
        font-size: 13px;
        line-height: 1.3;
    }

    .row-cards .card .card-group {
        font-size: 11px;
    }

    .row-cards .card-poster.poster-landscape img {
        padding: 8px;
    }

    .items-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 12px;
        padding: 6px 0;
    }

    .items-grid .card {
        width: 100%;
        max-width: none;
    }

    .hero-banner {
        height: auto;
        min-height: 280px;
        margin-bottom: 20px;
    }

    .hero-content {
        padding: 16px;
    }

    .hero-brand-wrap {
        gap: 8px;
        margin-bottom: 10px;
    }

    .hero-badge {
        font-size: 11px;
        padding: 4px 10px;
        margin-bottom: 0;
    }

    .hero-logo-box {
        padding: 4px 10px;
        max-height: 48px;
    }

    .hero-logo-img {
        max-height: 34px;
        max-width: 120px;
    }

    .hero-title {
        font-size: 20px;
        margin-bottom: 6px;
    }

    .hero-subtitle {
        font-size: 12px;
        line-height: 1.4;
        margin-bottom: 10px;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        line-clamp: 2;
        -webkit-line-clamp: 2;
        overflow: hidden;
    }

    .hero-epg-box {
        padding: 12px 14px;
        margin-top: 8px;
        margin-bottom: 14px;
    }

    .epg-current-title {
        font-size: 14px;
        margin-bottom: 6px;
    }

    .epg-progress-row {
        gap: 8px;
        margin-bottom: 6px;
    }

    .epg-time, .epg-next-info {
        font-size: 11px;
    }

    .hero-actions {
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }

    .btn-primary, .btn-secondary {
        height: 44px;
        font-size: 14px;
        padding: 0 16px;
        width: 100%;
        justify-content: center;
    }

    .hero-dots {
        top: 14px;
        right: 14px;
        bottom: auto;
    }

    .series-body, .detail-body {
        flex-direction: column;
        align-items: center;
        padding: 16px;
        gap: 14px;
    }

    .series-cover-col, .detail-cover-col {
        width: 120px;
    }

    .detail-cover-col img {
        max-height: 180px;
    }
}

/* --- 4. MODO TELEVISIÓN NATIVO (DISPOSITIVOS TV / FIRESTICK CON MANDO D-PAD) --- */
@media tv {
    :root {
        --header-height: 90px;
    }

    body {
        padding: 2.5vh 3vw;
        background-color: #06070a;
    }

    .app {
        border-radius: var(--radius-lg);
        box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
        border: 1px solid var(--surface-border);
    }
}

/* Clase .tv-mode activada solo en TV o por uso del D-Pad */
body.tv-mode {
    padding: 2vh 2.5vw;
}

body.tv-mode .card:focus,
body.tv-mode button:focus,
body.tv-mode input:focus {
    outline: 4px solid #00f2fe !important;
    outline-offset: 4px !important;
    box-shadow: 0 0 30px rgba(0, 242, 254, 0.9) !important;
}

/* ==========================================================================
   NUEVOS ESTILOS: AUTENTICACIÓN, FAVORITOS Y PROGRESO DE VISUALIZACIÓN
   ========================================================================== */

/* Active Viewers Badge & Live Pulse Indicator */
.active-viewers-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    font-size: 13px;
    font-weight: 700;
    margin-left: 12px;
    white-space: nowrap;
    user-select: none;
    transition: all 0.3s ease;
}

.pulse-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
}

/* Green Theme (0 viewers) */
.active-viewers-badge.theme-green {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #10b981;
}
.active-viewers-badge.theme-green .pulse-dot {
    background-color: #10b981;
    animation: greenPulse 1.8s infinite;
}

/* Yellow Theme (1 viewer) */
.active-viewers-badge.theme-yellow {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.45);
    color: #f59e0b;
}
.active-viewers-badge.theme-yellow .pulse-dot {
    background-color: #f59e0b;
    animation: yellowPulse 1.8s infinite;
}

/* Red Theme (2 or more viewers) */
.active-viewers-badge.theme-red {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.45);
    color: #ef4444;
}
.active-viewers-badge.theme-red .pulse-dot {
    background-color: #ef4444;
    animation: redPulse 1.8s infinite;
}

@keyframes greenPulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

@keyframes yellowPulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(245, 158, 11, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

@keyframes redPulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* User Profile Header & Admin / Logout Buttons */
.user-profile-header {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--surface-border);
    padding: 6px 14px;
    border-radius: var(--radius-pill);
}

.user-avatar-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e50914, #9b060e);
    color: #ffffff;
    font-size: 16px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.25);
    user-select: none;
    cursor: default;
}

.btn-header-admin {
    padding: 4px 10px;
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.4);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.btn-header-admin:hover {
    background: #3b82f6;
    color: #fff;
}

.btn-header-logout {
    padding: 4px 10px;
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-header-logout:hover {
    background: #ef4444;
    color: #fff;
}

/* Fullscreen Login Container & Centering */
#user-login-modal {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background: #080a0e;
    background: radial-gradient(circle at center, #171b26 0%, #080a0e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 9999;
}

#user-login-modal.hidden {
    display: none !important;
}

.main-login-card {
    background: var(--surface-card);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    padding: 40px 32px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(229, 9, 20, 0.12);
    text-align: center;
    margin: auto;
}

.login-logo-img {
    height: 60px;
    margin-bottom: 16px;
}

.main-login-card h2 {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.main-login-card p {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 24px;
}

.main-login-card .input-group {
    text-align: left;
    margin-bottom: 16px;
}

.main-login-card .input-group label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.main-login-card .input-group input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--surface-border);
    border-radius: 8px;
    color: #fff;
    font-size: 15px;
    outline: none;
    transition: border-color var(--transition-fast);
}

.main-login-card .input-group input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.3);
}

.btn-primary-login {
    width: 100%;
    padding: 14px;
    background: var(--accent-red);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    margin-top: 10px;
    transition: background var(--transition-fast);
}

.btn-primary-login:hover {
    background: #f6121d;
}

/* Favorite Heart Button on Cards */
.btn-card-fav {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all var(--transition-fast);
}

.btn-card-fav:hover, .btn-card-fav.active {
    background: rgba(229, 9, 20, 0.9);
    border-color: #e50914;
    color: #fff;
    transform: scale(1.1);
}

/* Watch Progress Indicators on Cards */
.card-progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    z-index: 8;
}

.card-progress-fill {
    height: 100%;
    background: var(--accent-red);
    border-radius: 0 2px 2px 0;
}

.badge-progress {
    position: absolute;
    bottom: 10px;
    left: 8px;
    background: rgba(229, 9, 20, 0.9);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    z-index: 9;
}

.badge-watched {
    position: absolute;
    bottom: 10px;
    left: 8px;
    background: rgba(16, 185, 129, 0.9);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    z-index: 9;
}

