/* ==========================================================================
   PORTFÓLIO PROFISSIONAL - FÁBIO GONÇALVES
   Design System Responsivo - Dark Mode / Fundo Preto Moderno
   ========================================================================== */

/* --- VARIÁVEIS CSS (TEMA ESCURO / PRETO ELEGANTE) --- */
:root {
    --primary: #38bdf8;           /* Azul Ciano Tech vibrante */
    --primary-hover: #0ea5e9;
    --primary-light: rgba(56, 189, 248, 0.12); /* Destaque sutil com transparência */
    --dark-bg: #000000;          /* Preto puro */
    --dark-surface: #0f172a;     /* Slate escuro para cards */
    --card-surface-elevated: #162032; /* Cards internos e inputs */
    --light-bg: #050507;         /* Fundo principal da página (Preto profundo) */
    --card-bg: #0b0f19;          /* Fundo das seções */
    --text-primary: #f8fafc;     /* Títulos (Branco/Slate 50) */
    --text-secondary: #cbd5e1;   /* Textos gerais (Slate 300) */
    --text-muted: #94a3b8;       /* Legendas e detalhes (Slate 400) */
    --border-color: rgba(255, 255, 255, 0.08); /* Bordas sutis */
    --border-hover: rgba(56, 189, 248, 0.4);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.7);
    --shadow-hover: 0 16px 32px rgba(56, 189, 248, 0.15);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- RESET & CONFIGURAÇÃO GLOBAL --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    background-color: var(--light-bg);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-secondary);
    background-color: var(--light-bg);
    overflow-x: hidden;
    width: 100%;
    min-height: 100vh;
}

/* Ajuste para que o header fixo não cubra os títulos ao navegar */
section {
    scroll-margin-top: 85px;
}

/* --- HEADER & NAVEGAÇÃO RESPONSIVA --- */
.header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: rgba(5, 5, 7, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border-color);
    width: 100%;
    transition: var(--transition);
}

.navbar {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #ffffff;
    font-size: 1.25rem;
    font-weight: 500;
    letter-spacing: -0.01em;
}

.logo-symbol {
    color: var(--primary);
    font-family: monospace;
    font-weight: 700;
    font-size: 1.3rem;
}

.logo-text strong {
    color: #DC143C;
    font-weight: 700;
}

.nav-links {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 28px;
}

.nav-links a {
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 6px 4px;
    position: relative;
    transition: color 0.2s ease;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary);
    transition: width 0.25s ease;
}

.nav-links a:hover {
    color: #ffffff;
}

.nav-links a:hover::after {
    width: 100%;
}

/* Botão Hambúrguer (Mobile) */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.menu-toggle .bar {
    width: 100%;
    height: 2.5px;
    background-color: #ffffff;
    border-radius: 4px;
    transition: var(--transition);
}

/* Animação do Hambúrguer para X */
.menu-toggle.is-active .bar:nth-child(1) {
    transform: translateY(8.5px) rotate(45deg);
}

.menu-toggle.is-active .bar:nth-child(2) {
    opacity: 0;
    transform: translateX(-10px);
}

.menu-toggle.is-active .bar:nth-child(3) {
    transform: translateY(-8.5px) rotate(-45deg);
}

/* --- ESTRUTURA GERAL DE SEÇÕES --- */
main {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding: 1.5rem 1rem 3rem;
}

section {
    width: 100%;
    max-width: 1100px;
    margin: 24px auto;
    padding: 3.5rem 2.5rem;
    background-color: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    box-sizing: border-box;
}

.section-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.section-header h2 {
    font-size: clamp(1.6rem, 3.5vw, 2.2rem);
    font-weight: 700;
    color: #DC143C;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.section-header p {
    font-size: 1rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* --- SEÇÃO HERO / SOBRE MIM --- */
.hero {
    text-align: center;
    padding: 4.5rem 2rem;
    background: radial-gradient(circle at 50% 0%, #172554 0%, #0b0f19 75%);
    border: 1px solid rgba(56, 189, 248, 0.15);
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: rgba(56, 189, 248, 0.12);
    color: var(--primary);
    border: 1px solid rgba(56, 189, 248, 0.25);
    padding: 6px 16px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    background-color: #10b981;
    border-radius: 50%;
    position: relative;
}

.status-dot::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 50%;
    background-color: #10b981;
    opacity: 0.6;
    animation: pulse 2s infinite ease-out;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(2.4); opacity: 0; }
}

.hero-title {
    font-size: clamp(2.2rem, 5.5vw, 3.4rem);
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin-bottom: 0.5rem;
}

.hero-subtitle {
    font-size: clamp(1.1rem, 2.8vw, 1.45rem);
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.hero-description {
    font-size: clamp(1rem, 2vw, 1.15rem);
    color: var(--text-secondary);
    max-width: 720px;
    margin: 0 auto 2.5rem;
    line-height: 1.7;
}

.hero-description strong {
    color: #ffffff;
}

.hero-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: var(--transition);
    min-height: 48px;
}

.btn-primary-action {
    background-color: var(--primary);
    color: #0b0f19;
    box-shadow: 0 4px 14px rgba(56, 189, 248, 0.3);
}

.btn-primary-action:hover {
    background-color: #7dd3fc;
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(56, 189, 248, 0.45);
}

.btn-outline-action {
    background-color: rgba(255, 255, 255, 0.04);
    color: #ffffff;
    border: 1.5px solid rgba(255, 255, 255, 0.18);
}

.btn-outline-action:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
    transform: translateY(-2px);
}

/* --- SEÇÃO DE HABILIDADES (GRID) --- */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.skill-card {
    background-color: var(--card-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    text-align: left;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.skill-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: var(--shadow-hover);
}

.skill-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background-color: rgba(56, 189, 248, 0.15);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
    transition: var(--transition);
}

.skill-card:hover .skill-icon {
    background-color: var(--primary);
    color: #0b0f19;
}

.skill-card h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.5rem;
}

.skill-summary {
    font-size: 0.92rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 1.25rem;
    flex-grow: 1;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.skill-tags span {
    background-color: rgba(255, 255, 255, 0.06);
    color: #e2e8f0;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 5px 11px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

/* --- SEÇÃO DE PROJETOS & INTEGRAÇÃO GITHUB --- */
.projetos {
    text-align: center;
}

.projetos-actions {
    display: flex;
    justify-content: center;
    margin-bottom: 2.5rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 13px 26px;
    background-color: var(--primary);
    color: #0b0f19;
    font-size: 0.95rem;
    font-weight: 700;
    text-decoration: none;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    min-height: 48px;
    box-shadow: 0 4px 14px rgba(56, 189, 248, 0.3);
}

.btn:hover {
    background-color: #7dd3fc;
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(56, 189, 248, 0.45);
}

.btn.loading {
    opacity: 0.75;
    cursor: wait;
    pointer-events: none;
}

/* Spinner e Estado de Carregamento */
.loading-state, .sem-projetos {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    gap: 16px;
    color: var(--text-muted);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3.5px solid rgba(255, 255, 255, 0.1);
    border-top: 3.5px solid var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Grid de Projetos */
.card-projetos {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: 24px;
    text-align: left;
    width: 100%;
}

.visualizar-projetos {
    background-color: var(--card-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    overflow: hidden;
    min-height: 350px;
}

.visualizar-projetos:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.card-header {
    padding: 22px 20px;
    color: #ffffff;
    display: flex;
    align-items: center;
    min-height: 85px;
    box-sizing: border-box;
}

.card-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    color: #ffffff;
    word-break: break-word;
    letter-spacing: -0.01em;
}

.card-body {
    padding: 22px 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    justify-content: space-between;
}

.projeto-descricao {
    margin: 0 0 18px 0;
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.projeto-footer {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.tags-projeto {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tags-projeto span {
    background-color: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.btn-repo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    text-align: center;
    background-color: #1e293b;
    color: #ffffff;
    text-decoration: none;
    padding: 11px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.btn-repo:hover {
    background-color: var(--primary);
    color: #0b0f19;
    border-color: var(--primary);
    transform: translateY(-1px);
}

/* --- SEÇÃO DE CONTATO --- */
.contato-section {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.social-links {
    display: flex;
    gap: 14px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 2rem;
    width: 100%;
}

.link-social, .btnMsg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: var(--transition);
    cursor: pointer;
    border: none;
    min-height: 48px;
    box-sizing: border-box;
}

.lnk-whatsapp {
    background-color: #25d366;
    color: #ffffff;
}

.lnk-whatsapp:hover {
    background-color: #128c7e;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(37, 211, 102, 0.4);
}

.lnk-linkedin {
    background-color: #0077b5;
    color: #ffffff;
}

.lnk-linkedin:hover {
    background-color: #005582;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(0, 119, 181, 0.4);
}

.lnk-github {
    background-color: #1e293b;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.lnk-github:hover {
    background-color: #000000;
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
}

.btnMsg {
    background-color: #059669;
    color: #ffffff;
}

.btnMsg:hover {
    background-color: #047857;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(5, 150, 105, 0.4);
}

.btnMsg.btn-cancelar {
    background-color: #dc2626;
}

.btnMsg.btn-cancelar:hover {
    background-color: #b91c1c;
    box-shadow: 0 4px 14px rgba(220, 38, 38, 0.4);
}

/* Formulário de Contato */
.contato {
    width: 100%;
    max-width: 520px;
    background-color: var(--card-surface-elevated);
    padding: 2.25rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    gap: 18px;
    text-align: left;
    box-sizing: border-box;
    transition: var(--transition);
}

.form-header {
    margin-bottom: 0.5rem;
    text-align: center;
}

.form-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 4px;
}

.form-header p {
    font-size: 0.88rem;
    color: var(--text-muted);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.88rem;
    font-weight: 600;
    color: #e2e8f0;
}

.contato input,
.contato textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-sm);
    font-size: 16px; /* 16px previne auto-zoom indesejado no iOS Safari */
    font-family: inherit;
    background-color: #0b0f19;
    color: #ffffff;
    box-sizing: border-box;
    transition: var(--transition);
}

.contato input:focus,
.contato textarea:focus {
    outline: none;
    border-color: var(--primary);
    background-color: #0f172a;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

.contato textarea {
    resize: vertical;
    min-height: 120px;
}

.form-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 4px;
}

.btnEnviar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: var(--primary);
    color: #0b0f19;
    border: none;
    padding: 13px;
    font-size: 1rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    min-height: 48px;
    width: 100%;
}

.btnEnviar:hover {
    background-color: #7dd3fc;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(56, 189, 248, 0.35);
}

.btnWhatsapp {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: #25d366;
    color: #ffffff;
    text-decoration: none;
    padding: 13px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    min-height: 48px;
    box-sizing: border-box;
    width: 100%;
}

.btnWhatsapp:hover {
    background-color: #128c7e;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(37, 211, 102, 0.4);
}

/* Classes para Exibição / Animação do Formulário */
.escondido {
    display: none;
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
}

.mostrar {
    display: flex;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    animation: surgirForm 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes surgirForm {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* --- FOOTER --- */
.footer {
    background-color: #020204;
    color: #94a3b8;
    padding: 2.5rem 1.5rem;
    text-align: center;
    border-top: 1px solid var(--border-color);
    width: 100%;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-content strong {
    color: #ffffff;
}

.footer-sub {
    font-size: 0.85rem;
    color: #64748b;
}

/* ==========================================================================
   MEDIA QUERIES - RESPONSIVIDADE MULTIPLATAFORMA
   ========================================================================== */

/* --- TABLETS E DISPOSITIVOS MÉDIOS (<= 992px) --- */
@media (max-width: 992px) {
    section {
        padding: 3rem 2rem;
    }

    .skills-grid {
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
        gap: 20px;
    }
}

/* --- SMARTPHONES E TELAS MENORES (<= 768px) --- */
@media (max-width: 768px) {
    /* Navegação Mobile com Menu Hambúrguer */
    .menu-toggle {
        display: flex;
    }

    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: rgba(5, 5, 7, 0.98);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
        flex-direction: column;
        align-items: stretch;
        padding: 1.5rem 2rem;
        gap: 8px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        box-shadow: 0 14px 28px rgba(0, 0, 0, 0.7);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
        transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
    }

    .nav-links.active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .nav-links li {
        width: 100%;
    }

    .nav-links a {
        display: block;
        padding: 12px 16px;
        font-size: 1.05rem;
        border-radius: var(--radius-sm);
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .nav-links a::after {
        display: none;
    }

    .nav-links a:hover {
        background-color: rgba(255, 255, 255, 0.06);
        color: var(--primary);
    }

    /* Espaçamentos e Estrutura Geral em Telas Mobile */
    main {
        padding: 1rem 0.75rem 2.5rem;
    }

    section {
        width: 100%;
        margin: 16px auto;
        padding: 2.25rem 1.25rem;
        border-radius: var(--radius-md);
    }

    .section-header {
        margin-bottom: 1.75rem;
    }

    /* Hero Section Mobile */
    .hero {
        padding: 3rem 1.25rem;
    }

    .hero-badge {
        font-size: 0.78rem;
        padding: 5px 12px;
    }

    .hero-actions {
        flex-direction: column;
        width: 100%;
        gap: 12px;
    }

    .btn-action {
        width: 100%;
    }

    /* Cards e Grids Mobile */
    .skills-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .card-projetos {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .visualizar-projetos {
        min-height: auto;
    }

    /* Contato Mobile */
    .social-links {
        flex-direction: column;
        width: 100%;
        gap: 12px;
    }

    .link-social, .btnMsg, .btnWhatsapp {
        width: 100%;
    }

    .contato {
        padding: 1.5rem 1.25rem;
    }
}

/* --- TELAS MUITO PEQUENAS (<= 380px) --- */
@media (max-width: 380px) {
    .navbar {
        padding: 0.85rem 1rem;
    }

    .logo {
        font-size: 1.1rem;
    }

    section {
        padding: 1.75rem 1rem;
    }

    .hero-title {
        font-size: 1.85rem;
    }

    .card-header h3 {
        font-size: 1.1rem;
    }
}
