/* ==========================================================================
   TEMA 2: TERMINAL / IDE (INSPIRADO EM DESENVOLVIMENTO BACKEND)
   ========================================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* Usa fontes de código famosas para títulos e elementos técnicos */
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
    scroll-behavior: smooth;
    font-size: 18px; /* Reduzido ligeiramente a base geral para melhor encaixe em mobile */
}

:root {
    --bg-principal: #1E1E24;      /* Cinza escuro fosco de IDE */
    --bg-secundario: #18181C;     /* Fundo do terminal integrado */
    --bg-card: #25252D;           /* Abas ou blocos de código */
    --texto-principal: #E2E8F0;   /* Texto padrão claro */
    --texto-mutado: #718096;      /* Comentários no código (cinza) */
    --destaque: #F97316;          /* Laranja Dev (Java/IntelliJ style) */
    --sintaxe-string: #A7F3D0;    /* Verde claro para strings e retornos */
    --borda-ide: #2D2D34;
}

body {
    background-color: var(--bg-principal);
    color: var(--texto-principal);
    min-height: 100vh;
}

/* Títulos simulando declaração de funções */
.titulo-secao {
    font-size: 1.75rem;
    font-weight: 500;
    color: #F1F5F9;
}

.titulo-secao::before {
    content: "public void ";
    color: var(--destaque);
}

.titulo-secao span::after {
    content: "() {";
    color: #F1F5F9;
}

/* Header simulando a barra superior da IDE */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 3rem;
    background-color: var(--bg-secundario);
    border-bottom: 2px solid var(--borda-ide);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 100;
}

/* TERMINAL DE BACKEND AMPLIADO */
.terminal-container {
    width: 100%;          
    max-width: 1000px;    
    height: 420px;       
    background-color: #05070F; 
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.terminal-header {
    background-color: #111625;
    padding: 12px 18px; 
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
}

.terminal-button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
    display: inline-block;
}
.terminal-button.close { background-color: #EF4444; }
.terminal-button.minimize { background-color: #F59E0B; }
.terminal-button.maximize { background-color: #10B981; }

.terminal-title {
    position: absolute;
    width: 100%;
    text-align: center;
    left: 0;
    font-family: monospace;
    font-size: 0.8rem;
    color: #64748B;
    pointer-events: none;
}

.terminal-body {
    padding: 20px;       
    flex: 1;
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace; 
    font-size: 0.95rem;  
    line-height: 1.6;    
    overflow-y: auto;
    text-align: left;
}

/* Cores dos logs */
.log-line { margin-bottom: 4px; }
.log-info { color: #10B981; font-weight: bold; } 
.log-warn { color: #F59E0B; font-weight: bold; } 
.log-time { color: #64748B; }                   
.log-msg { color: #E2E8F0; }                    
.log-highlight { color: #6366F1; }              

.logo {
    font-size: 1.1rem;
    font-weight: bold;
}

.logo span {
    color: var(--destaque);
}

nav a {
    color: var(--texto-mutado);
    text-decoration: none;
    margin-left: 1.5rem;
    font-size: 0.9rem;
}

nav a:hover {
    color: var(--sintaxe-string);
}

nav a::before {
    content: "@";
    color: var(--destaque);
    opacity: 0.7;
}

/* Estrutura das Seções */
section {
    padding: 140px 3rem 4rem 3rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-bottom: 1px dashed var(--borda-ide);
}

#home {
    display: flex;
    flex-direction: row;
    gap: 2rem;
    align-items: center;
}

.hero-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}

.hero-left h1 {
    font-size: 2.5rem;
    font-weight: 600;
    color: #FFFFFF;
    margin-bottom: 0.5rem;
}

.hero-left h1::after {
    content: ";";
    color: var(--destaque);
}

.hero-left h2 {
    font-size: 1.35rem;
    color: var(--sintaxe-string);
    font-weight: 400;
    margin-bottom: 2rem;
}

.hero-left h2::before {
    content: "// ";
    color: var(--texto-mutado);
}

.skills-container {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
}

.skill-tag {
    background-color: var(--bg-secundario);
    color: var(--sintaxe-string); 
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    border: 1px solid var(--borda-ide);
}

.btn-cta, .btn-submit {
    background-color: transparent;
    color: var(--destaque);
    border: 1px solid var(--destaque);
    padding: 0.7rem 1.8rem;
    font-size: 0.9rem;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-cta:hover, .btn-submit:hover {
    background-color: rgba(249, 115, 22, 0.1);
    box-shadow: 0 0 10px rgba(249, 115, 22, 0.2);
}

.hero-right {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

/* Seções Adicionais */
#sobre { background-color: var(--bg-secundario); }
.sobre-conteudo { display: flex; gap: 3rem; margin-top: 2rem; align-items: center; }

.sobre-texto { 
    flex: 1.2; 
    font-family: sans-serif; 
}

.sobre-texto p { 
    font-size: 1rem; 
    line-height: 1.7; 
    color: var(--texto-principal); 
    margin-bottom: 1.5rem; 
    max-width: 680px;    
    width: 100%;         
    text-align: justify; 
}

/* CONTAINER DO SLIDER VERTICAL */
.sobre-stats-carousel { 
    flex: 0.8; 
    height: 140px;               
    overflow: hidden;            
    position: relative;
    border-left: 2px dashed var(--borda-ide); 
    padding-left: 2rem;
    width: 100%;
}

.carousel-track {
    display: flex;
    flex-direction: column;
    gap: 0;                      
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1); 
}

.stat-card-custom { 
    background-color: var(--bg-card);
    border: 1px solid var(--borda-ide);
    border-radius: 6px;
    padding: 1.2rem;
    height: 140px;               
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.3rem;
}

.stat-card-custom h3 { 
    color: var(--destaque); 
    font-size: 0.95rem; 
    font-weight: 600;
}

.stat-card-custom p { 
    color: var(--texto-mutado); 
    font-size: 0.85rem;
    line-height: 1.4;
}

/* Grid de Projetos */
.grid-projetos { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); 
    gap: 1.5rem; 
    margin-top: 2rem; 
}

.card-projeto { 
    background-color: var(--bg-card); 
    border: 1px solid var(--borda-ide); 
    border-radius: 6px; 
    padding: 1.8rem; 
    display: flex; 
    flex-direction: column; 
    justify-content: space-between; 
}
.card-projeto:hover { border-color: var(--destaque); }
.projeto-info h3 { font-size: 1.15rem; color: #FFFFFF; }
.projeto-info p { color: var(--texto-mutado); font-size: 0.9rem; font-family: sans-serif; line-height: 1.5; margin-top: 0.5rem; margin-bottom: 1.5rem; }
.projeto-techs { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.tech-tag { font-size: 0.75rem; color: var(--sintaxe-string); background-color: var(--bg-secundario); padding: 0.2rem 0.5rem; border-radius: 4px; }
.projeto-links a { color: var(--destaque); text-decoration: none; font-size: 0.85rem; }

/* Contato */
#contato { 
    background-color: var(--bg-secundario); 
    align-items: center; 
}

.contato-container { 
    width: 100%; 
    max-width: 650px; 
    margin: 0 auto;
}

.contato-descricao {
    color: var(--texto-mutado);
    font-size: 0.95rem;
    margin-bottom: 2rem;
    text-align: left;
}

.canais-contato {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

.canal-card {
    background-color: var(--bg-principal);
    border: 1px solid var(--borda-ide);
    border-radius: 6px;
    padding: 1.1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between; 
    gap: 2rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.canal-card:hover {
    border-color: var(--destaque);
    background-color: rgba(255, 255, 255, 0.01);
    transform: translateX(4px);
}

.canal-esquerda {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.canal-metodo {
    font-size: 0.8rem;
    font-weight: bold;
    padding: 0.3rem 0.7rem;
    border-radius: 4px;
    min-width: 65px;
    text-align: center;
}

.canal-card:nth-child(1) .canal-metodo { background-color: rgba(16, 185, 129, 0.15); color: #10B981; }
.canal-card:nth-child(2) .canal-metodo { background-color: rgba(56, 189, 248, 0.15); color: #38BDF8; }
.canal-card:nth-child(3) .canal-metodo { background-color: rgba(245, 158, 11, 0.15); color: #F59E0B; }

.canal-link {
    color: var(--texto-principal);
    font-size: 0.95rem;
    white-space: nowrap; 
}

.canal-action {
    color: var(--texto-mutado);
    font-size: 0.9rem;
    white-space: nowrap; 
    transition: color 0.2s ease;
}

.canal-card:hover .canal-action {
    color: var(--destaque);
}

/* Rodapé */
footer {
    background-color: var(--bg-secundario);
    border-top: 1px dashed var(--borda-ide); 
    padding: 2.5rem 3rem;                     
    margin-top: auto;
}

.footer-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.footer-left .footer-copyright {
    color: var(--texto-principal);
    font-size: 0.85rem;
    font-family: system-ui, -apple-system, sans-serif; 
}

.footer-center .footer-status {
    color: var(--texto-mutado);
    font-size: 0.8rem;
    font-style: italic;
}

.footer-right {
    display: flex;
    gap: 2rem;
}

.footer-right a {
    color: var(--texto-mutado);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.footer-right a:hover {
    color: var(--destaque);
}

/* ==========================================================================
   ⚠️ SEÇÃO DE ACESSIBILIDADE E RESPONSIVIDADE (MEDIA QUERIES)
   ========================================================================== */

@media (max-width: 968px) {
    * {
        font-size: 16px; /* Ajusta dinamicamente a tipografia para ecrãs médios */
    }

    header {
        padding: 1rem 1.5rem;
    }

    section {
        padding: 100px 1.5rem 4rem 1.5rem; /* Reduz o recuo lateral */
    }

    #home {
        flex-direction: column; /* Empilha a introdução e o terminal */
        gap: 3rem;
        text-align: center;
    }

    .hero-left {
        align-items: center; /* Centraliza os textos e os botões */
    }

    .skills-container {
        justify-content: center;
    }

    .terminal-container {
        height: 360px; /* Reduz ligeiramente a altura para não quebrar a rolagem do mobile */
    }

    .sobre-conteudo {
        flex-direction: column; /* Empilha o texto biográfico e o carrossel */
        gap: 2.5rem;
    }

    .sobre-texto p {
        text-align: left; /* No telemóvel, o alinhamento esquerdo lê-se melhor que o justificado */
        max-width: 100%;
    }

    .sobre-stats-carousel {
        border-left: none;
        border-top: 2px dashed var(--borda-ide); /* Transforma a linha lateral numa divisória superior */
        padding-left: 0;
        padding-top: 1.5rem;
    }
}

@media (max-width: 680px) {
    header {
        flex-direction: column; /* O cabeçalho vira uma pilha limpa */
        gap: 0.8rem;
        padding: 0.8rem 1rem;
    }

    nav a {
        margin: 0 0.5rem;
    }

    section {
        padding-top: 140px; /* Garante que o menu de duas linhas não tape o conteúdo */
    }

    .canal-card {
        flex-direction: column; /* Transforma o Swagger numa lista vertical */
        align-items: flex-start;
        gap: 0.6rem;
        padding: 1rem;
    }

    .canal-esquerda {
        width: 100%;
    }

    .canal-link, .canal-action {
        font-size: 0.85rem;
        white-space: normal; /* Permite a quebra de linha de e-mails longos em ecrãs muito finos */
        word-break: break-all;
    }

    .canal-action {
        align-self: flex-end; /* Alinha o link final à direita inferior no telemóvel */
    }

    .footer-container {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .footer-right {
        justify-content: center;
        gap: 1.5rem;
    }
}