:root {
    --cor-primaria: #0a68ff;
    --cor-premium: #ffc700;
    --fonte-principal: 'Poppins', sans-serif;
}
html {
    box-sizing: border-box;
}
*, *::before, *::after {
    box-sizing: inherit;
}
@font-face {
    font-family: 'Modern Age';
    src: url('../fonts/Modern-Age.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}
body {
    margin: 0;
    font-family: var(--fonte-principal);
    background-color: #f8f8f8;
    color: #333;
}
main {
    flex: 1;
}
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}
header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 50px;
    background-color: transparent;
}
.header-left, .header-right {
    display: flex;
    align-items: center;
    gap: 25px;
}
header .logo {
    font-family: 'Modern Age', sans-serif;
    font-size: 24px;
    font-weight: bold;
    color: #fff;
    text-decoration: none;
}
nav ul {
    list-style: none;
    display: flex;
    gap: 25px;
    margin: 0;
    padding: 0;
}
nav ul li a {
    color: #fff;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    transition: color 0.3s;
}
nav ul li a:hover {
    color: var(--cor-premium);
}
.premium-link {
    color: var(--cor-premium);
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}
.premium-link .fa-crown {
    color: #ffd95c;
}
.premium-link:hover {
    color: #fff;
    transform: scale(1.05);
}
.login-button {
    padding: 10px 25px;
    border: none;
    background-color: var(--cor-primaria);
    color: #fff;
    cursor: pointer;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}
.login-button:hover {
    background-color: #0058d6;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}
.hero {
    padding: 110px 20px 120px;
    text-align: center;
    background: linear-gradient(135deg, #1d2b4a, #004f4f);
    color: #fff;
    position: relative;
}
.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.hero-content h1 {
    font-size: 2.8em;
    font-weight: 700;
    margin-bottom: 10px;
    max-width: 800px;
}
.hero-content p {
    font-size: 1.2em;
    margin-bottom: 30px;
    color: #cdd5de;
    max-width: 600px;
}
.search-container {
    width: 100%;
    max-width: 700px;
    background-color: #2c3e50;
    border-radius: 36px;
    padding: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}
.search-bar {
    width: 100%;
    background: #fff;
    display: flex;
    align-items: center;
    border-radius: 28px;
    padding: 5px;
}
.search-bar input {
    background: transparent;
    flex: 1;
    border: 0;
    outline: none;
    padding: 15px 25px;
    font-size: 16px;
    color: #333;
}
.search-bar input::placeholder {
    color: #888;
}
.search-bar button {
    border: 0;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    background: var(--cor-primaria);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: background-color 0.3s;
}
.search-bar button:hover {
    background-color: #0058d6;
}
.search-suggestions {
    padding: 20px 25px 15px 25px;
    text-align: left;
    color: #e0e0e0;
}
.suggestion-pills {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}
.search-suggestions span {
    font-weight: 600;
    margin-right: 10px;
    font-size: 14px;
}
.search-suggestions a {
    color: #fff;
    text-decoration: none;
    background-color: rgba(255, 255, 255, 0.1);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 14px;
    transition: background-color 0.3s;
}
.search-suggestions a:hover {
    background-color: rgba(255, 255, 255, 0.2);
}
.category-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 25px;
    width: 90%;
    max-width: 1200px;
    position: absolute;
    bottom: -75px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
}
.category-card {
    background-color: #fff;
    border-radius: 16px;
    padding: 20px;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}
.category-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.15);
}
.category-card .card-icon {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background-color: #f0f2f5;
    margin-bottom: 15px;
}
.category-card p {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin: 0;
}
.downloads-section {
    background-color: #f8f8f8;
    color: #333;
    padding: 120px 20px 80px;
}
.downloads-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #ddd;
    padding-bottom: 10px;
    margin-bottom: 30px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}
.downloads-header h2 {
    font-size: 1.5rem;
    font-weight: bold;
}
.tabs {
    display: flex;
    gap: 10px;
}
.tab {
    background-color: #f0f0f0;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}
.tab.active, .tab:hover {
    background-color: var(--cor-primaria);
    color: #fff;
}
.downloads-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}
.download-card {
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}
.download-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}
.card-image-container {
    position: relative;
    overflow: hidden;
}
.card-image-container img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}
.download-card:hover .card-image-container img {
    transform: scale(1.05);
}
.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s;
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
    padding: 15px;
    gap: 10px;
}
.download-card:hover .card-overlay {
    opacity: 1;
}
.action-btn {
    background-color: rgba(255, 255, 255, 0.9);
    color: #333;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.3s;
    text-decoration: none;
}
.action-btn:hover {
    background-color: #fff;
    transform: scale(1.1);
}
.card-info {
    padding: 20px;
    text-align: left;
}
.card-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0 0 10px 0;
    color: #333;
}
.card-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.card-author {
    font-size: 0.9rem;
    color: #777;
}
.stars {
    color: #ffc700;
    font-size: 1rem;
}
.stars .far {
    color: #ccc;
}
.rating-stars {
    cursor: pointer;
}
.rating-stars:hover i {
    color: var(--cor-premium);
}
.rating-stars i:hover ~ i {
    color: #ccc;
}
footer {
    width: 100%;
    background: linear-gradient(to right, #00093c, #2d0b00);
    color: #fff;
    padding: 50px 0 30px;
    font-size: 13px;
    line-height: 20px;
}
footer .row {
    width: 85%;
    margin: auto;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
}
footer .col {
    flex-basis: 25%;
    padding: 10px;
}
footer .col:nth-child(2), footer .col:nth-child(3) {
    flex-basis: 15%;
}
.footer-logo {
    width: 80px;
    margin-bottom: 20px;
}
footer .col h3 {
    width: fit-content;
    margin-bottom: 40px;
    position: relative;
}
footer ul {
    list-style: none;
    padding: 0;
}
footer ul li {
    margin-bottom: 12px;
}
footer ul li a {
    text-decoration: none;
    color: #fff;
    transition: color 0.3s;
}
footer ul li a:hover {
    color: #ccc;
}
footer form {
    padding-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #ccc;
    margin-bottom: 50px;
}
footer form input {
    width: 100%;
    background: transparent;
    color: #ccc;
    border: 0;
    outline: none;
}
footer form button {
    background: transparent;
    border: 0;
    outline: none;
    cursor: pointer;
}
footer form button .fas {
    font-size: 16px;
    color: #ccc;
}
.social-icons {
    display: flex;
    gap: 15px;
}
.social-icons a {
    text-decoration: none;
    color: #fff;
    font-size: 22px;
    transition: color 0.3s;
}
.social-icons a:hover {
    color: #ccc;
}
footer hr {
    width: 90%;
    border: 0;
    border-bottom: 1px solid #ccc;
    margin: 20px auto;
}
.underline {
    width: 100%;
    height: 5px;
    background: #767676;
    border-radius: 3px;
    position: absolute;
    top: 30px;
    left: 0;
    overflow: hidden;
}
.underline span {
    width: 15px;
    height: 100%;
    background: #fff;
    border-radius: 3px;
    position: absolute;
    top: 0;
    left: 10px;
    animation: moving 2s linear infinite;
}
@keyframes moving {
    0% { left: -20px; }
    100% { left: 100%; }
}
footer .copyright {
    text-align: center;
}
button:focus-visible, a:focus-visible {
    outline: 3px solid #6ab5ff;
    outline-offset: 2px;
    border-radius: 3px;
}
@media (max-width: 1250px) {
    .category-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}
@media (max-width: 850px) {
    header {
        padding: 15px 25px;
    }
    nav {
        display: none;
    }
    .category-grid {
        grid-template-columns: repeat(3, 1fr);
        bottom: -60px;
    }
    footer .col {
        flex-basis: 48%;
        margin-bottom: 30px;
    }
    footer .col:nth-child(1), footer .col:nth-child(4) {
        flex-basis: 100%;
    }
}
@media (max-width: 600px) {
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .hero {
        padding-bottom: 200px;
    }
}
@media (max-width: 480px) {
    header {
        padding: 10px 15px;
    }
    .hero {
        padding-top: 120px;
        padding-bottom: 220px;
    }
    .hero-content h1 {
        font-size: 2.2em;
    }
    .hero-content p {
        font-size: 1.2em;
    }
    .downloads-grid {
        grid-template-columns: 1fr;
    }
    footer .col {
        flex-basis: 100%;
    }
}
/* === ESTILOS PARA BUSCA EXPANSÍVEL === */

/* Esconde as sugestões por padrão com uma animação de saída */
.search-suggestions {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.5s ease-out, opacity 0.5s ease-out, padding 0.5s ease-out;
}

/* Quando o container da busca estiver ativo... */
.search-container.active {
    background-color: #34495e; /* Fundo um pouco mais claro para dar destaque */
    box-shadow: 0 15px 40px rgba(0,0,0,0.4);
}

/* ...as sugestões aparecem com uma animação de entrada */
.search-container.active .search-suggestions {
    max-height: 200px; /* Altura máxima para a animação */
    opacity: 1;
    padding-top: 20px; /* Adiciona o padding que estava faltando */
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin: 15px 0 0 0;
}

/* =========================================
   ESTILOS PARA BUSCA EXPANSÍVEL DA HOME
   ========================================= */

/* Por padrão, as sugestões ficam escondidas */
.search-suggestions {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    padding-top: 0;
    margin-top: 0;
    border-top: 1px solid transparent;
    transition: all 0.4s ease-in-out;
}

/* Quando o container da busca ganhar a classe 'active'... */
.search-container.active {
    background-color: #34495e;
    box-shadow: 0 15px 40px rgba(0,0,0,0.4);
}

/* ...as sugestões aparecem com animação */
.search-container.active .search-suggestions {
    max-height: 200px; /* Altura máxima para a animação */
    opacity: 1;
    padding-top: 20px;
    margin-top: 15px;
    border-top-color: rgba(255, 255, 255, 0.1);
}

/* Estilos para controlar a visão do cabeçalho logado/deslogado */
.logged-in-view {
    display: none; /* Escondido por padrão */
}

/* =========================================
   ESTILOS PARA CABEÇALHO DINÂMICO
   ========================================= */

/* Por padrão, o botão de avatar começa escondido */
.avatar-button {
    display: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: #e9ecef;
    color: var(--cor-primaria);
    font-weight: 600;
    font-size: 18px;
    text-decoration: none;
    display: none; /* Começa escondido */
    place-items: center; /* Centraliza a letra */
}

/* Quando o usuário estiver logado, o body receberá esta classe */
body.user-is-logged-in .login-button {
    display: none; /* Esconde o botão de Entrar */
}
body.user-is-logged-in .avatar-button {
    display: grid; /* Mostra o botão de avatar */
}

/* Se o usuário for premium, o body também receberá esta classe */
body.user-is-premium .premium-link {
    display: none; /* Esconde o botão Premium */
}

/* Estilos para o Menu Dropdown do Avatar */
.avatar-container {
    position: relative;
}

.avatar-menu {
    display: none; /* Começa escondido */
    position: absolute;
    top: 60px; /* Posição abaixo do avatar */
    right: 0;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    width: 200px;
    z-index: 1010;
    border: 1px solid #e9ecef;
    overflow: hidden;
}

.avatar-menu.active {
    display: block; /* Mostra o menu */
}

.avatar-menu a {
    display: block;
    padding: 12px 20px;
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: background-color 0.2s;
}

.avatar-menu a:hover {
    background-color: #f8f9fa;
}

#logout-btn {
    border-top: 1px solid #e9ecef;
    color: #e53935; /* Cor vermelha para 'Sair' */
}