/* RESET BÁSICO E CORES GLOBAIS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #0f0f11;
    color: #ffffff;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    /* Adiciona espaço em cima e embaixo para o catálogo não sumir sob as barras */
    padding-top: 100px; 
    padding-bottom: 70px; 
    -webkit-tap-highlight-color: transparent; /* Tira aquele piscar azul feio do clique no celular */
}



/* --- ESTILOS DA CARTEIRA E PLANO --- */
        .badge-plano {
            display: inline-block;
            background: #333;
            color: #aaa;
            padding: 4px 12px;
            border-radius: 12px;
            font-size: 0.8rem;
            font-weight: bold;
            margin-bottom: 15px;
            text-transform: uppercase;
        }
        .badge-plano.premium {
            background: linear-gradient(45deg, #e50914, #ff4444);
            color: white;
            box-shadow: 0 2px 10px rgba(229, 9, 20, 0.4);
        }
        
        .carteira-box {
            background: #151518;
            border: 1px solid #333;
            border-radius: 15px;
            padding: 15px 20px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            width: 90%;
            max-width: 350px;
            margin: 0 auto 25px;
        }
        
        .carteira-info {
            display: flex;
            align-items: center;
            gap: 10px;
            font-size: 1.2rem;
            font-weight: bold;
            color: white;
        }
        
        .add-moeda-btn {
            background: #e50914;
            color: white;
            border: none;
            width: 35px; height: 35px;
            border-radius: 50%;
            font-size: 1.5rem;
            font-weight: bold;
            cursor: pointer;
            display: flex; justify-content: center; align-items: center;
            transition: transform 0.2s;
        }
        .add-moeda-btn:active { transform: scale(0.9); }

        .modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85); /* Fundo preto transparente */
    z-index: 9999; /* Fica por cima de TUDO no site */
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px); /* Dá aquele efeito de desfoque no fundo */
}

/* Ocultador Universal (Usado pelo JavaScript para alternar as abas) */
.hidden {
    display: none !important;
}

/* A Caixa do Modal */
.modal-content {
    background-color: #141414; /* Cinza super escuro, quase preto */
    border: 1px solid #333;
    border-radius: 10px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    position: relative;
    box-shadow: 0px 10px 30px rgba(0, 0, 0, 0.8);
    color: #ffffff;
    font-family: sans-serif;
}

/* Botão de Fechar (X) */
.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: #888;
    font-size: 28px;
    cursor: pointer;
    transition: color 0.2s;
}

.close-btn:hover {
    color: #fff;
}

/* Títulos do Formulário */
.modal-content h2 {
    margin-top: 0;
    margin-bottom: 25px;
    font-size: 24px;
    text-align: center;
    font-weight: 600;
}

/* Inputs (Campos de digitar) */
.modal-content form input {
    width: 100%;
    padding: 14px;
    margin-bottom: 15px;
    background-color: #333;
    border: 1px solid #444;
    border-radius: 5px;
    color: #fff;
    font-size: 16px;
    box-sizing: border-box; /* Garante que o padding não estoure a caixa */
}

.modal-content form input:focus {
    outline: none;
    border-color: #e50914; /* Vermelho pra combinar com o TIKSHORTSDRAMA */
    background-color: #444;
}

/* Botão Principal (Entrar / Criar Conta) */
.btn-principal {
    width: 100%;
    padding: 14px;
    background-color: #e50914; /* Vermelho forte */
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-top: 10px;
}

.btn-principal:hover {
    background-color: #f6121d;
}

/* Texto de alternar entre telas */
.switch-text {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: #aaa;
}

.switch-text a {
    color: #fff;
    text-decoration: none;
    font-weight: bold;
}

.switch-text a:hover {
    text-decoration: underline;
}

/* Mensagem de Erro do Frontend */
.error-msg {
    color: #e50914;
    font-size: 13px;
    display: block;
    margin-top: -10px;
    margin-bottom: 15px;
}

/* --- CABEÇALHO (TOP NAV) --- */
.top-nav {
    display: flex;
    flex-direction: column; /* Empilha a logo e as abas verticalmente */
    align-items: center;    /* Centraliza tudo no meio da tela */
    padding: 20px 0 10px 0;
    background-color: #0a0a0a; /* Fundo escuro premium */
    border-bottom: 1px solid #222;
}

/* O container que segura a imagem e o texto */
.logo-container {
    display: flex;
    flex-direction: column; /* Coloca o texto embaixo da imagem */
    align-items: center;
    margin-bottom: 15px; /* Espaço entre a logo e as abas (Novo, Rankings, etc) */
}

/* A imagem da Logo */
.site-logo {
    width: 300px; /* Mude esse valor para aumentar ou diminuir a sua imagem */
    height: auto;
    margin-bottom: 5px; /* Espacinho entre a imagem e o nome */
}

/* O texto CrystalDramaTV */
.site-name {
    font-size: 22px;
    font-weight: 900;
    color: #e50914; /* O vermelho clássico de streaming */
    text-transform: uppercase;
    letter-spacing: 2px; /* Afasta as letras para dar um ar mais sofisticado */
}

/* Centralizando as abas (Novo, Rankings, Categorias) */
.top-tabs {
    display: flex;
    gap: 25px;
}

.top-tabs a {
    color: #888;
    text-decoration: none;
    font-weight: bold;
    font-size: 14px;
    text-transform: uppercase;
    transition: color 0.3s;
}

.top-tabs a.active, .top-tabs a:hover {
    color: #fff; /* Fica branco quando selecionado ou com mouse em cima */
}

/* --- CATÁLOGO (GRID) --- */
#catalogo {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); /* Grid menor e mais denso para celular */
    gap: 15px;
    padding: 10px 15px;
    max-width: 1200px;
    margin: 0 auto;
}

.card-dorama {
    background-color: #1a1a1f;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
}

.card-dorama a {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}

.card-dorama img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
}

.card-dorama h3 {
    padding: 8px;
    font-size: 0.8rem;
    text-align: center;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- RODAPÉ (BOTTOM NAV) --- */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #111115;
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    border-top: 1px solid #222;
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #666;
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 500;
    gap: 4px;
    transition: color 0.3s;
}

.nav-item .icon {
    font-size: 1.4rem;
    filter: grayscale(100%);
    opacity: 0.6;
}

.nav-item.active {
    color: #e50914;
}

.nav-item.active .icon {
    filter: grayscale(0%);
    opacity: 1;
}

.detalhes-body {
    padding-top: 60px; /* Padding menor porque não tem rodapé nesta página */
    padding-bottom: 30px;
}

/* Ajuste na Top Nav para a página de detalhes */
.detalhes-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
}

.detalhes-nav .logo {
    margin-bottom: 0;
    font-size: 1.2rem;
}

.back-btn {
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    padding: 5px;
}

/* Área de Destaque */
.hero-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px 20px;
    background: linear-gradient(to bottom, #2a080a, #0f0f11);
    border-bottom: 1px solid #222;
}

.hero-section h1 {
    font-size: 1.4rem;
    margin-bottom: 20px;
    text-align: center;
    color: #fff;
    letter-spacing: normal;
}

.play-all-btn {
    background-color: #e50914;
    color: #fff;
    border: none;
    padding: 14px 40px;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    width: 90%;
    max-width: 350px;
    box-shadow: 0 4px 15px rgba(229, 9, 20, 0.4);
    transition: transform 0.2s, background-color 0.2s;
}

.play-all-btn:active {
    transform: scale(0.95);
    background-color: #b20710;
}

/* Lista de Episódios */
.episodes-section {
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
}

.episodes-section h3 {
    margin-bottom: 15px;
    color: #aaa;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.episodes-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.ep-btn {
    display: flex;
    background-color: #1a1a1f;
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    color: white;
    transition: background-color 0.2s;
    border: 1px solid #222;
}

.ep-btn:active {
    background-color: #333;
}

.ep-thumb {
    position: relative;
    width: 140px;
    flex-shrink: 0;
}

.ep-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: 16 / 9;
    display: block;
}

.ep-number {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background-color: rgba(0, 0, 0, 0.85);
    color: #fff;
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: bold;
}

.ep-info {
    padding: 10px 15px;
    display: flex;
    align-items: center;
}

.ep-info h4 {
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.3;
}
/* --- MODAL DE AUTENTICAÇÃO --- */
        /* --- MODAL DE AUTENTICAÇÃO --- */
        
        #auth-modal {
            position: fixed;
            top: 0; left: 0; width: 100vw; height: 100dvh;
            background: rgba(0, 0, 0, 0.85); /* Fundo escurecido */
            backdrop-filter: blur(5px);
            z-index: 10000;
            display: flex;
            justify-content: center;
            align-items: center;
        }

        .auth-box {
            background: #1a1a1f;
            width: 90%;
            max-width: 350px;
            padding: 30px 20px;
            border-radius: 15px;
            border: 1px solid #333;
            text-align: center;
            position: relative;
        }

        .auth-box h2 { font-size: 1.5rem; margin-bottom: 10px; }
        .auth-box p { font-size: 0.9rem; color: #888; margin-bottom: 20px; }

        .auth-box input {
            width: 100%;
            padding: 15px;
            margin-bottom: 15px;
            border-radius: 8px;
            border: 1px solid #444;
            background: #0f0f11;
            color: white;
            font-size: 1rem;
        }

        .auth-box input:focus {
            outline: none;
            border-color: #e50914;
        }
        
        .submit-btn {
            width: 100%;
            background: #e50914;
            color: white;
            border: none;
            padding: 15px;
            border-radius: 8px;
            font-size: 1.1rem;
            font-weight: bold;
            cursor: pointer;
        }

        /* Rodapé Jurídico */
        .site-footer {
            text-align: center;
            padding: 30px 20px 80px 20px; /* O 80px embaixo evita que a barra de navegação cubra o rodapé */
            color: #666;
            font-size: 12px;
        }

        .site-footer a {
            color: #aaa;
            text-decoration: underline;
            margin-top: 10px;
            display: inline-block;
        }

        /* Formatação do Modal de Termos */
        .termos-content {
            max-width: 600px;
        }

        .texto-juridico {
            max-height: 400px;
            overflow-y: auto; /* Cria uma barra de rolagem se o texto ficar grande */
            text-align: left;
            color: #ddd;
            font-size: 14px;
            line-height: 1.6;
            padding-right: 10px;
        }

        .texto-juridico p {
            margin-bottom: 15px;
        }

        .close-btn {
            position: absolute;
            top: 15px; right: 15px;
            background: none; border: none;
            color: #888; font-size: 1.2rem;
            cursor: pointer;
        }
        
        .erro-msg { color: #ff4444; margin-top: 10px; font-size: 0.9rem; min-height: 20px;}