* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: #141414;
    color: #fff;
    overflow-x: hidden;
}

/* Cabeçalho / Navbar */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 4%;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 100;
    transition: background-color 0.3s;
    background: linear-gradient(to bottom, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 100%);
}

header.black-bg {
    background-color: #141414;
}

.logo {
    color: #e50914;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
}

nav a {
    color: #fff;
    text-decoration: none;
    margin-left: 20px;
    font-size: 0.9rem;
    transition: color 0.2s;
}

nav a:hover {
    color: #b3b3b3;
}

/* Seção de Destaque */
.hero {
    height: 80vh;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    padding: 0 4%;
    position: relative;
}

/* Degradê para mesclar a imagem de fundo com o resto do site */
.hero::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 150px;
    background: linear-gradient(to top, #141414 0%, transparent 100%);
}

.hero-content {
    max-width: 600px;
    z-index: 10;
}

.hero-content h2 {
    font-size: 3.5rem;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.6);
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 25px;
    line-height: 1.5;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.6);
}

.btn-play, .btn-info {
    padding: 10px 25px;
    font-size: 1.1rem;
    font-weight: bold;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 15px;
    transition: 0.2s ease;
}

.btn-play { background-color: #fff; color: #000; }
.btn-play:hover { background-color: rgba(255,255,255,0.75); }

.btn-info { background-color: rgba(109,109,110,0.7); color: #fff; }
.btn-info:hover { background-color: rgba(109,109,110,0.4); }

/* Container Principal e Seções de Catálogo */
main {
    margin-top: -50px; /* Sobrepõe levemente o degradê do hero na primeira seção visível */
    position: relative;
    z-index: 10;
}

.media-row {
    padding: 16px 4%;
    scroll-margin-top: 80px; /* Evita que a navbar fixa cubra o título ao navegar pelos links */
}

.media-row h3 {
    margin-bottom: 10px;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.row-subtitle {
    font-size: 0.85rem;
    font-weight: normal;
    color: #b3b3b3;
}

.media-carousel {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding: 15px 0 20px;
    scrollbar-width: none; /* Firefox */
}

.media-carousel::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

/* Cards Horizontais (16:9 - Continue Assistindo, Sugeridos, Minha Lista e Gêneros) */
.media-item {
    position: relative;
    overflow: hidden;
    min-width: 250px;
    height: 140px;
    background-color: #222;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.3s;
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 10px 10px 14px 10px;
}

.media-item:hover {
    transform: scale(1.08);
}

.media-item h4 {
    font-size: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.9);
    background: rgba(0,0,0,0.6);
    padding: 5px 8px;
    border-radius: 3px;
    width: 100%;
    margin-top: auto;
}

/* Cards Verticais (Pôsteres 2:3 - Filmes e Séries) */
.media-item-vertical {
    min-width: 185px;
    height: 275px;
    background-color: #222;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.3s;
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 10px;
}

.media-item-vertical:hover {
    transform: scale(1.06);
}

.media-item-vertical h4 {
    font-size: 0.95rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.9);
    background: rgba(0,0,0,0.65);
    padding: 6px 8px;
    border-radius: 4px;
    width: 100%;
}

.card-badge {
    align-self: flex-start;
    background: rgba(229, 9, 20, 0.9);
    color: #fff;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 3px 7px;
    border-radius: 3px;
    text-transform: uppercase;
}

/* =========================================
   ESTILOS DA PÁGINA DE LOGIN
   ========================================= */
.login-body {
    background: radial-gradient(circle at center, #1f1f1f 0%, #0d0d0d 100%);
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.login-header {
    background: transparent;
    padding: 20px 4%;
    position: static;
}

.login-container {
    background: rgb(0 0 0 / 0.53);
    width: 100%;
    max-width: 450px;
    margin: 0 auto;
    padding: 60px 68px 40px;
    border-radius: 4px;
}

.login-container h2 {
    font-size: 2rem;
    margin-bottom: 28px;
}

.input-group {
    margin-bottom: 16px;
}

.input-group input {
    width: 100%;
    padding: 16px 20px;
    border: none;
    border-radius: 4px;
    background-color: #333;
    color: #fff;
    font-size: 1rem;
}

.input-group input:focus {
    background-color: #444;
    outline: none;
}

.btn-submit {
    width: 100%;
    padding: 16px;
    background-color: #e50914;
    color: white;
    font-weight: bold;
    font-size: 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 24px;
    transition: background-color 0.2s;
}

.btn-submit:hover {
    background-color: #c90812;
}

.form-help {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #b3b3b3;
    margin-top: 15px;
}

.form-help a {
    color: #b3b3b3;
    text-decoration: none;
}

.form-help a:hover {
    text-decoration: underline;
}

.signup-prompt {
    margin-top: 60px;
    color: #737373;
}

.signup-prompt a {
    color: #fff;
    text-decoration: none;
}

.signup-prompt a:hover {
    text-decoration: underline;
}

.signup-prompt small {
    display: block;
    margin-top: 15px;
    font-size: 0.8rem;
}

/* =========================================
   ESTILOS DA PÁGINA DE VÍDEO (WATCH)
   ========================================= */
.watch-main {
    margin-top: 0;
    padding-top: 80px; /* Compensa a navbar fixa */
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.video-player-container {
    width: 100%;
    background-color: #000;
    aspect-ratio: 16/9;
}

.video-player {
    width: 100%;
    height: 100%;
    outline: none;
}

.video-info-container {
    padding: 40px 4%;
}

.video-info-container h2 {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.video-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1rem;
    margin-bottom: 25px;
    color: #bcbcbc;
    font-weight: bold;
}

.video-meta .match {
    color: #46d369; /* Verde estilo Netflix para relevância */
}

.video-meta .rating {
    border: 1px solid #bcbcbc;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.8rem;
    color: #fff;
}

.video-meta .hd {
    border: 1px solid #bcbcbc;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.7rem;
}

.video-details {
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
}

.description {
    flex: 2;
    min-width: 300px;
}

.description p {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 25px;
}

.cast-info {
    flex: 1;
    min-width: 250px;
    font-size: 0.9rem;
    color: #777;
    line-height: 1.6;
}

.cast-info strong {
    color: #bcbcbc;
}

.action-buttons {
    display: flex;
    gap: 15px;
    align-items: center;
}

.btn-round {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.5);
    background-color: rgba(42,42,42,0.6);
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: 0.2s;
}

.btn-round:hover {
    border-color: white;
    background-color: rgba(255,255,255,0.1);
}

.btn-round.active {
    border-color: #46d369;
    background-color: rgba(70, 211, 105, 0.25);
    color: #46d369;
}

/* =========================================
   MENU DO USUÁRIO E AVATAR (INDEX)
   ========================================= */
.nav-links {
    display: flex;
    align-items: center;
}

.user-menu {
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.avatar {
    width: 35px;
    height: 35px;
    border-radius: 4px;
    object-fit: cover;
    transition: transform 0.2s;
}

.user-menu:hover .avatar {
    transform: scale(1.1);
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 50px;
    right: 0;
    background-color: rgba(0, 0, 0, 0.9);
    border: 1px solid #333;
    border-radius: 4px;
    width: 200px;
    flex-direction: column;
    box-shadow: 0px 4px 10px rgba(0,0,0,0.5);
}

.user-menu.active .dropdown-menu {
    display: flex;
}

.dropdown-menu a {
    color: #fff;
    padding: 15px;
    text-decoration: none;
    font-size: 0.9rem;
    border-bottom: 1px solid #222;
    transition: background-color 0.2s;
}

.dropdown-menu a:hover {
    background-color: #333;
}

.dropdown-menu a:last-child {
    border-bottom: none;
    color: #b3b3b3;
}

/* =========================================
   PÁGINA DE CADASTRO E PLANOS
   ========================================= */
body.cadastro-container {
    background: radial-gradient(circle at center, #1f1f1f 0%, #0d0d0d 100%);
}
.btn-login-header {
    color: #fff;
    background-color: #e50914;
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
}

.cadastro-container {
    background-color: rgba(0, 0, 0, 0.85);
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 60px;
    border-radius: 8px;
}

.subtitle {
    color: #b3b3b3;
    margin-bottom: 30px;
}

.planos-title {
    margin: 30px 0 15px;
    font-size: 1.2rem;
}

.planos-grid {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
}

.plano-card {
    flex: 1;
    cursor: pointer;
}

.plano-card input {
    display: none; /* Esconde o radio button nativo */
}

.plano-content {
    background-color: rgba(255, 255, 255, 0.1);
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 20px;
    height: 100%;
    transition: 0.3s;
}

.plano-card input:checked + .plano-content {
    border-color: #e50914;
    background-color: rgba(229, 9, 20, 0.1);
}

.plano-content h4 {
    font-size: 1.3rem;
    margin-bottom: 10px;
}

.plano-content .preco {
    display: block;
    font-weight: bold;
    color: #b3b3b3;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.plano-content ul {
    list-style: none;
    padding: 0;
    color: #fff;
    font-size: 0.9rem;
    line-height: 1.8;
}

.plano-content ul li::before {
    content: "✓ ";
    color: #e50914;
    font-weight: bold;
}

@media (max-width: 768px) {
    .planos-grid {
        flex-direction: column;
    }
}

/* Spinner de Carregamento Assíncrono */
.loading-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}
.loading-overlay.active { display: flex; }
.spinner {
    width: 48px;
    height: 48px;
    border: 5px solid rgba(255, 255, 255, 0.2);
    border-top-color: #e50914;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Notificações Dinâmicas (Toasts) */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.toast {
    padding: 14px 20px;
    border-radius: 4px;
    color: #fff;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(0,0,0,0.6);
    animation: fadeIn 0.2s ease;
}
.toast.sucesso { background-color: #2e7d32; }
.toast.erro { background-color: #c62828; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

/* Modal Editar Perfil / Assinatura */
.modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 500;
    justify-content: center;
    align-items: center;
}
.modal-backdrop.active { display: flex; }
.modal-box {
    background: #1f1f1f;
    padding: 30px;
    border-radius: 8px;
    width: 100%;
    max-width: 440px;
}
.modal-box h3 { margin-bottom: 20px; color: #e50914; }
.modal-box select {
    width: 100%;
    padding: 14px;
    background: #333;
    color: #fff;
    border: none;
    border-radius: 4px;
    margin-bottom: 16px;
}






/* Barra de progresso estilo YouTube na borda inferior do card */
.watch-progress-track {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background-color: rgba(255, 255, 255, 0.25);
}

.watch-progress-bar {
    height: 100%;
    background-color: #e50914;
    transition: width 0.3s ease;
}

.watch-time-badge {
    align-self: flex-end;
    background: rgba(0, 0, 0, 0.78);
    color: #e5e5e5;
    font-size: 0.72rem;
    font-weight: bold;
    padding: 3px 7px;
    border-radius: 3px;
}

/* Garante espaçamento seguro entre a navbar fixa e o título do destaque */
.hero-content {
    padding-top: 70px;
    max-width: 600px;
}

/* Estado padrão: corta o texto na 3ª linha */
#featured-desc {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 8px;
    line-height: 1.45;
}

/* Estado expandido: altura máxima fixa com barra de rolagem interna */
#featured-desc.expanded {
    display: block;
    -webkit-line-clamp: unset;
    max-height: 125px;
    overflow-y: auto;
    padding-right: 8px;
}

/* Barra de rolagem discreta para combinar com o tema escuro */
#featured-desc.expanded::-webkit-scrollbar {
    width: 5px;
}

#featured-desc.expanded::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
}

#featured-desc.expanded::-webkit-scrollbar-thumb {
    background: #e50914;
    border-radius: 4px;
}

/* Botão Ler mais / Ler menos */
.btn-ler-mais {
    background: none;
    border: none;
    color: #e50914;
    font-weight: bold;
    font-size: 0.9rem;
    padding: 0;
    margin-bottom: 16px;
    cursor: pointer;
    text-decoration: underline;
}

.btn-ler-mais:hover {
    color: #ff3b45;
}