/* =========================================================
   RESET E UNIFICAÇÃO
   Gestalt: Unificação (tipografia e cores coerentes em toda a interface)
========================================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

html {
    scrollbar-gutter: stable;
}

.main-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: #1f1f1f; /* A cor de fundo é obrigatória para evitar que os cards se misturem visualmente com o menu ao rolar a página */
}

body {
    background-color: #f8f9fa; /* Branco etéreo */
    color: #1a1a1a; /* Texto escuro para contraste alto */
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* Garante que o footer fique no fim da página */
    transition: zoom 0.25s ease;
}

main {
    flex: 1; /* Faz o conteúdo principal ocupar o espaço livre */
}

#header-placeholder {
    position: sticky;
    top: 0;
    z-index: 1000;
}

.login-page {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 130px);
    padding-top: 3rem;
    padding-bottom: 3rem;
    overflow: hidden;
}

.login-background {
    position: absolute;
    inset: 0;
    background-image: url('../data/img/bgteste1.jpg');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    filter: grayscale(1) brightness(0.72) contrast(1.15);
    z-index: 0;
}

.login-card {
    position: relative;
    z-index: 1;
    width: min(100%, 460px);
    background: rgba(255, 255, 255, 0.88);
    border: 2px solid rgba(26, 26, 26, 0.9);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(2px);
    padding: 2.2rem 2rem;
}

.auth-panel {
    display: none;
}

.auth-panel.is-active {
    display: block;
}

.login-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.9rem;
    margin-bottom: 1rem;
}

.login-logo {
    width: 42px;
    height: 42px;
    object-fit: contain;
}

.login-brand h1 {
    font-size: 1.8rem;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.login-subtitle {
    text-align: center;
    color: #4a4a4a;
    font-size: 0.96rem;
    margin-bottom: 1.5rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 0.95rem;
}

.login-form label {
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #1a1a1a;
}

.login-form input {
    width: 100%;
    padding: 0.9rem 1rem;
    border: 1px solid #d9d9d9;
    background: #f7f7f7;
    color: #1a1a1a;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.login-form input:focus {
    outline: none;
    border-color: #1a1a1a;
    box-shadow: 0 0 0 3px rgba(26, 26, 26, 0.08);
}

.login-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.25rem;
    margin-bottom: 0.5rem;
}

.remember-me {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: normal;
}

.remember-me input {
    width: auto;
    accent-color: #1a1a1a;
}

.login-link {
    color: #1a1a1a;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 700;
}

.login-link:hover {
    text-decoration: underline;
}

.login-btn {
    margin-top: 0.5rem;
    border: none;
    background: #1a1a1a;
    color: #ffffff;
    padding: 0.95rem 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.login-btn:hover {
    transform: translateY(-1px);
    opacity: 0.96;
}

.login-footer {
    margin-top: 1.5rem;
    text-align: center;
    color: #4a4a4a;
    font-size: 0.9rem;
}

.message-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.message-modal.hidden {
    display: none;
}

.message-modal-content {
    position: relative;
    background: #ffffff;
    border: 2px solid #1a1a1a;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.18);
    width: min(90vw, 360px);
    padding: 2rem 1.5rem 1.5rem;
    text-align: center;
}

.message-modal-content h2 {
    margin-bottom: 0.75rem;
    font-size: 1.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.message-modal-content p {
    color: #333333;
    font-size: 1rem;
}

.modal-close {
    position: absolute;
    top: 0.5rem;
    right: 0.7rem;
    border: none;
    background: transparent;
    font-size: 1.6rem;
    cursor: pointer;
    color: #1a1a1a;
}

@media (max-width: 600px) {
    .login-card {
        padding: 1.5rem 1.2rem;
    }

    .login-meta {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* =========================================================
   CABEÇALHO E NAVEGAÇÃO
   Gestalt: Segregação (separado do conteúdo por linha rígida)
========================================================= */
.navbar {
    background-color: #ffffff;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #1a1a1a; /* Linha preta dividindo as áreas */
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.8);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 15px; /* Proximidade entre ícone e texto */
    color: #1a1a1a;
    text-decoration: none;
}

.logofoda {
    height: 3rem; /* Tamanho controlado para o ícone */
}

.logo {
    font-weight: bold;
    font-size: 1.5rem;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.nav-links {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    margin-left: auto;
    justify-content: flex-end;
}

.nav-links a {
    color: #1a1a1a;
    text-decoration: none;
    font-weight: 600;
    letter-spacing: 1px;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: #8c8c8c;
}

/* Lupa */
.lupa {
    background: transparent;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease, filter 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem;
    border-radius: 999px;
}

.lupa:hover,
.lupa:focus-visible {
    transform: scale(1.08);
}

.lupa-icone {
    width: 1.3rem;
    height: 1.3rem;
    display: block;
    object-fit: contain;
}



/* =========================================================
   CONTEÚDO PRINCIPAL (CATÁLOGO)
   Gestalt: Continuidade e Proximidade (Grid direciona o olhar)
========================================================= */
.container {
    padding: 2.5rem;
}

.destaque h1 {
    font-size: 2.2rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
}

.grid-animes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 30px;
    margin-top: 2.5rem;
}

.home-content {
    display: block;
}

.home-content > section {
    margin-bottom: 3rem;
}

.home-content > section h1 {
    margin-bottom: 1rem;
}

.home-grid {
    margin-top: 0;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
}

.card-anime-home {
    min-height: 0;
}

.imagem-futura {
    aspect-ratio: 16 / 9;
    height: auto;
    background-color: #eeeeee;
    border-bottom: 1px solid #e0e0e0;
}

.card-anime-home .card-info {
    padding: 1rem;
}

.card-anime-home .card-info h3 {
    margin: 0;
}

@media (max-width: 900px) {
    .home-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .home-grid {
        grid-template-columns: 1fr;
    }
}

.link-categorias {
    display: inline-block;
    margin-top: 1.5rem;
    color: #1a1a1a;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.abas-categorias {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
    margin-top: 2rem;
}

.aba-categoria {
    border: 1px solid #1a1a1a;
    background: #ffffff;
    color: #1a1a1a;
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    width: 100%;
}

.aba-categoria.ativa,
.aba-categoria:hover {
    background: #1a1a1a;
    color: #ffffff;
}

.categorias-page .grid-animes {
    margin-top: 1.5rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card-anime-categoria {
    min-height: 0;
}

.card-anime-categoria .card-info {
    padding: 1rem;
}

.card-anime-categoria .card-info h3 {
    margin: 0;
}

.card-anime-sem-imagem {
    min-height: 220px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

/* =========================================================
   CARDS DE ANIME (Gerados via JS)
   Gestalt: Unidade e Clausura (Cada card é uma unidade fechada)
========================================================= */
.card-anime {
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 0px; /* Bordas retas, estética fria e afiada */
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

/* Gestalt: Semelhança (Todos reagem igual à interação) */
.card-anime:hover {
    transform: translateY(-5px);
    border-color: #1a1a1a; /* Contraste forte surge no foco */
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.card-anime img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    filter: grayscale(80%); /* Pregnância da Forma: menos ruído visual */
    transition: filter 0.4s;
}

.card-anime:hover img {
    filter: grayscale(0%); /* Revela as cores */
}

.card-info {
    padding: 1.2rem;
    border-top: 1px solid #f0f0f0;
}

.card-info h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: #000000;
    text-transform: uppercase;
}

.card-info p {
    color: #666666;
    font-size: 0.9rem;
}

/* =========================================================
   MODAL DE TRAILER/DETALHES
   Gestalt: Clausura (Foco total no elemento, ignorando o fundo)
========================================================= */
.modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255, 255, 255, 0.85); /* Translúcido claro */
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
    z-index: 1000;
}

.modal.oculto {
    display: none;
}

.modal-conteudo {
    background: #ffffff;
    padding: 3rem;
    border: 3px solid #1a1a1a;
    width: 80%;
    max-width: 650px;
    position: relative;
    box-shadow: 0 20px 50px rgba(0,0,0,0.15);
}

.modal-conteudo h2 {
    margin-bottom: 1rem;
}

.modal-conteudo p {
    line-height: 1.6;
}

.fechar-btn {
    position: absolute;
    top: 15px; right: 20px;
    font-size: 2.5rem;
    cursor: pointer;
    color: #1a1a1a;
    transition: transform 0.2s;
    line-height: 1;
    background: transparent;
    border: 0;
}

.fechar-btn:hover {
    transform: rotate(90deg);
}

@media (max-width: 900px) {
    .categorias-page .grid-animes {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .abas-categorias {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .categorias-page .grid-animes {
        grid-template-columns: 1fr;
    }

    .abas-categorias {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* =========================================================
   RODAPÉ
   Gestalt: Segregação
========================================================= */
.pe {
    background-color: #ffffff;
    border-top: 2px solid #1a1a1a;
    padding: 1.25rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 2px;
    font-size: 0.9rem;
}

.site-credit {
    margin: 0;
    text-align: left;
}

.footer-contact {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.icon-button {
    width: 2.5rem;
    height: 2.5rem;
    border: 1px solid #1a1a1a;
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.2s ease;
}

.icon-button:hover {
    transform: scale(1.05);
}

.icon-button img {
    width: 24px;
    height: 24px;
    display: block;
}

.nomes {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 1px;
    color: #1a1a1a;
}