/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    background-color: #141414;
    color: #fff;
    overflow-x: hidden;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #141414; 
}
::-webkit-scrollbar-thumb {
    background: #555; 
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #888; 
}

/* Screen Management */
.screen {
    display: none;
    min-height: 100vh;
    padding-bottom: 50px;
    animation: fadeIn 0.3s ease;
}

.screen.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    height: 68px;
    padding: 0 4%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(to bottom, rgba(0,0,0,0.7) 10%, rgba(0,0,0,0));
    z-index: 1000;
    transition: background-color 0.3s;
}

.navbar.scrolled {
    background-color: rgba(20, 20, 20, 0.9);
    backdrop-filter: blur(10px);
}

.navbar-left {
    display: flex;
    align-items: center;
}

.logo {
    height: 25px;
    margin-right: 25px;
    cursor: pointer;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 20px;
}

.nav-link {
    color: #e5e5e5;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
    cursor: pointer;
}

.nav-link:hover, .nav-link.active {
    color: #fff;
    font-weight: 500;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.search-box {
    display: flex;
    align-items: center;
    background: rgba(0,0,0,0.5);
    border: 1px solid #ccc;
    padding: 5px 10px;
    border-radius: 4px;
}

.search-input {
    background: transparent;
    border: none;
    color: #fff;
    margin-left: 10px;
    outline: none;
    width: 0;
    transition: width 0.3s;
}

.search-box:hover .search-input,
.search-input:focus {
    width: 200px;
}

/* Ícones */
.icon {
    font-family: 'Material Icons';
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
}

.user-profile {
    cursor: pointer;
}

.user-avatar {
    width: 32px;
    height: 32px;
    background-color: #E50914;
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Hero Banner */
.hero-banner {
    position: relative;
    height: 80vh;
    width: 100%;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
}

.hero-banner::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, #141414 0%, transparent 50%);
}

.hero-content {
    position: relative;
    z-index: 10;
    padding-left: 4%;
    max-width: 600px;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.hero-description {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
}

/* Botões do Hero e Modal */
.btn-play {
    background: #E50914; /* Vermelho Padrão Netflix/Site */
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 4px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.2s;
}

.btn-play:hover {
    background: #b20710; /* Tom mais escuro no hover */
}

.btn-info {
    background: rgba(109, 109, 110, 0.7);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 4px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.2s;
}

.btn-info:hover {
    background-color: rgba(109, 109, 110, 0.4);
}

/* Content Sections */
.content-section {
    padding: 100px 4% 20px;
    position: relative;
    z-index: 10;
}

.screen-home .content-section {
    margin-top: -100px; /* Mantém o efeito negativo apenas na home por causa do banner */
    padding-top: 20px;
}

.section-title {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #e5e5e5;
}

.carousel-container {
    position: relative;
    margin-bottom: 3rem;
}

.content-row {
    margin-bottom: 3rem;
}

/* Carousel Controls */
.carousel-control {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 4%;
    background: rgba(0,0,0,0.3);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s;
    color: white;
    border: none;
    padding: 0;
}

.carousel-container:hover .carousel-control {
    opacity: 1;
}

.carousel-control:hover {
    background: rgba(0,0,0,0.5);
    color: #fff;
    backdrop-filter: blur(4px);
}

.carousel-control.prev {
    left: 0;
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
}

.carousel-control.next {
    right: 0;
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
}

.carousel-control .icon {
    font-size: 40px;
    font-weight: bold;
}

.content-carousel {
    display: flex;
    overflow-x: auto;
    gap: 10px;
    padding: 20px 0;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    margin: 0 4%; /* Espaço para os botões */
}

.content-carousel::-webkit-scrollbar {
    display: none;
}

/* Cards de Conteúdo (Corrigido) */
.content-card {
    min-width: 200px;
    max-width: 200px;
    height: 300px;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease, z-index 0.3s;
    position: relative;
    flex-shrink: 0;
    background-color: #222;
}

.content-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.content-card:hover {
    transform: scale(1.05);
    z-index: 20;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

/* Overlay do Card (Re-adicionado) */
.content-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 15px 10px;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    color: white;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.content-card:hover .content-card-overlay {
    opacity: 1;
}

.content-card-title {
    font-size: 14px;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.content-card-info {
    font-size: 12px;
    color: #ccc;
}

/* Barra de Progresso no Card (Re-adicionado) */
.watch-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.3);
}

.watch-progress-bar {
    height: 100%;
    background: #E50914;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: #181818;
    width: 90%;
    max-width: 850px;
    max-height: 90vh;
    border-radius: 8px;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #181818;
    color: #fff;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 20;
}

.modal-header {
    height: 400px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.modal-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background: linear-gradient(to top, #181818, transparent);
}

.modal-body {
    padding: 20px 40px 40px;
}

.modal-title {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.modal-meta {
    display: flex;
    gap: 15px;
    color: #a3a3a3;
    font-weight: 600;
    margin-bottom: 20px;
}

.modal-description {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 30px;
}

/* Episódios */
.season-selector select {
    background: #333;
    color: #fff;
    padding: 10px 20px;
    border: 1px solid #555;
    border-radius: 4px;
    font-size: 16px;
    margin-bottom: 20px;
}

.episodes-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.episode-item {
    display: flex;
    align-items: center;
    padding: 15px;
    background: #333;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.episode-item:hover {
    background: #444;
}

.episode-number {
    font-size: 1.2rem;
    font-weight: bold;
    color: #d2d2d2;
    margin-right: 20px;
    min-width: 30px;
}

.episode-info h4 {
    font-size: 1rem;
    margin-bottom: 5px;
}

.episode-info p {
    font-size: 0.9rem;
    color: #aaa;
}

/* Player Styles (Corrigido) */
.video-player-container {
    position: fixed; /* Mudar para fixed para garantir tela cheia real */
    top: 0;
    left: 0;
    width: 100vw; /* Largura total da viewport */
    height: 100vh; /* Altura total da viewport */
    background: #000;
    z-index: 3000;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Ocultar controles nativos em todos os navegadores */
video::-webkit-media-controls {
    display: none !important;
}
video::-webkit-media-controls-enclosure {
    display: none !important;
}
video::-webkit-media-controls-panel {
    display: none !important;
}
/* Firefox */
video::-moz-media-controls {
    display: none !important;
}
/* IE/Edge */
video::-ms-media-controls {
    display: none !important;
}
/* Outros */
video::media-controls {
    display: none !important;
}

.video-player {
    width: 100%;
    height: 100%;
    max-height: 100vh;
    object-fit: contain;
    z-index: 1;
}

/* Mostrar controles quando tiver a classe active */
.player-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.player-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px;
    opacity: 0;
    pointer-events: none; /* Ignora cliques quando invisível */
    transition: opacity 0.3s;
    z-index: 2147483647; /* Máximo Z-Index para garantir sobreposição em Fullscreen */
}

.player-top {
    display: flex;
    align-items: center;
    gap: 20px;
}

.player-back-btn {
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
}

.player-center {
    display: flex;
    justify-content: center;
    gap: 40px;
    align-items: center;
}

.player-btn {
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    transform: scale(1);
    transition: transform 0.2s;
}

.player-btn:hover {
    transform: scale(1.2);
}

.player-btn .icon {
    font-size: 48px;
}

.player-bottom {
    display: flex;
    align-items: center;
    gap: 15px;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    padding: 20px;
}

#progress-bar {
    flex: 1;
    cursor: pointer;
    accent-color: #E50914; /* Cor padrão moderna */
}

/* Fallback para Webkit (Chrome, Safari) */
#progress-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    background: #E50914;
}

#progress-bar::-webkit-slider-runnable-track {
    color: #E50914;
}

/* Fallback para Firefox */
#progress-bar::-moz-range-thumb {
    background: #E50914;
    border: none;
}

#progress-bar::-moz-range-progress {
    background-color: #E50914;
}

/* Loading */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #141414;
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 5000;
}

.loading-spinner {
    border: 4px solid rgba(255,255,255,0.3);
    border-top: 4px solid #E50914;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Config Page */
.btn-primary {
    background: #E50914;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
}

/* Login Page Styles */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-image: url('../img/background.png'); /* Fallback */
    background-size: cover;
    background-position: center;
    position: relative;
}

.login-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
}

.login-box {
    background: rgba(0,0,0,0.75);
    padding: 60px 68px 40px;
    border-radius: 4px;
    width: 100%;
    max-width: 450px;
    z-index: 10;
}

.login-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 28px;
}

.login-subtitle {
    margin-bottom: 20px;
    color: #ccc;
}

.input-group {
    margin-bottom: 16px;
}

.input-field {
    width: 100%;
    height: 50px;
    background: #333;
    border: none;
    border-radius: 4px;
    color: #fff;
    padding: 16px 20px;
    font-size: 16px;
}

.error-message {
    color: #e87c03;
    font-size: 14px;
    margin-top: 10px;
}

.splash-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    flex-direction: column;
}

.splash-logo {
    max-width: 300px;
    margin-bottom: 20px;
}

/* Mobile Menu Styles */
.mobile-menu-btn {
    display: none;
    font-size: 24px;
    cursor: pointer;
    color: #fff;
    margin-right: 15px;
    transition: color 0.3s;
}

.mobile-menu-btn:hover {
    color: #e50914;
}

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-content {
    background: rgba(20, 20, 20, 0.9);
    backdrop-filter: blur(15px);
    width: 280px;
    height: 100%;
    padding: 20px;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    box-shadow: 4px 0 15px rgba(0,0,0,0.5);
    border-right: 1px solid #333;
}

.mobile-menu-overlay.active .mobile-menu-content {
    transform: translateX(0);
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid #333;
}

.mobile-menu-logo {
    height: 30px;
    object-fit: contain;
}

.close-menu-btn {
    font-size: 24px;
    cursor: pointer;
    color: #aaa;
    transition: color 0.3s;
}

.close-menu-btn:hover {
    color: #fff;
}

.mobile-nav-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-nav-links li {
    margin-bottom: 5px;
}

.mobile-nav-link {
    color: #b3b3b3;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    display: block;
    padding: 12px 15px;
    border-radius: 4px;
    transition: all 0.2s;
}

.mobile-nav-link:hover, .mobile-nav-link.active {
    color: #e50914;
    background: rgba(229, 9, 20, 0.1);
}

.mobile-nav-link .icon {
    margin-right: 15px;
    vertical-align: middle;
    font-size: 20px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }

    .navbar {
        padding: 10px 15px;
        background: rgba(20, 20, 20, 0.9);
        backdrop-filter: blur(10px);
    }
    
    .nav-links {
        display: none;
    }

    .navbar-left {
        gap: 10px;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-description {
        font-size: 1rem;
        display: none;
    }
    
    .content-section {
        /* margin-top removido para evitar sobreposição em telas que não são home */
        padding: 80px 15px 30px; /* Aumentado padding-top para limpar navbar */
    }

    .screen-home .content-section {
        margin-top: -50px; /* Mantém efeito apenas na home */
        padding-top: 20px;
    }
    
    /* Cards Mobile */
    .content-card {
        min-width: 120px;
        max-width: 120px;
        height: 180px;
    }
    
    .content-card-title {
        font-size: 12px;
    }
    
    .modal-content {
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }
    
    .modal-header {
        height: 300px;
    }
    
    /* Player Mobile: Botões maiores */
    .player-btn .icon {
        font-size: 36px;
    }
    
    .player-center {
        gap: 20px;
    }
    
    /* Ajuste para overlay sempre visível ao tocar */
    .content-card-overlay {
        opacity: 1; /* Em mobile, título sempre visível ou nunca */
        background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
        padding: 8px;
    }
}
