/* =========================================================
   PORTFOLIO PESSOAL - ESTILOS PRINCIPAIS
   Disciplina: Fundamentos da Programacao Web - UNINTER
   =========================================================
   Estrutura:
   1. Variaveis de tema (CSS Custom Properties)
   2. Reset e base
   3. Layout geral
   4. Componentes reutilizaveis (botoes, titulos)
   5. Navegacao
   6. Secoes (Sobre, Formacao, Portfolio, Contato)
   7. Rodape e Modal
   8. Responsividade (tablet e mobile)
   ========================================================= */


/* =========================================================
   1. VARIAVEIS DE TEMA
   O atributo data-theme no <html> alterna entre light e dark.
   O JavaScript modifica esse atributo para trocar o tema.
   ========================================================= */
:root {
    /* Cores - tema claro (padrao) */
    --bg-primary:    #ffffff;
    --bg-secondary:  #f8fafc;
    --bg-card:       #ffffff;
    --text-primary:  #1e293b;
    --text-secondary:#64748b;
    --accent:        #2563eb;
    --accent-hover:  #1d4ed8;
    --accent-light:  #eff6ff;
    --border:        #e2e8f0;
    --shadow-sm:     0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md:     0 4px 20px rgba(0, 0, 0, 0.12);
    --nav-bg:        rgba(255, 255, 255, 0.95);
    --error:         #ef4444;

    /* Controla qual icone de tema aparece (sol ou lua) */
    --icon-sun-display:  inline;
    --icon-moon-display: none;
}

/* Variaveis sobrescritas no tema escuro */
[data-theme="dark"] {
    --bg-primary:    #0f172a;
    --bg-secondary:  #1e293b;
    --bg-card:       #1e293b;
    --text-primary:  #f1f5f9;
    --text-secondary:#94a3b8;
    --accent:        #3b82f6;
    --accent-hover:  #60a5fa;
    --accent-light:  #1e3a5f;
    --border:        #334155;
    --shadow-sm:     0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md:     0 4px 20px rgba(0, 0, 0, 0.45);
    --nav-bg:        rgba(15, 23, 42, 0.95);

    --icon-sun-display:  none;
    --icon-moon-display: inline;
}


/* =========================================================
   2. RESET E BASE
   ========================================================= */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    /* Rolagem suave para navegacao por ancora */
    scroll-behavior: smooth;
    /* Espaco para a navbar fixa nao sobrepor o conteudo */
    scroll-padding-top: 70px;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    /* Transicao suave ao trocar tema */
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3 { line-height: 1.3; }
a          { text-decoration: none; color: inherit; }
ul         { list-style: none; }
img        { max-width: 100%; display: block; }


/* =========================================================
   3. LAYOUT GERAL
   ========================================================= */

/* Largura maxima centralizada */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Espacamento padrao das secoes */
.section {
    padding: 5rem 0;
}

/* Secoes com fundo alternado para separacao visual */
.alt-section {
    background-color: var(--bg-secondary);
}

/* Cor de destaque (azul) usada em varios elementos */
.accent {
    color: var(--accent);
}


/* =========================================================
   4. COMPONENTES REUTILIZAVEIS
   ========================================================= */

/* ----- Botoes ----- */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border: 2px solid transparent;
    transition: background-color 0.25s ease,
                border-color 0.25s ease,
                transform 0.2s ease,
                box-shadow 0.2s ease;
}

/* Botao principal: fundo azul */
.btn-primary {
    background-color: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    border-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Botao secundario: contorno azul sem fundo */
.btn-outline {
    background-color: transparent;
    color: var(--accent);
    border-color: var(--accent);
}

.btn-outline:hover {
    background-color: var(--accent);
    color: #ffffff;
}

/* Modificadores de tamanho */
.btn-sm   { padding: 0.4rem 0.9rem; font-size: 0.85rem; }
.btn-full { width: 100%; text-align: center; }

/* ----- Titulos de secao ----- */
.section-title {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 0.5rem;
}

.section-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.05rem;
    margin-bottom: 3rem;
}

.subsection-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
}


/* =========================================================
   5. NAVEGACAO FIXA
   ========================================================= */
#navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: 65px;
    background-color: var(--nav-bg);
    /* Efeito de vidro fosco */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

/* Sombra adicional quando a pagina e rolada (adicionada pelo JS) */
#navbar.scrolled {
    box-shadow: var(--shadow-md);
}

.nav-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Logo / nome clicavel no canto esquerdo */
.nav-logo {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    /* Empurra os outros itens para a direita */
    margin-right: auto;
    letter-spacing: -0.5px;
}

/* Lista de links */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Link individual */
.nav-link {
    padding: 0.5rem 0.9rem;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-secondary);
    transition: color 0.2s, background-color 0.2s;
}

/* Estado hover e link da secao ativa (atualizado pelo JS) */
.nav-link:hover,
.nav-link.active {
    color: var(--accent);
    background-color: var(--accent-light);
}

/* ----- Botao de tema ----- */
.theme-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.4rem 0.65rem;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    transition: background-color 0.2s;
    color: var(--text-primary);
}

.theme-btn:hover {
    background-color: var(--bg-secondary);
}

/* Alterna o icone de acordo com o tema ativo (controlado pelas variaveis CSS) */
.icon-sun  { display: var(--icon-sun-display);  }
.icon-moon { display: var(--icon-moon-display); }

/* ----- Botao hamburguer (mobile) ----- */
/* Oculto no desktop, visivel no mobile (ver media query) */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.3rem;
}

/* Cada linha do icone hamburguer */
.bar {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--text-primary);
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Animacao do hamburguer ao abrir o menu: vira um "X" */
.hamburger.open .bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open .bar:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open .bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }


/* =========================================================
   6. SECOES
   ========================================================= */

/* ----- 6.1 Sobre Mim (Hero) ----- */
.hero-section {
    /* Espaco extra no topo por causa da navbar fixa */
    padding-top: 7rem;
    min-height: 100vh;
    display: flex;
    align-items: center;
}

/* Layout de duas colunas: texto + avatar */
.hero-content {
    display: flex;
    align-items: center;
    gap: 4rem;
}

.hero-text { flex: 1; }

.hero-greeting {
    color: var(--accent);
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.hero-name {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    letter-spacing: -1px;
}

.hero-role {
    font-size: 1.15rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.hero-bio {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
    max-width: 520px;
}

/* Tags de hobbies/interesses */
.hero-hobbies {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.tag {
    background-color: var(--accent-light);
    color: var(--accent);
    padding: 0.35rem 0.85rem;
    border-radius: 100px;
    font-size: 0.88rem;
    font-weight: 500;
    border: 1px solid var(--accent);
}

/* Avatar circular com iniciais, gerado puramente com CSS */
.hero-avatar { flex-shrink: 0; }

.avatar-circle {
    width: 210px;
    height: 210px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #7c3aed);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 32px rgba(37, 99, 235, 0.35);
}

.avatar-initials {
    font-size: 4rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -2px;
    user-select: none;
}

/* ----- 6.2 Formacao ----- */

/* Grade de cards academicos */
.education-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.edu-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
}

.edu-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.edu-icon {
    font-size: 2rem;
    flex-shrink: 0;
    line-height: 1;
    padding-top: 0.1rem;
}

.edu-info h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
}

/* Nome da instituicao em destaque */
.edu-institution {
    color: var(--accent);
    font-weight: 500;
    font-size: 0.88rem;
    margin-bottom: 0.2rem;
}

.edu-period {
    color: var(--text-secondary);
    font-size: 0.82rem;
    margin-bottom: 0.5rem;
}

.edu-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Lista de cursos com marcador */
.course-list {
    list-style: disc;
    padding-left: 1.2rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.course-list li { margin-bottom: 0.3rem; }

/* Cards de idiomas */
.languages { margin-bottom: 2.5rem; }

.lang-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.lang-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.7rem 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: var(--shadow-sm);
}

.lang-name { font-weight: 600; font-size: 0.95rem; }

/* Badge de nivel de idioma com cores semanticas */
.lang-level {
    font-size: 0.78rem;
    padding: 0.2rem 0.65rem;
    border-radius: 100px;
    font-weight: 500;
}

.native       { background: #dcfce7; color: #16a34a; }
.intermediate { background: #dbeafe; color: #1d4ed8; }
.basic        { background: #fef3c7; color: #b45309; }

/* Versao das badges para o tema escuro */
[data-theme="dark"] .native       { background: #14532d; color: #4ade80; }
[data-theme="dark"] .intermediate { background: #1e3a5f; color: #60a5fa; }
[data-theme="dark"] .basic        { background: #431407; color: #fbbf24; }

/* Tags de habilidades tecnicas */
.skills-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.skill-tag {
    background-color: var(--accent-light);
    color: var(--accent);
    border: 1px solid var(--accent);
    padding: 0.4rem 1rem;
    border-radius: 100px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background-color 0.2s, color 0.2s;
    cursor: default;
}

.skill-tag:hover {
    background-color: var(--accent);
    color: #ffffff;
}

/* ----- 6.3 Portfolio ----- */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

/* Card de projeto */
.project-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

/* Cabecalho colorido do card (cor definida inline) */
.project-header {
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.project-icon { font-size: 2.8rem; }

.project-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.project-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.project-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 0.75rem;
    flex: 1;
}

/* Mini-tags das tecnologias usadas no projeto */
.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.ptag {
    background-color: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.78rem;
    font-weight: 500;
}

.project-links { display: flex; gap: 0.5rem; }

/* ----- 6.4 Contato ----- */

/* Layout de duas colunas: info + formulario */
.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 3rem;
    align-items: start;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.contact-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.contact-item strong { display: block; font-weight: 600; margin-bottom: 0.2rem; }
.contact-item p      { color: var(--text-secondary); font-size: 0.95rem; }

/* Formulario */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-group label {
    font-weight: 600;
    font-size: 0.95rem;
}

/* Estilo compartilhado entre input e textarea */
.form-group input,
.form-group textarea {
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    background-color: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    resize: vertical;
}

/* Destaque no campo focado */
.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Estado invalido apos tentativa de envio */
.form-group input.invalid,
.form-group textarea.invalid {
    border-color: var(--error);
}

/* Mensagem de erro abaixo do campo */
.error-msg {
    color: var(--error);
    font-size: 0.83rem;
    min-height: 1.2em;
    display: block;
}


/* =========================================================
   7. RODAPE E MODAL
   ========================================================= */

/* ----- Rodape ----- */
.footer {
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 2rem 0;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ----- Modal de confirmacao de envio ----- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.2s ease;
}

/* O atributo hidden e adicionado/removido pelo JavaScript */
.modal-overlay[hidden] { display: none; }

.modal-box {
    background-color: var(--bg-card);
    border-radius: 16px;
    padding: 2.5rem 2rem;
    text-align: center;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    animation: slideUp 0.3s ease;
}

.modal-icon {
    font-size: 3rem;
    color: #22c55e;
    margin-bottom: 0.75rem;
}

.modal-box h3 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.modal-box p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* Animacoes de entrada do modal */
@keyframes fadeIn  { from { opacity: 0; }               to { opacity: 1; }             }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; }
                     to   { transform: translateY(0);    opacity: 1; }               }


/* =========================================================
   8. RESPONSIVIDADE
   ========================================================= */

/* ----- Tablet: ate 900px ----- */
@media (max-width: 900px) {

    /* Hero: empilha avatar acima do texto */
    .hero-content {
        flex-direction: column-reverse;
        text-align: center;
        gap: 2.5rem;
    }

    .hero-hobbies { justify-content: center; }
    .hero-bio     { max-width: 100%; }

    /* Contato: uma coluna */
    .contact-wrapper {
        grid-template-columns: 1fr;
    }
}

/* ----- Mobile: ate 640px ----- */
@media (max-width: 640px) {

    /* Exibe o botao hamburguer */
    .hamburger { display: flex; }

    /* Menu mobile: dropdown vertical oculto por padrao */
    .nav-menu {
        position: absolute;
        top: 65px;
        left: 0;
        right: 0;
        background-color: var(--nav-bg);
        flex-direction: column;
        align-items: stretch;
        border-bottom: 1px solid var(--border);
        padding: 0 1rem;
        /* Animacao de abertura/fechamento por max-height */
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.35s ease, padding 0.35s ease;
    }

    /* Classe adicionada pelo JS ao clicar no hamburguer */
    .nav-menu.open {
        max-height: 280px;
        padding: 0.75rem 1rem;
    }

    .nav-link {
        display: block;
        padding: 0.7rem 1rem;
        border-radius: 8px;
    }

    /* Ajustes de tipografia */
    .hero-name    { font-size: 2.2rem; }
    .section-title { font-size: 1.65rem; }

    /* Avatar menor */
    .avatar-circle   { width: 150px; height: 150px; }
    .avatar-initials { font-size: 3rem; }

    /* Secoes com menos espaco vertical */
    .section { padding: 3.5rem 0; }

    /* Portfolio em coluna unica */
    .portfolio-grid { grid-template-columns: 1fr; }
}
