/* ---- NOVO: Estilos do Preloader ---- */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000000;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.75s ease, visibility 0.75s ease;
}
.preloader-content { text-align: center; }
.loading-text { font-family: 'Press Start 2P', cursive; color: #00FF41; font-size: 1.5rem; letter-spacing: 3px; margin-bottom: 1rem; }
.progress-bar-container { width: 300px; height: 25px; border: 2px solid #00FF41; padding: 3px; }
.progress-bar { width: 0%; height: 100%; background-color: #00FF41; animation: fill-progress 2s ease-out forwards; }
@keyframes fill-progress { from { width: 0%; } to { width: 100%; } }
#preloader.hidden { opacity: 0; visibility: hidden; }
body.loading > :not(#preloader) { visibility: hidden; opacity: 0; }

/* ---- VARIÁVEIS E ESTILOS GERAIS ---- */
:root {
    --cor-fundo: #0D0D0D;
    --cor-fundo-secundario: #1A1A1A;
    --cor-texto: #e0e0e0;
    --cor-destaque: #ffffff;
    --cor-primaria: #00aaff;
    --cor-borda: #333;
    --cor-sombra: rgba(0,0,0,0.5);
    --cor-header: rgba(13, 13, 13, 0.8);
    --cor-img-fundo: #222; /* Cor de fundo para as imagens dos projetos */
}
body[data-theme='light'] {
    --cor-fundo: #f4f4f4;
    --cor-fundo-secundario: #ffffff;
    --cor-texto: #212121;
    --cor-destaque: #000000;
    --cor-primaria: #0077cc;
    --cor-borda: #ddd;
    --cor-sombra: rgba(0,0,0,0.1);
    --cor-header: rgba(244, 244, 244, 0.8);
    --cor-img-fundo: #e0e0e0;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    background-color: var(--cor-fundo);
    color: var(--cor-texto);
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    transition: background-color 0.4s ease, color 0.4s ease;
}

#matrix-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    display: block;
}

header, main, footer {
    position: relative;
    z-index: 1;
}

h2 {
    font-family: 'Unbounded', cursive;
    color: var(--cor-destaque);
    font-size: 2rem;
    margin-bottom: 2rem;
    text-align: center;
}
.content-section {
    padding: 5rem 1rem;
    background-color: var(--cor-fundo);
}
.section-container { max-width: 1100px; margin: 0 auto; }

.header {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 0.8rem 1rem;
    background-color: var(--cor-header);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo img {
    max-height: 50px;
    width: auto;
}

.logo .logo-dark {
    display: block;
}
.logo .logo-light {
    display: none;
}
body[data-theme='light'] .logo .logo-dark {
    display: none;
}
body[data-theme='light'] .logo .logo-light {
    display: block;
}


.hamburger { display: block; position: relative; width: 30px; height: 20px; background: none; border: none; cursor: pointer; z-index: 1001; }
.hamburger::before, .hamburger::after { content: ''; position: absolute; width: 100%; height: 3px; background-color: var(--cor-destaque); transition: transform 0.3s ease, top 0.3s ease; }
.hamburger::before { top: 0; }
.hamburger::after { top: 100%; transform: translateY(-100%); }
.hamburger.active::before { top: 50%; transform: translateY(-50%) rotate(45deg); }
.hamburger.active::after { top: 50%; transform: translateY(-50%) rotate(-45deg); }
.nav-menu { position: fixed; top: 0; left: 0; width: 100%; height: 100vh; background-color: var(--cor-fundo); display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 2rem; transform: translateX(100%); transition: transform 0.4s ease-in-out; }
.nav-menu.active { transform: translateX(0); }
.nav-link { color: var(--cor-texto); text-decoration: none; font-size: 1.5rem; font-weight: 600; transition: color 0.3s ease; }
.nav-link:hover { color: var(--cor-primaria); }
.theme-toggle-button { background: none; border: 1px solid var(--cor-borda); color: var(--cor-texto); cursor: pointer; border-radius: 20px; padding: 0.5rem; margin-top: 1rem; }
.theme-toggle-button svg { width: 24px; height: 24px; }
body[data-theme='dark'] .sun-icon { display: none; }
body[data-theme='light'] .moon-icon { display: none; }

.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1rem;
}
.hero-title {
    font-family: 'Unbounded', cursive;
    font-size: 3.5rem;
    color: var(--cor-destaque);
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1;
}
.hero-title span {
    display: inline-block;
}

body[data-theme='light'] .hero-title {
    color: #ffffff;
}

.hero-subtitle { font-size: 1.2rem; color: var(--cor-primaria); margin-bottom: 2rem; }
.hero-button { background-color: var(--cor-primaria); color: #fff; padding: 1rem 2rem; border: none; border-radius: 5px; font-weight: 600; font-size: 1rem; text-decoration: none; cursor: pointer; transition: transform 0.3s ease, box-shadow 0.3s ease; }
.hero-button:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0, 170, 255, 0.2); }

.about-content { display: flex; flex-direction: column; gap: 2rem; align-items: center; }
.about-text p {
    text-align: justify;
    margin-bottom: 1.25rem;
    line-height: 1.8;
}
.about-text p:last-child {
    margin-bottom: 0;
}
.tech-tag {
    background-color: rgba(0, 170, 255, 0.15);
    color: var(--cor-primaria);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid var(--cor-primaria);
}

.about-image img { width: 100%; max-width: 300px; border-radius: 10px; box-shadow: 0 15px 30px var(--cor-sombra); }

.portfolio-grid { display: grid; grid-template-columns: 1fr; gap: 2rem; }
.project-card { background-color: var(--cor-fundo-secundario); border: 1px solid var(--cor-borda); border-radius: 10px; overflow: hidden; box-shadow: 0 5px 15px var(--cor-sombra); transition: all 0.4s ease; }
.project-card:hover { transform: translateY(-10px) scale(1.02); box-shadow: 0 15px 25px var(--cor-sombra); border-color: var(--cor-primaria); }

/* MUDANÇA: Imagem do projeto para não cortar */
.project-card img {
    width: 100%;
    height: 220px;
    object-fit: contain; /* Exibe a imagem completa */
    background-color: var(--cor-img-fundo); /* Cor de fundo para preencher espaços vazios */
    padding: 0.5rem; /* Um pequeno preenchimento para a imagem respirar */
}

.project-info { padding: 1.5rem; text-align: center; }
.project-tags { display: flex; gap: 0.5rem; margin: 1rem 0; justify-content: center; flex-wrap: wrap; }
.project-tags span { background-color: var(--cor-primaria); color: #fff; font-size: 0.8rem; padding: 0.3rem 0.6rem; border-radius: 3px; }

/* MUDANÇA: Estilos para o novo botão "Saiba Mais" */
.project-links {
    margin-top: 1.5rem;
}
.saiba-mais-button {
    display: inline-block;
    background-color: transparent;
    color: var(--cor-primaria);
    border: 2px solid var(--cor-primaria);
    padding: 0.6rem 1.5rem;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}
.saiba-mais-button:hover {
    background-color: var(--cor-primaria);
    color: #fff;
}


.contato-sub { text-align: center; max-width: 600px; margin: -1rem auto 2.5rem auto; }
.contact-buttons {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
    margin-top: 2rem;
}
.contact-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    min-width: 280px;
    text-align: center;
    transition: all 0.3s ease;
}
.contact-button svg {
    width: 24px;
    height: 24px;
}
.contact-button.whatsapp {
    background-color: #25D366;
    color: #fff;
}
.contact-button.email {
    background-color: var(--cor-fundo-secundario);
    color: var(--cor-texto);
    border: 1px solid var(--cor-borda);
}
.contact-button:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.footer {
    text-align: center;
    padding: 2rem 1rem;
    background-color: var(--cor-fundo);
}

@media (min-width: 768px) {
    .content-section { padding: 6rem 2rem; }
    h2 { font-size: 2.5rem; }
    .hero-title {
        font-size: 6rem;
        flex-direction: row;
        gap: 1.5rem;
    }
    .hero-subtitle { font-size: 1.5rem; }
    .hamburger { display: none; }
    .nav-menu { position: static; flex-direction: row; height: auto; width: auto; background-color: transparent; transform: none; gap: 1.5rem; }
    .nav-link { font-size: 1rem; }
    .theme-toggle-button { margin-top: 0; margin-left: 1rem; border: none; }
    .about-content { flex-direction: row; }
    .about-text { flex: 1; }
    .about-image { flex: 1; }
    .portfolio-grid { grid-template-columns: repeat(2, 1fr); }
    .contact-buttons {
        flex-direction: row;
        justify-content: center;
    }
}
