/* ========================================================================== */
/* Variáveis da Nova Estética: Earthy / Brown Glassmorphism                   */
/* ========================================================================== */

/* Trava TODAS as transições e animações durante o carregamento inicial da página */
.preload, .preload * {
    transition: none !important;
}

:root {
    /* Paleta Terrosa / Café (DARK MODE - Padrão) */
    --bg-primary: #181412;    /* Fundo principal: Marrom quase preto */
    --bg-secondary: #231d1a;  /* Fundo dos cartões: Marrom escuro leve */
    --border-color: #362d29;  /* Bordas sutis */
    
    --accent-primary: #c4794f; /* Caramelo / Terracota */
    --accent-hover: #e09468;
    
    --text-primary: #e6dfd9;   /* Bege super claro (não branco puro) */
    --text-secondary: #9e948f; /* Bege escurecido para textos longos */
    
    --nav-glass-bg: rgba(24, 20, 18, 0.4); /* Fundo da nav scrollada */

    /* Fontes */
    --font-primary: 'Playfair Display', serif; /* Títulos elegantes */
    --font-secondary: 'Inter', sans-serif;      /* Textos limpos e legíveis */
    
    --border-radius: 16px;
    --transition: all 0.3s ease;
}

/* ========================================================================== */
/* TEMA CLARO (LIGHT MODE) - Ativado dinamicamente via JS                     */
/* ========================================================================== */
[data-theme="light"] {
    --bg-primary: #faf8f5;    /* Fundo bege bem claro */
    --bg-secondary: #ffffff;  /* Fundo dos cartões branco puro */
    --border-color: #e5dfd9;  /* Bordas sutis bege escuro */
    
    --accent-primary: #b35b2d; /* Terracota mais vibrante para contraste no claro */
    --accent-hover: #c4794f;
    
    --text-primary: #2d2420;   /* Marrom bem escuro (quase preto) para títulos */
    --text-secondary: #5e514a; /* Marrom acinzentado para textos */
    
    --nav-glass-bg: rgba(250, 248, 245, 0.4); /* Fundo da nav scrollada no claro */
}

/* Transição suave para o body e textos quando muda de tema */
body {
    font-family: var(--font-secondary);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
    line-height: 1.6;
    transition: background-color 0.4s ease, color 0.4s ease;
}

/* ========================================================================== */
/* Navbar Transparente Flutuante                                              */
/* ========================================================================== */

.glass-nav {
    background: transparent;
    padding: 1.5rem 0;
    transition: var(--transition), background-color 0.4s ease;
}

/* Classe aplicada via JS quando dá scroll */
.glass-nav.scrolled {
    background: var(--nav-glass-bg) !important;
    backdrop-filter: blur(12px);
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-family: var(--font-primary);
    font-size: 1.8rem;
    font-weight: 900;
    letter-spacing: 2px;
    color: var(--accent-primary) !important; 
    transition: color 0.3s ease, text-shadow 0.3s ease; 
}

.navbar-brand:hover {
    color: var(--text-primary) !important;
}

.custom-link {
    color: var(--text-primary) !important;
    font-weight: 500;
    font-size: 0.9rem;
    margin-left: 1.5rem;
    position: relative;
    transition: var(--transition);
}

.custom-link:hover, .custom-link.active {
    color: var(--accent-primary) !important;
}

/* Linha sutil embaixo do link ativo */
.custom-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background-color: var(--accent-primary);
    transition: width 0.3s ease;
}
.custom-link:hover::after, .custom-link.active::after {
    width: 100%;
}

.navbar-toggler {
    border: none;
    padding: 0;
}
.navbar-toggler:focus {
    box-shadow: none;
}
.hamburger-icon {
    width: 24px;
    height: 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.hamburger-icon .line {
    display: block;
    height: 2px;
    width: 100%;
    background-color: var(--text-primary);
    transition: var(--transition);
}
.navbar-toggler:not(.collapsed) .line:nth-child(1) { 
    transform: translateY(8px) rotate(45deg); 
    background-color: var(--accent-primary);
}
.navbar-toggler:not(.collapsed) .line:nth-child(2) { 
    opacity: 0; 
}
.navbar-toggler:not(.collapsed) .line:nth-child(3) { 
    transform: translateY(-8px) rotate(-45deg); 
    background-color: var(--accent-primary);
}


/* ========================================================================== */
/* Hero Section e Foto Quadrada Flutuante                                     */
/* ========================================================================== */

.hero-section {
    padding: 8rem 0 4rem;
}

.main-title {
    font-family: var(--font-primary);
    font-size: 5rem;
    line-height: 1.1;
    color: var(--text-primary);
    margin-bottom: 1rem;
    transition: color 0.4s ease;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    font-weight: 300;
    transition: color 0.4s ease;
}

.accent-text, .cursor-accent {
    color: var(--accent-primary);
}

.cursor-accent {
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* FOTO QUADRADA COM MOLDURA DESLOCADA */
.profile-container {
    width: 320px;
    height: 320px;
    margin: 0 auto;
    position: relative;
}

.profile-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 20px; /* Quadrado arredondado elegante */
    position: relative;
    z-index: 2;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3); /* Sombra mais leve para caber no dark e light */
}

.profile-container::before {
    content: '';
    position: absolute;
    top: 20px;
    left: -20px;
    width: 100%;
    height: 100%;
    border: 2px solid var(--accent-primary);
    border-radius: 20px;
    z-index: 1;
    transition: var(--transition);
}

.profile-container:hover::before {
    top: 10px;
    left: -10px;
}

/* ========================================================================== */
/* Cartões Flutuantes (Separados)                                             */
/* ========================================================================== */

.section-title {
    font-family: var(--font-primary);
    font-size: 2.8rem;
    color: var(--text-primary);
    transition: color 0.4s ease;
}

.floating-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08); /* Sombra suavizada para tema claro também */
    transition: background-color 0.4s ease, border-color 0.4s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.floating-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    border-color: var(--accent-primary);
}

.text-content p {
    margin-bottom: 1.2rem;
    color: var(--text-secondary);
    font-size: 1.05rem;
    transition: color 0.4s ease;
}

.highlight {
    color: var(--text-primary);
    font-weight: 600;
}

.intro-highlight {
    font-family: var(--font-primary);
    font-size: 1.3rem;
    color: var(--accent-primary) !important;
    font-style: italic;
    border-left: 3px solid var(--accent-primary);
    padding-left: 1rem;
}

.accent-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    background-color: var(--accent-primary);
    border-radius: 50%;
    margin-right: 8px;
    vertical-align: middle;
}

/* ========================================================================== */
/* Tecnologias & Chips                                                        */
/* ========================================================================== */

.skill-chip {
    display: flex;
    align-items: center;
    background: var(--bg-primary); /* Ajustado para acompanhar a variável */
    border: 1px solid var(--border-color);
    padding: 12px 20px;
    border-radius: 30px;
    transition: var(--transition), background-color 0.4s ease, border-color 0.4s ease;
}

.skill-chip:hover {
    background: rgba(196, 121, 79, 0.1);
    border-color: var(--accent-primary);
    transform: translateY(-3px);
}

.skill-icon {
    width: 22px;
    height: 22px;
    margin-right: 10px;
    font-size: 1.3rem;
}

/* Seletor dinâmico para ícones brancos (ex: AWS) que precisam ficar pretos no light mode */
[data-theme="light"] .white-icon {
    filter: invert(0) brightness(0) opacity(0.8) !important; /* Força o ícone a ficar escuro */
}
.white-icon {
    filter: invert(1) brightness(2) opacity(0.8);
}

.skill-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 1px;
    transition: color 0.4s ease;
}

/* ========================================================================== */
/* Lista de Certificados                                                      */
/* ========================================================================== */

.cert-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1.2rem;
    margin-bottom: 1.2rem;
    border-bottom: 1px solid var(--border-color);
    transition: border-color 0.4s ease;
}

.cert-info h4 {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 0.2rem;
    font-weight: 600;
    transition: color 0.4s ease;
}

.cert-school {
    font-size: 0.85rem;
    color: var(--accent-primary);
}

/* ========================================================================== */
/* Projetos                                                                   */
/* ========================================================================== */

.project-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    transition: background-color 0.4s ease, border-color 0.4s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    border-color: var(--accent-primary);
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.project-title {
    font-family: var(--font-primary);
    font-size: 1.4rem;
    color: var(--text-primary);
    margin: 0;
    transition: color 0.4s ease;
}

.project-status {
    background: rgba(196, 121, 79, 0.1);
    color: var(--accent-primary);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}
.project-status.in-progress {
    background: var(--border-color); /* Fundo sutil acompanhando a variável */
    color: var(--text-secondary);
}

.project-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 2rem;
    transition: color 0.4s ease;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 2rem;
}

.tech-tag {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    font-size: 0.75rem;
    transition: color 0.4s ease, border-color 0.4s ease;
}

/* ========================================================================== */
/* Botões Modernos                                                            */
/* ========================================================================== */

.btn-action {
    display: inline-block;
    background: var(--accent-primary);
    color: #fff;
    border: 1px solid var(--accent-primary);
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: var(--transition);
}

.btn-action:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: #fff;
    transform: translateY(-2px);
}

.btn-action-outline {
    display: inline-block;
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: var(--transition);
}

.btn-action-outline:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.btn-action-disabled {
    display: inline-block;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: not-allowed;
    opacity: 0.6;
}

/* ========================================================================== */
/* Modais Customizados                                                        */
/* ========================================================================== */

.custom-modal .modal-content {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
    transition: background-color 0.4s ease, border-color 0.4s ease;
}
.custom-modal .modal-title {
    font-size: 1.5rem;
}
.custom-modal .modal-body p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    transition: color 0.4s ease;
}
/* Força o ícone de fechar a ser escuro no modo claro */
[data-theme="light"] .btn-close-white {
    filter: invert(1) grayscale(100%) brightness(0);
}

/* Ajustes no formulário de contato para suportar Light Mode */
.form-control {
    background-color: var(--bg-primary) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
    transition: background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease;
}
.form-control:focus {
    border-color: var(--accent-primary) !important;
    box-shadow: 0 0 0 0.25rem rgba(196, 121, 79, 0.25) !important;
}
.custom-placeholder::placeholder {
    color: var(--text-secondary) !important;
    opacity: 0.6 !important;
}

/* ========================================================================== */
/* Elementos Extras (Footer, Scroll, Utils)                                   */
/* ========================================================================== */

.footer {
    border-top: 1px solid var(--border-color);
    background: var(--bg-primary);
    transition: background-color 0.4s ease, border-color 0.4s ease;
}
.footer-text {
    color: var(--text-secondary);
    transition: color 0.4s ease;
}

.btn-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
    z-index: 999;
}
.btn-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.btn-top:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #fff;
}

/* ========================================================================== */
/* Ocultar Barra de Rolagem (Clean App UI)                                    */
/* ========================================================================== */

/* Oculta no Chrome, Safari e Opera */
::-webkit-scrollbar {
    display: none;
    width: 0;
    background: transparent;
}

/* Oculta no Firefox, IE e Edge */
* {
    scrollbar-width: none; 
    -ms-overflow-style: none; 
}

/* Animação Fade-in */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease-out;
}
.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Setas de scroll (Hero) */
.scroll-indicator { 
    animation: bounce 2s infinite; 
}
.scroll-arrow {
    width: 2px; height: 40px;
    background: linear-gradient(to bottom, transparent, var(--accent-primary));
}
.scroll-text { 
    color: var(--text-secondary); 
    font-size: 0.75rem; letter-spacing: 3px;
    transition: color 0.4s ease;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(10px); }
}

/* ========================================================================== */
/* Media Queries                                                              */
/* ========================================================================== */

@media (max-width: 991.98px) {
    .main-title { 
        font-size: 4rem; 
    }
    .section-title { 
        font-size: 2.2rem; 
    }
    .glass-nav { 
        background: var(--bg-secondary) !important; 
        padding: 1rem 0; 
    }
    .custom-link { 
        margin-left: 0; 
        padding: 1rem 0; 
        border-bottom: 1px solid var(--border-color); 
    }
    .custom-link::after { 
        display: none; 
    }
}

@media (max-width: 767.98px) {
    .hero-section { 
        padding: 6rem 0 3rem; 
        text-align: center; 
    }
    .main-title { 
        font-size: 3.5rem; 
    }
    .profile-container { 
        width: 250px; 
        height: 250px; 
    }
    .floating-card { 
        padding: 1.5rem !important; 
    }
    .cert-line { 
        flex-direction: column; 
        align-items: flex-start; 
        gap: 1rem;
    }
    /* BLINDAGEM DO BOTÃO TOPO NO MOBILE */
    .btn-top {
        position: fixed !important;  /* Força a fixação na câmera, não no documento */
        top: auto !important;        /* Mata qualquer cálculo errado de topo */
        bottom: 20px !important;     /* Trava no fundo (longe da barra do navegador) */
        right: 20px !important;      /* Trava na direita */
        width: 45px !important;
        height: 45px !important;
        z-index: 999999 !important;  /* Fica acima de TUDO */
        transform: none !important;  /* Desativa movimentos no eixo Y que causam o bug */
    }

    /* Como tiramos o transform, controlamos a aparição apenas pelo fade (opacidade) */
    .btn-top:not(.show) {
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }

    .btn-top.show {
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
    }
}

@media (max-width: 480px) {
    .main-title { 
        font-size: 2.8rem; 
    }
    .profile-container { 
        width: 220px; 
        height: 220px; 
    }
    .skill-chip { 
        width: 100%; 
        justify-content: center; 
    }
    .project-links { 
        flex-direction: column; 
    }
}