/* assets/style.css v33 */
:root {
    --primary: #e50914;
    --bg: #141414;
    --surface: #1f1f1f;
    --text: #fff;
    --text-gray: #b3b3b3;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
}

* {
    box-sizing: border-box;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ... existing styles ... */
.sidebar {
    width: 240px;
    height: 100vh;
    background: var(--sidebar-bg, #000000);
    border-right: none;
    display: flex;
    flex-direction: column;
    padding: 20px;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 100;
    transition: transform 0.3s;
}

.brand {
    font-size: 1.5rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    margin-bottom: 40px;
    letter-spacing: -1px;
}

.nav-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 16px;
    border-radius: 8px;
    color: #aaa;
    text-decoration: none;
    cursor: pointer;
    transition: 0.2s;
    font-weight: 500;
}

.nav-item:hover,
.nav-item.active {
    background: linear-gradient(90deg, var(--primary) 0%, var(--sidebar-bg) 100%);
    color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.main-wrapper {
    margin-left: 240px;
    min-height: 100vh;
    padding-bottom: 50px;
}

/* MOVIE & SERIES DETAIL PAGE */
.movie-detail-hero {
    position: relative;
    height: 85vh;
    width: 100%;
    display: flex;
    align-items: center;
}

.movie-backdrop {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center top;
    opacity: 0.6;
    mask-image: linear-gradient(to bottom, black 0%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
}

.movie-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, #141414 10%, rgba(20, 20, 20, 0.8) 50%, transparent 100%);
}

.movie-gradient-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: linear-gradient(to top, #141414 10%, transparent 100%);
}

.movie-info-container {
    position: relative;
    z-index: 10;
    padding: 0 60px;
    max-width: 800px;
}

.movie-logo-text {
    font-size: 4rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 20px;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.movie-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    color: #ccc;
    font-size: 0.95rem;
    margin-bottom: 20px;
    font-weight: 500;
}

.rating-badge {
    color: #46d369;
    font-weight: bold;
    border: 1px solid #46d369;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.8rem;
}

.movie-desc {
    color: #ddd;
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 30px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    max-height: 150px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
}

.action-buttons {
    display: flex;
    gap: 15px;
}

.btn-play-lg {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 32px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: 0.2s;
}

.btn-play-lg:hover {
    background: #ff1f2f;
    transform: scale(1.05);
}

.btn-fav {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 12px 24px;
    font-size: 1rem;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: 0.2s;
}

.btn-fav:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: white;
}

.movie-sections {
    padding: 40px 60px;
    margin-top: 0;
    position: relative;
    z-index: 20;
    background: #09090b;
}

.section-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cast-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.cast-item {
    text-align: center;
}

.cast-img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 10px;
    border: 2px solid #333;
}

.cast-name {
    font-size: 0.9rem;
    color: #eee;
    font-weight: 600;
}

.trailer-container {
    width: 100%;
    max-width: 800px;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #333;
    margin-bottom: 50px;
}

/* SERIES SPECIFIC */
.season-select {
    background: #222;
    color: white;
    border: 1px solid #333;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
}

.episode-list-vertical {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 900px;
}

.episode-card {
    display: flex;
    gap: 20px;
    background: #1a1a1a;
    padding: 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
    border: 1px solid transparent;
}

.episode-card:hover {
    background: #222;
    border-color: #333;
    transform: translateX(5px);
}

.ep-thumb-container {
    width: 220px;
    height: 124px;
    flex-shrink: 0;
    position: relative;
}

.ep-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
    background: #000;
}

.ep-play-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: 0.2s;
}

.episode-card:hover .ep-play-overlay {
    opacity: 1;
}

.ep-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.ep-title {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 5px;
    color: #fff;
}

.ep-meta {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 10px;
    font-weight: 600;
}

.ep-desc {
    color: #bbb;
    font-size: 0.95rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* VOD PLAYER LAYOUT PREMIUM */
.vod-player-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    height: 100vh;
    background: #09090b;
    overflow: hidden;
}

.vod-main {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    position: relative;
    background: radial-gradient(circle at center, #1f1f23 0%, #000000 100%);
}

.vod-header {
    padding: 20px 30px;
    display: flex;
    align-items: center;
    gap: 15px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 50;
    pointer-events: none;
}

.vod-header * {
    pointer-events: auto;
}

.vod-video-area {
    width: 100%;
    flex: 1;
    /* Ocupa o espaço disponível, empurrando detalhes para baixo se necessário */
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.vod-video-area video {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    background: #000;
}

.vod-details-area {
    background: rgba(24, 24, 27, 0.95);
    padding: 25px 40px;
    border-top: 1px solid #27272a;
    backdrop-filter: blur(10px);
    flex-shrink: 0;
    max-height: 30vh;
    overflow-y: auto;
}

.vod-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.vod-desc-box {
    color: #a1a1aa;
    line-height: 1.6;
    font-size: 0.95rem;
    max-width: 900px;
}

/* SIDEBAR VOD */
.vod-sidebar {
    background: #101012;
    border-left: 1px solid #27272a;
    display: flex;
    flex-direction: column;
}

.vod-sidebar-header {
    padding: 20px;
    font-weight: 700;
    font-size: 0.9rem;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid #27272a;
    background: #18181b;
}

.vod-related-list {
    padding: 15px;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.vod-related-item {
    display: flex;
    gap: 12px;
    padding: 10px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
    background: transparent;
    border: 1px solid transparent;
}

.vod-related-item:hover,
.vod-related-item.active {
    background: #27272a;
    transform: translateX(5px);
}

.vod-related-item.active {
    border: 1px solid var(--primary);
    box-shadow: 0 4px 12px rgba(229, 9, 20, 0.2);
}

.vod-related-img {
    width: 100px;
    height: 56px;
    object-fit: cover;
    border-radius: 6px;
    background: #000;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.vod-related-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    /* Para o text-overflow funcionar */
}

.vod-related-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #e4e4e7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

/* LIVE PLAYER PREMIUM */
.player-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    height: 100vh;
    background: #000;
    overflow: hidden;
}

.player-main {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    position: relative;
    background: radial-gradient(circle at center, #1a1a1d 0%, #000000 100%);
}

.player-header-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 20;
    padding: 20px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), transparent);
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 15px;
}

.player-header-bar * {
    pointer-events: auto;
}

.video-container {
    width: 100%;
    flex: 1;
    min-height: 0;
    /* Importante para flexbox */
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px 10px 20px;
    /* Padding lateral */
    box-sizing: border-box;
}

.video-container video {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    background: #000;
}

.channel-info-card {
    flex-shrink: 0;
    padding: 20px 30px;
    background: rgba(20, 20, 23, 0.95);
    display: flex;
    align-items: center;
    gap: 25px;
    border-top: 1px solid #333;
    backdrop-filter: blur(10px);
    max-height: 160px;
    /* Limita a altura para não ficar gigante */
}

.channel-logo-large {
    width: 70px;
    /* Reduzido levemente de 80 */
    height: 70px;
    object-fit: contain;
    background: #fff;
    /* Fundo branco pra destacar logo transparente */
    border-radius: 12px;
    border: 2px solid #333;
    padding: 5px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.channel-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.channel-name-large {
    font-size: 1.4rem;
    font-weight: 800;
    color: white;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.epg-now-next {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.epg-row {
    display: flex;
    align-items: baseline;
    gap: 12px;
    font-size: 0.9rem;
    padding: 4px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    width: fit-content;
}

.epg-label {
    color: var(--primary);
    font-weight: 800;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 50px;
}

.epg-time {
    color: #ccc;
    font-family: 'Inter', monospace;
    font-weight: 600;
}

.epg-title {
    color: white;
    font-weight: 500;
}

/* SIDEBAR LIVE */
.related-sidebar {
    background: #101012;
    border-left: 1px solid #27272a;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.related-header {
    padding: 20px;
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid #27272a;
    background: #18181b;
}

.related-list {
    overflow-y: auto;
    flex: 1;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.related-item {
    display: flex;
    gap: 15px;
    padding: 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    align-items: center;
    background: transparent;
    border: 1px solid transparent;
}

.related-item:hover {
    background: #27272a;
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.related-item.active {
    background: #27272a;
    border: 1px solid rgba(229, 9, 20, 0.5);
    /* Borda sutil vermelha */
    box-shadow: 0 0 15px rgba(229, 9, 20, 0.15);
}

.related-logo {
    width: 50px;
    height: 50px;
    object-fit: contain;
    background: #fff;
    /* Fundo branco para logos */
    border-radius: 10px;
    padding: 2px;
    flex-shrink: 0;
}

.related-info {
    overflow: hidden;
    flex: 1;
}

.related-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #e4e4e7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.related-item:hover .related-name {
    color: white;
}

/* Responsive */
@media (max-width: 900px) {

    .vod-player-layout,
    .player-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }

    .vod-sidebar,
    .related-sidebar {
        display: none;
    }

    .video-container,
    .vod-video-area {
        height: auto;
        aspect-ratio: 16/9;
        padding: 0;
        /* Remove padding no mobile p/ full width */
    }

    .video-container video,
    .vod-video-area video {
        border-radius: 0;
        /* Video quadrado no mobile pra aproveitar tela */
    }

    .channel-info-card,
    .vod-details-area {
        padding: 15px;
    }

    .channel-logo-large {
        width: 50px;
        height: 50px;
    }

    .channel-name-large {
        font-size: 1.1rem;
    }
}

/* ... Legacy imports (hero-section, cat-layout, grid-card, rail) kept for compatibility ... */
.hero-section {
    height: 75vh;
    position: relative;
    width: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 20px;
}

.hero-bg-container {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.hero-img-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, #09090b 0%, rgba(9, 9, 11, 0.95) 25%, rgba(9, 9, 11, 0.6) 50%, rgba(9, 9, 11, 0.2) 75%, transparent 100%);
    width: 100%;
}

.hero-content {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 600px;
    padding-left: 60px;
    padding-bottom: 40px;
    margin-top: auto;
    margin-bottom: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin: 0 0 15px 0;
    letter-spacing: -1px;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
}

.hero-desc {
    font-size: 1.1rem;
    color: #d4d4d8;
    margin: 0 0 30px 0;
    line-height: 1.6;
    max-width: 500px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    font-weight: 500;
}

.hero-buttons {
    display: flex;
    gap: 16px;
}

.btn {
    padding: 12px 28px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    border: none;
}

.btn-hero {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.btn-hero:hover {
    background: linear-gradient(90deg, var(--primary) 0%, var(--sidebar-bg) 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6);
}

.btn-glass {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-glass:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: white;
    transform: translateY(-2px);
}

.cat-layout {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.cat-header {
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    border-bottom: none;
    background: var(--sidebar-bg);
}

.search-input {
    background: #27272a;
    border: 1px solid #3f3f46;
    color: white;
    padding: 10px 16px;
    border-radius: 20px;
    width: 300px;
    font-size: 0.9rem;
    transition: 0.2s;
}

.search-input:focus {
    border-color: var(--primary);
    background: #3f3f46;
}

.cat-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.cat-sidebar {
    width: 260px;
    overflow-y: auto;
    background: #121212;
    border-right: 1px solid #27272a;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cat-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #09090b;
}

.cat-item {
    padding: 12px 16px;
    border-radius: 6px;
    cursor: pointer;
    color: #a1a1aa;
    font-size: 0.95rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: 0.2s;
    font-weight: 500;
}

.cat-item:hover,
.cat-item.active {
    background: #27272a;
    color: white;
}

.cat-item.active {
    border-left: 3px solid var(--primary);
}

.grid-container {
    display: grid;
    gap: 20px;
    padding-bottom: 50px;
}

.grid-container.live {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.grid-container.movie,
.grid-container.series {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

.grid-card {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: 0.3s;
    background: #18181b;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    aspect-ratio: 2/3;
}

.grid-container.live .grid-card {
    aspect-ratio: 16/9;
}

.grid-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: 0.3s;
    opacity: 0.8;
}

.grid-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.4);
    z-index: 10;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.grid-card:hover img {
    opacity: 1;
    filter: brightness(1.2);
}

.grid-card-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    font-size: 0.9rem;
    font-weight: 600;
    color: white;
    text-align: center;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.badge-live {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ef4444;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: bold;
    animation: pulse 2s infinite;
}

.back-btn {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
    opacity: 0.8;
    transition: 0.2s;
    font-size: 1rem;
}

.back-btn:hover {
    opacity: 1;
    transform: translateX(-5px);
}

.channel-logo-large {
    width: 80px;
    height: 80px;
    object-fit: contain;
    background: black;
    border-radius: 8px;
    border: 1px solid #333;
}

.channel-name-large {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.epg-now-next {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.epg-row {
    display: flex;
    gap: 10px;
    align-items: baseline;
    font-size: 0.9rem;
}

.epg-label {
    color: var(--primary);
    font-weight: 700;
    font-size: 0.7rem;
    width: 45px;
}

.epg-time {
    color: #aaa;
    font-family: monospace;
}

.epg-title {
    font-weight: 500;
}

.content-rail-section {
    padding: 0 0 40px 60px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    position: relative;
    z-index: 30;
}

.rail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-right: 60px;
}

.rail-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #e5e5e5;
}

.rail-see-all {
    color: #54b9c5;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.content-rail-section:hover .rail-see-all {
    opacity: 1;
}

.rail-scroll {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 20px;
    padding-right: 60px;
    scroll-behavior: smooth;
}

.rail-scroll::-webkit-scrollbar {
    height: 0;
}

.rail-card {
    flex: 0 0 auto;
    position: relative;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease, z-index 0s 0.1s;
    background: #222;
}

.card-poster {
    width: 140px;
    height: 210px;
}

.card-landscape {
    width: 220px;
    height: 124px;
}

.card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

/* FIX: Channel Logos ("No Card" Look) + Name Below */
.rail-card.card-landscape {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    aspect-ratio: auto !important;
    padding: 0 !important;
    width: 130px !important;
    /* Largura fixa e compacta */
    margin-right: -5px;
    /* Reduz visualmente o gap entre itens */
    display: flex;
    flex-direction: column;
    align-items: center;
}

.rail-card.card-landscape:hover {
    transform: translateY(-5px);
    /* Move levemente pra cima em vez de scale gigante */
    z-index: 100 !important;
}

.rail-card.card-landscape .card-img {
    object-fit: contain !important;
    background: transparent !important;
    padding: 0;
    width: 100% !important;
    height: 70px !important;
    /* Altura fixa da logo */
    transition: 0.3s;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.rail-card.card-landscape:hover .card-img {
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.3));
    transform: scale(1.1);
}

/* Título Premium Abaixo da Logo */
.rail-card.card-landscape .card-overlay {
    position: static !important;
    /* Remove do topo da imagem */
    background: transparent !important;
    /* Sem gradiente preto */
    opacity: 1 !important;
    /* Sempre visível */
    padding: 8px 0 0 0 !important;
    display: block !important;
    width: 100%;
    height: auto !important;
}

.rail-card.card-landscape .card-title {
    display: block !important;
    color: #9ca3af !important;
    /* Cinza elegante */
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    text-align: center !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    transition: 0.3s;
}

.rail-card.card-landscape:hover .card-title {
    color: white !important;
    /* Branco ao passar mouse */
}

.card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    opacity: 0;
    transition: opacity 0.2s;
    display: flex;
    align-items: flex-end;
    padding: 10px;
}

.rail-card:hover .card-overlay {
    opacity: 1;
}

.card-title {
    color: white;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    width: 100%;
}

.rail-card:hover {
    transform: scale(1.05);
    z-index: 100;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
}

/* --- PREMIUM SETTINGS (RE-INJECTED) --- */
.settings-container {
    padding: 60px 100px;
    max-width: 1200px;
    margin: 0;
    width: 100%;
}

.settings-page-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 5px;
    color: white;
}

.settings-page-desc {
    color: #a1a1aa;
    font-size: 1rem;
    margin-bottom: 40px;
}

.settings-card {
    background: #18181b;
    border: 1px solid #27272a;
    border-radius: 12px;
    margin-bottom: 24px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.card-header-premium {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    border-bottom: 1px solid #27272a;
    background: linear-gradient(to right, #18181b, #202023);
}

.card-icon-box {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.card-icon-box.red {
    background: var(--primary);
    color: white;
}

.card-icon-box.dark {
    background: #27272a;
    color: #e4e4e7;
    border: 1px solid #3f3f46;
}

.card-header-text h3 {
    margin: 0 0 4px 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
}

.card-header-text p {
    margin: 0;
    font-size: 0.85rem;
    color: #a1a1aa;
}

.card-body-premium {
    padding: 24px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid #27272a;
}

.info-row:first-child {
    padding-top: 0;
}

.info-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.info-label {
    color: #a1a1aa;
    font-size: 0.95rem;
}

.info-value {
    color: white;
    font-weight: 600;
    font-size: 0.95rem;
}

.status-badge {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    border: 1px solid rgba(74, 222, 128, 0.2);
}

.player-section-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: white;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
}

.player-inputs-row {
    display: flex;
    gap: 20px;
    margin-bottom: 10px;
}

.input-col {
    flex: 1;
}

.input-label-small {
    display: block;
    font-size: 0.8rem;
    color: #71717a;
    margin-bottom: 8px;
}

.premium-input {
    width: 100%;
    background: #27272a;
    border: 1px solid #3f3f46;
    border-radius: 8px;
    padding: 12px 16px;
    color: white;
    font-size: 0.95rem;
    font-family: inherit;
    transition: 0.2s;
    outline: none;
}

.premium-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(229, 9, 20, 0.2);
}

.input-helper {
    font-size: 0.75rem;
    color: #52525b;
    margin-bottom: 24px;
    display: block;
}

.toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid #27272a;
    margin-top: 15px;
}

.toggle-info h4 {
    margin: 0 0 4px 0;
    font-size: 0.95rem;
    color: white;
}

.toggle-info p {
    margin: 0;
    font-size: 0.8rem;
    color: #71717a;
}

.pin-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    background: #202023;
    padding: 20px;
    border-radius: 12px;
}

.pin-info h4 {
    margin: 0 0 4px 0;
    font-size: 0.95rem;
    font-weight: 700;
}

.pin-info p {
    margin: 0;
    font-size: 0.8rem;
    color: #71717a;
}

.pin-actions {
    display: flex;
    gap: 10px;
}

.btn-small {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: 0.2s;
}

.btn-outline {
    background: transparent;
    border: 1px solid #3f3f46;
    color: #e4e4e7;
}

.btn-outline:hover {
    border-color: white;
    color: white;
}

.btn-solid-gray {
    background: #3f3f46;
    color: white;
}

.cat-section-title {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: white;
}

.cat-section-desc {
    font-size: 0.8rem;
    color: #71717a;
    margin-bottom: 15px;
}

.tabs-container {
    background: #27272a;
    padding: 4px;
    border-radius: 8px;
    display: flex;
    gap: 2px;
    margin-bottom: 20px;
    width: 100%;
}

.tab-premium {
    flex: 1;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #a1a1aa;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tab-premium:hover {
    color: white;
}

.tab-premium.active {
    background: #09090b;
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.check-list-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    max-height: 400px;
    overflow-y: auto;
}

.check-card {
    background: #202023;
    border: 1px solid #27272a;
    border-radius: 8px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: 0.2s;
}

.check-card:hover {
    border-color: #52525b;
}

.check-box {
    width: 18px;
    height: 18px;
    border: 2px solid #52525b;
    border-radius: 4px;
    flex-shrink: 0;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
}

.check-card.checked .check-box {
    background: var(--primary);
    border-color: var(--primary);
}

.check-card.checked .check-box::after {
    content: '';
    width: 8px;
    height: 4px;
    border-left: 2px solid white;
    border-bottom: 2px solid white;
    transform: rotate(-45deg) translate(2px, -2px);
}

.check-label {
    font-size: 0.85rem;
    color: #e4e4e7;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.logout-card {
    background: #18181b;
    border: 1px solid #27272a;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: 0.2s;
}

.logout-card:hover {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
}

.logout-content {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ef4444;
    font-weight: 600;
    font-size: 0.95rem;
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    border-radius: 12px;
    background: #3f3f46;
    cursor: pointer;
    transition: 0.3s;
}

.toggle-switch.checked {
    background: var(--primary);
}

.toggle-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    transition: 0.3s;
}

.toggle-switch.checked .toggle-thumb {
    transform: translateX(20px);
}


.live-marquee-section .rail-header {
    display: none !important;
}

.live-marquee-section {
    overflow: hidden;
    /* Oculta o que sai da tela */
    mask-image: linear-gradient(to right, transparent 0%, black 2%, black 98%, transparent 100%);
    /* Fade nas bordas laterais */
}

.live-marquee-section .rail-scroll {
    overflow-x: visible !important;
    padding-bottom: 20px !important;
    /* Espaço para o hover (transformY) */
    padding-left: 0 !important;
}

.marquee-scroll {
    display: flex;
    width: max-content;
    /* Largura baseada no conteúdo total */
    animation: marquee 80s linear infinite;
    /* Animação lenta (80s) */
    gap: 0 !important;
    /* Gap controlado pelo margin-right dos cards */
}

/* Pause animation on hover anywhere in the scroll area */
.live-marquee-section:hover .marquee-scroll {
    animation-play-state: paused;
}

@keyframes marquee {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }

    /* Move metade (já que duplicamos) para criar loop invisível */
}

/* EPISODE PROGRESS */
.ep-progress-bg {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    z-index: 5;
}

.ep-progress-fill {
    height: 100%;
    background: var(--primary);
    width: 0%;
}

/* NEXT EPISODE AUTO PLAY */
.next-ep-overlay {
    position: absolute;
    bottom: 90px;
    right: 30px;
    background: rgba(18, 18, 18, 0.95);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #333;
    display: none;
    /* Inicia oculto */
    flex-direction: column;
    gap: 12px;
    z-index: 60;
    width: 260px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
}

.next-loader-bar {
    height: 3px;
    background: #333;
    width: 100%;
    border-radius: 2px;
    overflow: hidden;
}

.next-loader-fill {
    height: 100%;
    background: var(--primary);
    width: 0%;
    transition: width 1s linear;
}

/* FAVORITE HEART ICON */
.fav-icon-wrapper {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: transform 0.2s, background 0.2s;
}

.fav-icon-wrapper:hover {
    transform: scale(1.1);
    background: rgba(0, 0, 0, 0.8);
}

.fav-icon-wrapper .material-icons {
    font-size: 18px;
    user-select: none;
}

/* SETTINGS PAGE ADJUSTMENTS */
.settings-container {
    max-width: 800px;
    margin: 60px auto;
    width: 90%;
    animation: fadeIn 0.4s ease;
}

.settings-page-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 10px 0;
}

.settings-page-desc {
    color: var(--text-gray);
    margin: 0;
    font-size: 1.1rem;
}

.settings-card {
    background: #1a1a1a;
    border-radius: 16px;
    border: 1px solid #333;
    overflow: hidden;
    margin-bottom: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.card-header-premium {
    padding: 24px;
    background: linear-gradient(to right, #252525, #1f1f1f);
    border-bottom: 1px solid #333;
    display: flex;
    align-items: center;
    gap: 16px;
}

.card-icon-box {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.card-icon-box.red {
    background: rgba(229, 9, 20, 0.15);
    color: var(--primary);
}

.card-icon-box.dark {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.card-header-text h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.card-header-text p {
    margin: 4px 0 0 0;
    color: #888;
    font-size: 0.9rem;
}

.card-body-premium {
    padding: 24px;
}

/* PIN & CATEGORIES */
.pin-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 1px solid #333;
    margin-bottom: 20px;
}

.pin-info h4 {
    margin: 0 0 4px 0;
    font-size: 1.1rem;
}

.pin-info h4 span {
    font-weight: normal;
    font-size: 0.9rem;
    color: #888;
    margin-left: 10px;
    border: 1px solid #444;
    padding: 2px 8px;
    border-radius: 4px;
}

.pin-info p {
    margin: 0;
    color: #888;
    font-size: 0.9rem;
}

.cat-section-title {
    font-size: 1.1rem;
    margin-bottom: 5px;
    color: #eee;
}

.cat-section-desc {
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.tabs-container {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    border-bottom: 1px solid #333;
}

.tab-premium {
    padding: 10px 20px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    color: #888;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: 0.2s;
}

.tab-premium:hover {
    color: #ccc;
}

.tab-premium.active {
    color: white;
    border-bottom-color: var(--primary);
}

.check-list-container {
    background: #111;
    border-radius: 8px;
    border: 1px solid #333;
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 8px;
}

.cat-check-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.2s;
    user-select: none;
    background: #1a1a1a;
    border: 1px solid transparent;
}

.cat-check-item:hover {
    background: #252525;
}

.cat-check-item.selected {
    border-color: rgba(229, 9, 20, 0.5);
    background: rgba(229, 9, 20, 0.1);
}

.cat-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid #555;
    border-radius: 4px;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
    flex-shrink: 0;
}

.cat-checkbox.checked {
    background: var(--primary);
    border-color: var(--primary);
}

.cat-checkbox.checked::after {
    content: 'check';
    font-family: 'Material Icons';
    font-size: 16px;
    color: white;
}

.save-fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--primary);
    color: white;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(229, 9, 20, 0.4);
    cursor: pointer;
    transition: transform 0.2s;
    z-index: 200;
    border: none;
    font-size: 30px;
}

.save-fab:hover {
    transform: scale(1.1);
}

/* PIN MODAL */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s;
}

.pin-modal {
    background: #1f1f1f;
    padding: 40px;
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    border: 1px solid #333;
}

.pin-title {
    margin: 0 0 10px 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

.pin-subtitle {
    margin: 0 0 30px 0;
    color: #888;
    font-size: 1rem;
}

.pin-dots {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
}

.pin-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #333;
    transition: 0.2s;
}

.pin-dot.filled {
    background: var(--primary);
    box-shadow: 0 0 10px var(--primary);
}

.pin-keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.pin-key {
    background: #2a2a2a;
    border: none;
    color: white;
    font-size: 1.5rem;
    padding: 20px 0;
    border-radius: 50%;
    aspect-ratio: 1;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

.pin-key:hover {
    background: #333;
    transform: scale(1.05);
}

.pin-key:active {
    background: #444;
    transform: scale(0.95);
}

.pin-cancel {
    margin-top: 20px;
    background: transparent;
    border: none;
    color: #888;
    cursor: pointer;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.pin-cancel:hover {
    color: white;
}

/* SIDEBAR COLLAPSE SYSTEM */
.sidebar,
.main-wrapper {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.brand-text,
.nav-item span:not(.material-icons) {
    white-space: nowrap;
    opacity: 1;
    transition: opacity 0.2s;
}

body.sidebar-collapsed .sidebar {
    width: 80px;
    padding: 20px 10px;
}

body.sidebar-collapsed .main-wrapper {
    margin-left: 80px;
}

body.sidebar-collapsed .brand-text {
    display: none;
    opacity: 0;
}

body.sidebar-collapsed .brand {
    justify-content: center;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
    align-items: center;
}

body.sidebar-collapsed .brand .material-icons.logo-icon {
    margin-right: 0 !important;
    font-size: 32px;
}

body.sidebar-collapsed .sidebar-toggler {
    transform: rotate(180deg);
    margin: 0 !important;
}

body.sidebar-collapsed .nav-item {
    justify-content: center;
    padding: 14px 0;
}

body.sidebar-collapsed .nav-item span:not(.material-icons) {
    display: none;
}

body.sidebar-collapsed .nav-item .material-icons {
    margin: 0;
    font-size: 24px;
}

.sidebar-toggler {
    background: transparent;
    border: 1px solid #333;
    color: #888;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 4px;
    width: 32px;
    height: 32px;
}

.sidebar-toggler:hover {
    background: #333;
    color: white;
    border-color: #555;
}