:root {
    --bg-primary: #0d0d0f;
    --bg-secondary: #131317;
    --bg-card: #1a1a20;
    --bg-card-hover: #22222a;
    --nav-bg: rgba(13, 13, 15, 0.92);
    --sidebar-bg: #111114;
    --player-bg: #0a0a0c;

    --accent-blue: #007bff;
    --accent-blue-light: #339cff;
    --accent-blue-glow: rgba(0, 123, 255, 0.35);
    --accent-live: #ff3b3b;
    --accent-live-glow: rgba(255, 59, 59, 0.4);

    --text-primary: #f0f0f5;
    --text-secondary: #9898aa;
    --text-muted: #5a5a72;

    --border: rgba(255, 255, 255, 0.07);
    --border-active: rgba(0, 86, 214, 0.6);

    --nav-height: 60px;
    --sidebar-width: 280px;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;

    --transition: 0.2s ease;
    --transition-slow: 0.4s ease;

    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ===================================================
   RESET & BASE
   =================================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: var(--font);
}

input {
    font-family: var(--font);
}

img {
    display: block;
}

.hidden {
    display: none !important;
}

/* ===================================================
   LOADING OVERLAY
   =================================================== */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-overlay.fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.spinner {
    width: 44px;
    height: 44px;
    border: 3px solid rgba(0, 86, 214, 0.2);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}

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


/* ===================================================
   APP LAYOUT
   =================================================== */
.app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ===================================================
   TOP NAV
   =================================================== */
.topnav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: var(--nav-bg);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 1000;
    gap: 16px;
}

.btn-menu-mobile {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 1.2rem;
    transition: background var(--transition);
}

.btn-menu-mobile:hover {
    background: rgba(255, 255, 255, 0.08);
}

@media (max-width: 900px) {
    .btn-menu-mobile {
        display: flex;
    }
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
}

.nav-logo {
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: #fff;
    white-space: nowrap;
    flex-shrink: 0;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color var(--transition), background var(--transition);
    white-space: nowrap;
}

.nav-link i {
    font-size: 0.8rem;
}

.nav-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
}

.nav-link.active {
    color: #fff;
    background: rgba(0, 86, 214, 0.18);
}

.nav-link[data-section="ao-vivo"] i {
    color: var(--accent-live);
}

.pulse-dot {
    animation: pulse-live 1.8s ease-in-out infinite;
    font-size: 0.6rem !important;
}

@keyframes pulse-live {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(0.7);
    }
}

/* USER INFO NAV */
.nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.user-info {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 5px 10px 5px 5px;
    border-radius: 30px;
    border: 1px solid var(--border);
    transition: background var(--transition), border-color var(--transition);
}

.user-info:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.12);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    overflow: hidden;
    flex-shrink: 0;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.user-name-nav {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    min-width: 180px;
    padding: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all var(--transition);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.user-info:hover .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    color: var(--text-secondary);
    transition: background var(--transition), color var(--transition);
}

.user-dropdown a:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
}

/* ===================================================
   MOBILE MENU
   =================================================== */
.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    padding: 20px 14px;
    z-index: 2000;
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s;
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-shadow: 20px 0 50px rgba(0, 0, 0, 0.8);
}

.mobile-menu.active {
    transform: translateX(0);
    visibility: visible;
}

.menu-state-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.menu-state-content.hidden {
    display: none;
}

.mob-link-back {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    width: 100%;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--accent-blue-light);
    background: rgba(0, 123, 255, 0.08);
    transition: all var(--transition);
    margin-bottom: 8px;
}

.mob-link-back:hover {
    background: rgba(0, 123, 255, 0.15);
    transform: translateX(-4px);
}

.mobile-search-container {
    position: relative;
    margin: 10px 0;
}

.mobile-search-container i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.85rem;
}

.mobile-search-container input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 10px 14px 10px 38px;
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
}

.canal-list-mobile {
    flex: 1;
    overflow-y: auto;
    max-height: 60vh;
    padding-right: 4px;
}

.mob-push-bottom {
    margin-top: auto;
}

/* Overlay para quando o menu mobile está aberto */
.mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding: 0 10px;
}

.mobile-menu-header .nav-logo {
    font-size: 1.4rem;
}

.btn-close-menu {
    color: var(--text-secondary);
    font-size: 1.2rem;
    padding: 8px;
}


.mob-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: background var(--transition), color var(--transition);
}

.mob-link:hover,
.mob-link.active {
    background: rgba(0, 86, 214, 0.12);
    color: var(--text-primary);
}

.mob-divider {
    height: 1px;
    background: var(--border);
    margin: 8px 0;
}

/* ===================================================
   MAIN WRAPPER (SIDEBAR + PLAYER)
   =================================================== */
.main-wrapper {
    display: flex;
    margin-top: var(--nav-height);
    height: calc(100vh - var(--nav-height));
    overflow: hidden;
}

/* ===================================================
   SIDEBAR
   =================================================== */
.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.3s ease, width 0.3s ease, margin 0.3s ease;
}

.sidebar.sidebar-hidden {
    width: 0;
    border-right: none;
    transform: translateX(-100%);
}

.sidebar-search {
    padding: 14px 14px 10px;
    position: relative;
    flex-shrink: 0;
}

.sidebar-search i {
    position: absolute;
    left: 26px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.8rem;
    pointer-events: none;
}

.sidebar-search input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 9px 14px 9px 36px;
    color: var(--text-primary);
    font-size: 0.85rem;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.sidebar-search input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px var(--accent-blue-glow);
}

.sidebar-search input::placeholder {
    color: var(--text-muted);
}

.canal-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 6px 8px 16px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.canal-list::-webkit-scrollbar {
    width: 4px;
}

.canal-list::-webkit-scrollbar-track {
    background: transparent;
}

.canal-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.canal-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.18);
}

/* Canal Category Header */
.cat-header {
    padding: 14px 8px 6px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--text-muted);
    user-select: none;
    transition: color 0.3s ease;
}

.cat-header:hover {
    color: var(--text-primary);
}

.cat-movies-container {
    padding-left: 8px;
    animation: fadeIn 0.3s ease;
}

/* Canal Item */
.canal-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
    border: 1px solid transparent;
    margin-bottom: 4px;
    background: rgba(255, 255, 255, 0.02);
}

.canal-item:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateX(4px);
    border-color: rgba(255, 255, 255, 0.05);
}

.canal-item:focus-visible {
    outline: none;
    background: rgba(0, 123, 255, 0.16);
    border-color: var(--accent-blue-light);
    box-shadow: 0 0 0 3px var(--accent-blue-glow);
    transform: translateX(4px);
}

.canal-item.active {
    background: rgba(0, 123, 255, 0.12);
    border-color: var(--accent-blue);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.canal-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 20%;
    bottom: 20%;
    width: 3px;
    background: var(--accent-blue);
    border-radius: 0 4px 4px 0;
}

.canal-item.active::after {
    content: '';
    position: absolute;
    right: 10px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-live);
    box-shadow: 0 0 8px var(--accent-live-glow);
    animation: pulse-live 1.5s ease-in-out infinite;
}

/* Deixa o texto do EPG um pouco mais brilhante apenas no canal selecionado */
.canal-item.active .canal-epg {
    color: rgba(255, 255, 255, 0.7);
}

.canal-logo {
    width: 48px;
    height: 32px;
    border-radius: var(--radius-sm);
    object-fit: contain;
    background: rgba(255, 255, 255, 0.06);
    padding: 2px;
    flex-shrink: 0;
}

.canal-logo-fallback {
    width: 48px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: rgba(0, 86, 214, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-blue-light);
    font-size: 1rem;
    flex-shrink: 0;
}

.canal-meta {
    flex: 1;
    min-width: 0;
}

.canal-name {
    font-size: 0.80rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.canal-epg {
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.08) 50%, rgba(255, 255, 255, 0.04) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

/* ===================================================
   PLAYER AREA
   =================================================== */
.player-area {
    flex: 1;
    background: var(--player-bg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ===================================================
   HOME SCREEN — welcome-screen reaproveitado
   =================================================== */
.welcome-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Centraliza as seções internas */
    background: var(--player-bg);
    background-image:
        radial-gradient(ellipse at 20% 0%, rgba(0, 86, 214, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(0, 86, 214, 0.05) 0%, transparent 50%);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

/* ── HERO ── */
.home-hero {
    width: 100%;
    max-width: 1400px;
    padding: 40px 60px 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 14px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.welcome-logo {
    font-size: 3.2rem;
    font-weight: 900;
    letter-spacing: -1px;
    color: #fff;
    line-height: 1;
}

.nav-logo span,
.welcome-logo span,
.home-logo span {
    color: var(--accent-blue-light);
}

.home-tagline {
    color: var(--text-secondary);
    font-size: 0.9rem;
    max-width: 420px;
    line-height: 1.5;
    text-align: center;
}

.home-badges {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
}

.home-badge {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
}

.home-badge i {
    color: var(--accent-blue-light);
    font-size: 0.75rem;
}

/* ── SECTIONS ── */
.home-section {
    width: 100%;
    max-width: 1400px;
    padding: 28px 60px;
    flex-shrink: 0;
}

.home-section+.home-section {
    border-top: 1px solid var(--border);
}

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

.home-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 9px;
}

.home-section-title i {
    color: var(--accent-blue-light);
    font-size: 0.9rem;
}

.home-section-link {
    font-size: 0.8rem;
    color: var(--accent-blue-light);
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color var(--transition);
    cursor: pointer;
}

.home-section-link:hover {
    color: #4d91ff;
}

.home-section-badge {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 3px 8px;
    border-radius: 4px;
    background: rgba(0, 123, 255, 0.15);
    color: var(--accent-blue-light);
    border: 1px solid rgba(0, 123, 255, 0.25);
}

.home-trend-toggle {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 4px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    border-radius: 999px;
}

.home-trend-btn {
    min-width: 76px;
    padding: 7px 14px;
    border-radius: 999px;
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 700;
    transition: background var(--transition), color var(--transition), box-shadow var(--transition);
}

.home-trend-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
}

.home-trend-btn.active {
    color: #fff;
    background: var(--accent-blue);
    box-shadow: 0 0 12px var(--accent-blue-glow);
}

/* ── CHANNEL CARDS (5 em linha) ── */
.home-channel-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
}

.home-channel-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 18px 12px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition), background var(--transition);
    text-align: center;
    min-height: 110px;
}

.home-channel-card:hover {
    transform: translateY(-4px);
    background: var(--bg-card-hover);
    border-color: var(--accent-blue);
    box-shadow: 0 8px 28px rgba(0, 86, 214, 0.2);
}

.hcc-logo {
    position: relative;
    width: 64px;
    height: 42px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.hcc-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 4px;
}

.hcc-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-blue-light);
    font-size: 1.2rem;
}


.hcc-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

/* ── MOVIE CARDS (5 em linha) ── */
.home-movies-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
}

.home-movie-card {
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition);
}

.home-movie-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}

.home-movie-card:hover .hmc-overlay {
    opacity: 1;
}

.hmc-poster {
    position: relative;
    aspect-ratio: 2/3;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.04);
}

.hmc-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.home-movie-card:hover .hmc-poster img {
    transform: scale(1.05);
}

.hmc-poster-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 2rem;
}

.hmc-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, transparent 60%);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    padding: 10px;
    opacity: 0;
    transition: opacity var(--transition);
}

.hmc-rating {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    border-radius: 20px;
    padding: 3px 9px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #ffd700;
    display: flex;
    align-items: center;
    gap: 5px;
}

.hmc-rating i {
    font-size: 0.65rem;
}

.hmc-info {
    padding: 10px 12px 12px;
}

.hmc-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    margin-bottom: 3px;
}

.hmc-year {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* ── SKELETON CARD ── */
.skeleton-card {
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0.04) 0%,
            rgba(255, 255, 255, 0.08) 50%,
            rgba(255, 255, 255, 0.04) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-md);
}

/* skeleton para canais */
.home-channel-grid .skeleton-card {
    min-height: 110px;
}

/* skeleton para filmes */
.home-movies-grid .skeleton-card {
    aspect-ratio: 2/3;
    height: auto;
}

/* ── RESPONSIVIDADE HOME ── */
@media (max-width: 900px) {
    .home-hero {
        padding: 20px 20px 16px;
    }

    .home-section {
        padding: 20px;
    }

    .home-channel-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .home-movies-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 600px) {
    .home-channel-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .home-movies-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .home-hero {
        flex-direction: column;
    }
}

/* PLAYER CONTAINER */
.player-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    overflow-y: auto; /* Permite rolar a tela para ver a grade */
}

.player-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: rgba(0, 0, 0, 0.4);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    gap: 12px;
    flex-wrap: wrap;
}

.player-channel-info {
    display: flex;
    align-items: center;
    gap: 14px;
}

.player-logo {
    height: 40px;
    width: 64px;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-sm);
    padding: 4px;
}

.player-channel-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}

.live-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--accent-live);
    margin-top: 3px;
}

.live-badge i {
    font-size: 0.5rem;
    animation: pulse-live 1.5s ease-in-out infinite;
}

/* FONTE SELECTOR */
.player-fonte-selector {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.btn-fonte {
    padding: 7px 16px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    transition: all var(--transition);
}

.btn-fonte:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.15);
}

.btn-fonte.active {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: #fff;
    box-shadow: 0 0 12px var(--accent-blue-glow);
}

/* PLAYER WRAPPER */
.player-wrapper {
    /* flex: 1;  <-- REMOVEMOS ISSO */
    width: 100%;
    aspect-ratio: 16 / 9;
    /* Força o formato retangular de vídeo */
    max-height: 75vh;
    /* Evita que o player ocupe 100% da tela em monitores muito grandes */
    flex-shrink: 0;
    /* Impede que a lista de programação esmague o player */
    position: relative;
    overflow: hidden;
    background: #000;
}

.player-wrapper iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.player-loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    z-index: 10;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.player-loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

.player-loading-overlay.is-idle .spinner {
    display: none;
}

.player-loading-overlay.is-idle .idle-icon {
    display: block !important;
}

.player-loading-overlay.is-idle span {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 1rem;
}

/* ===================================================
   EPG (Programação do Canal)
   =================================================== */
.canal-epg {
    font-size: 0.7rem;
    color: var(--text-secondary);
    /* Deixa a cor suave para os canais não ativos */
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.epg-section {
    padding: 24px;
    background: var(--bg-primary);
    border-top: 1px solid var(--border);
}

.epg-header {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.epg-header i {
    color: var(--accent-live);
}

.epg-item {
    display: flex;
    gap: 20px;
    padding: 16px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    border-left: 3px solid transparent;
    transition: background var(--transition);
}

/* Estilo do programa atual (Ao Vivo) */
.epg-item.live {
    border-left-color: var(--accent-live);
    background: rgba(255, 59, 59, 0.03);
}

.epg-time {
    font-weight: 700;
    color: var(--text-muted);
    min-width: 45px;
    font-size: 0.95rem;
    padding-top: 2px;
}

.epg-item.live .epg-time {
    color: var(--accent-live);
}

.epg-details {
    flex: 1;
}

.epg-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 6px;
    gap: 10px;
}

.epg-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.epg-item.live .epg-title {
    font-weight: 700;
    color: #fff;
    /* Título ao vivo bem destacado */
}

.epg-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.badge-live {
    background: var(--accent-live);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 12px;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

/* ===================================================
   CANAL LOADING
   =================================================== */
.canal-loading {
    padding: 4px;
}

/* ===================================================
   RESPONSIVE
   =================================================== */
@media (max-width: 900px) {
    :root {
        --sidebar-width: 260px;
    }

    .nav-links {
        display: none;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 2100;
        transform: translateX(-100%);
        box-shadow: 10px 0 40px rgba(0, 0, 0, 0.7);
        padding-top: 10px;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .player-area {
        width: 100%;
    }

    /* Ajuste para o botão de fechar sidebar no mobile (se adicionarmos) */
    .sidebar-header-mobile {
        display: none;
        align-items: center;
        justify-content: space-between;
        padding: 14px 18px;
        border-bottom: 1px solid var(--border);
        background: var(--bg-secondary);
    }

    @media (max-width: 900px) {
        .sidebar-header-mobile {
            display: flex;
        }
    }
}


@media (max-width: 600px) {
    :root {
        --sidebar-width: 85vw;
    }

    .nav-logo {
        font-size: 1.2rem;
    }

    .user-name-nav {
        display: none;
    }

    .welcome-logo {
        font-size: 2rem;
    }

    .welcome-msg {
        font-size: 0.87rem;
    }

    .player-header {
        padding: 10px 14px;
    }

    .player-channel-name {
        font-size: 0.95rem;
    }

    .player-logo {
        height: 32px;
        width: 50px;
    }

    .login-card {
        padding: 30px 22px;
    }

    .logo-text {
        font-size: 1.7rem;
    }
}
