/* =========================================================
   🎨 TEMA CLARO (PADRÃO)
   ========================================================= */
:root {
  --bg-color: #ffffff;
  --text-color: #35373a;
  --link-color: #1a0dab;
  --link-hover-color: #551a8b;
  --footer-bg: #f1f1f1;
  --footer-text: #333;
  --accent-color: #0066cc;
  --header-bg: #f1f1f1;
  --header-text: #333;
  --toggle-filter: none;
}

/* =========================================================
   🌙 TEMA ESCURO
   ========================================================= */
.dark-mode {
  --bg-color: #1d2433;
  --text-color: #a2aabc;
  --link-color: #9ecbff;
  --link-hover-color: #d0e2ff;
  --footer-bg: #111;
  --footer-text: #eee;
  --accent-color: #00aaff;
  --header-bg: #111111e6;
  --header-text: #eee;
  --toggle-filter: #ffffff;
}

/* =========================================================
   🧩 ESTILOS GERAIS
   ========================================================= */
#home {
  padding-top: 10rem;
}

   #home h1 {
  margin-top: 0;
}

#dev p {
  margin-bottom: 50px;
}

#design p {
  margin-bottom: 50px;
}

body {
  font-family: 'Fira Code', monospace;
  margin: 20px;
  padding: 20px;
  line-height: 1.5;
  transition: background-color 0.3s, color 0.3s;
  background-color: var(--bg-color);
  color: var(--text-color);
}

a {
  color: var(--link-color);
  text-decoration: underline;
  transition: color 0.3s;
}

a:hover {
  color: var(--link-hover-color);
}

/* =========================================================
   🖼️ IMAGEM DE PERFIL
   ========================================================= */
#img1 {
  width: 200px;
  height: 200px;
  border-radius: 50%; 
  border: 5px solid var(--text-color);
  object-fit: cover;
}

/* =========================================================
   👤 HEADER / NAVEGAÇÃO
   ========================================================= */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: var(--header-bg);
  backdrop-filter: blur(8px);
  color: var(--footer-text);
  z-index: 1000;
  box-shadow: 0 2px 6px #0000004d;
}

.header-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo a {
  color: var(--footer-text);
  text-decoration: none;
  font-size: 1.5rem;
  font-weight: bold;
  transition: color 0.2s;
}

.logo a:hover {
  color: var(--accent-color);
}

.nav-links {
  display: flex;
  gap: 20px;
}

.nav-links a {
  color: var(--footer-text);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--accent-color);
}

.header-utilities {
  display: flex;
  align-items: center;
  gap: 15px;
}

.hide-on-mobile {
  display: flex;
  align-items: center;
  gap: 30px;
}

@media (max-width: 900px) {
  .hide-on-mobile {
    display: none !important;
  }
}

.hide-on-desktop {
    display: none !important;
}

/* Mostra os elementos no mobile */
@media (max-width: 900px) {
    #hamburger-btn.hide-on-desktop {
        display: flex !important; 
    }
    #mobile-menu.hide-on-desktop {
      display: flex !important;
    }
}

/* ---------------------------------------------------------
   🌓 Botão de alternância de tema
   --------------------------------------------------------- */
#toggle-theme {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 5px;
}

#toggle-theme img {
  filter: var(--toggle-filter);
  transition: transform 0.2s;
}

#toggle-theme:hover img {
  transform: rotate(15deg);
}

/* ---------------------------------------------------------
   📏 Espaçamento do conteúdo (header fixo)
   --------------------------------------------------------- */
body {
  padding-top: 100px; /* ajusta conforme a altura do header */
}

/* ---------------------------------------------------------
   📱 Responsividade do Header
   --------------------------------------------------------- */
@media (max-width: 600px) {
  .header-container {
    flex-direction: column;
    gap: 10px;
    align-items: center;
  }

  .nav-links {
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* =========================================================
   🍔 MENU HAMBÚRGUER (MOBILE)
   ========================================================= */

/* Estilo do botão hambúrguer */
#hamburger-btn {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1002;
    margin-left: auto; /* Empurra para a direita no header */
    align-self: center;
    margin-top: -2px;
}

#hamburger-btn .bar {
    width: 100%;
    height: 3px;
    background-color: var(--header-text);
    border-radius: 1px;
    transition: all 0.3s ease-in-out;
}

/* 🚀 Estilo do Painel Lateral (Off-Canvas) */
#mobile-menu {
    position: fixed;
    top: 0;
    right: 0;
    width: 300px; /* Largura do menu lateral */
    height: 100vh;
    background-color: var(--header-bg); /* Use o fundo do header */
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.2);
    padding: 100px 30px 30px; /* Padding top para não colidir com o header */
    z-index: 1001;
    
    /* Posição inicial: oculto (deslizado para fora da tela) */
    transform: translateX(100%);
    transition: transform 0.4s ease-in-out;
    
    /* Layout interno: Links + Utilitários */
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 30px;
}

#mobile-menu.open {
    transform: translateX(0); /* Visível */
}

/* Reajustar os elementos internos para o layout vertical */
#mobile-menu .nav-links {
    flex-direction: column; /* Links um abaixo do outro */
    gap: 15px;
}

/* ---------------------------------------------------------
   📱 Responsividade para Desktop
   --------------------------------------------------------- */
@media (min-width: 901px) {
    /* No desktop, ocultamos o botão hambúrguer */
    #hamburger-btn {
        display: none !important;
    }

    /* E fazemos com que o menu mobile atue como a navegação desktop normal */
    #mobile-menu {
        position: static;
        height: auto;
        width: auto;
        padding: 0;
        box-shadow: none;
        transform: none;
        transition: none;
        display: flex !important;
        flex-direction: row;
        align-items: center;
        gap: 30px;
    }

    #mobile-menu .social-media {
      display: none;
    }
    
    #mobile-menu .nav-links {
        flex-direction: row;
        gap: 20px;
    }
}

/* ---------------------------------------------------------
   ❌ ANIMAÇÃO PARA FECHAR (CLASSE: is-active)
   --------------------------------------------------------- */

/* Barra do Meio (Desaparece) */
#hamburger-btn.is-active .bar:nth-child(2) {
    opacity: 0;
    /* Move a barra para garantir que desapareça */
    transform: translateX(-30px); 
}

/* Barra de Cima (Rotaciona e Move para o Centro) */
#hamburger-btn.is-active .bar:nth-child(1) {
    /* 🚀 CORREÇÃO: Move para baixo (8px, pois 25px de altura / 2 = 12.5px, e cada barra tem 3px) 
       e rotaciona para formar a parte superior do 'X'. */
    transform: translateY(8px) rotate(45deg); 
}

/* Barra de Baixo (Rotaciona e Move para o Centro) */
#hamburger-btn.is-active .bar:nth-child(3) {
    /* 🚀 CORREÇÃO: Move para cima (8px) e rotaciona para formar a parte inferior do 'X'. */
    transform: translateY(-8px) rotate(-45deg); 
}

/* Bloqueia a rolagem do corpo quando o menu mobile está aberto (precisa da classe 'menu-open' do JS) */
body.menu-open {
    overflow: hidden;
}

/* ---------------------------------------------------------
   ✨ ESTILO DOS LINKS NO MENU MOBILE
   --------------------------------------------------------- */
@media (max-width: 900px){
  #mobile-menu .nav-links {
    display: flex;
    flex-direction: column; 
    gap: 15px;
    width: 100%; 
  }

  #mobile-menu .nav-links a {
    display: block;
    padding: 10px 0;
    width: 100%;
    text-decoration: none;
    text-align: left;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
  }

  #mobile-menu .nav-links {
    font-size: 0;
  }

  #mobile-menu .nav-links a {
    font-size: 1.1rem;
  }
}

/* =========================================================
   🦶 FOOTER
   ========================================================= */
footer {
    width: 100%;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    background-color: var(--footer-bg);
    color: var(--footer-text);
    text-align: center;
    padding: 30px 50px;
    font-size: 0.9rem;
    transition: background-color 0.3s, color 0.3s;
    box-shadow: 0 -4px 6px -6px rgba(0, 0, 0, 0.2);
}

footer hr {
  border: none;
  border-top: 1px solid #ffffff33;
  margin-bottom: 10px;
}

.footer-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 10px 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  text-align: left;
  gap: 40px;
}

.footer-info-col {
  flex: 2;
  max-width: 55%;
  text-align: center;
}

.footer-info-col .social-media {
  justify-content: center;
  margin-top: 10px;
}

.footer-nav-col {
  flex: 1;
  text-align: left;
}

.footer-links-list ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: block;
}

.footer-links li {
  margin-bottom: 8px;
}

.footer-links-list a {
  color: var(--footer-text);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-links-list a:hover {
  color: var(--accent-color);
  text-decoration: underline;
}

.social-media {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 1px;
}

.social-media img {
  opacity: 0.8;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.social-media img:hover {
  transform: scale(1.1);
  opacity: 1;
}

.footer-contacts-group {
  display: flex;
  align-items: center;
  gap: 15px;
}

.footer-contacts-group p {
  margin-bottom: 0;
}

@media (max-width: 768px) {
  .footer-contacts-group {
    flex-direction: column;
    gap: 10px;
  }
}

/* ---------------------------------------------------------
   📱 Responsividade do Footer (Empilha Colunas)
   --------------------------------------------------------- */
@media (max-width: 768px) {
    .footer-container {
        flex-direction: column; /* Empilha as colunas verticalmente */
        align-items: center; /* Centraliza o bloco inteiro */
        text-align: center; /* Centraliza o texto */
        gap: 40px;
    }
    
    .footer-info-col, .footer-nav-col {
        max-width: 100%;
        text-align: center;
        width: 100%;
    }
    
    /* Centraliza a lista de links no mobile */
    .footer-links-list ul {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
}

/* =========================================================
   📜 EFEITOS GERAIS E BARRA DE CIMA DE SCROLL
   ========================================================= */
html, body {
  height: 100%;
  scroll-behavior: smooth;
}

#progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  background: #0078ff;
  width: 0%;
  z-index: 2000;
  transition: width 0.25s ease-out;
}

/* =========================================================
   📂 SEÇÕES E ANIMAÇÕES DE ENTRADA
   ========================================================= */
section {
  padding: 10rem 2rem;
  max-width: 900px;
  margin: 0 auto;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

section.visible {
  opacity: 1;
  transform: translateY(0);
}

.illustration-img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

/* =========================================================
   💼 SEÇÃO DE PROJETOS
   ========================================================= */
#projects {
  background: #f9f9f9;
  padding: 6rem 2rem;
  border-radius: 10px;
}

.section-intro {
  max-width: 600px;
  margin: 0 auto 3rem auto;
  color: #555;
  font-size: 1.1rem;
}

.project-grid {
  display: flex;
  padding: 10px 0;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  scrollbar-width: none; /* Firefox */
  text-overflow: clip;
  -ms-text-overflow: none; /* IE 10+ */
  scroll-behavior: smooth;
}

.project-grid::-webkit-scrollbar {
  display: none;
}

.project-card {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-sizing: border-box;
  box-shadow: 0 4px 10px #00000014;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  max-width: 320px;
  width: 100%;
  flex: 0 0 320px;
  margin-right: 1rem;
}

.project-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 5px 8px #0000001f;
}

.project-info {
  font-size: 16px;
  line-height: 1.6;
  margin: 0 0 20px 0;
}

.project-img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  display: block;
}

.project-info {
  padding: 1rem 1.5rem;
  text-align: center;
}

.project-info h3 {
  margin: 0 0 0.2rem;
  font-size: 1.3rem;
  color: #222;
  text-align: center;
}

.project-info p {
  color: #666;
  font-size: 0.95rem;
  line-height: 1.5;
  white-space: normal;
  word-wrap: break-word;
}

.project-btn {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.7rem 1.3rem;
  background: var(--bg-color);
  color: var(--text-color);
  border: 1px solid var(--text-color);
  box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  backdrop-filter: blur(6px);
  text-align: center;
}

.project-btn:hover {
  background: var(--text-color);
  color: var(--bg-color);
  transform: translateY(-2px);
  box-shadow: 4px 4px 8px rgba(0, 0, 0, 0.3),
              -2px -2px 4px rgba(255, 255, 255, 0.1);
}

.carousel-container {
  position: relative;
  width: 100%;
  margin: 0 auto;
}

.carousel-controls {
  display: flex;
  justify-content: flex-end;
  margin-top: 2rem;
  margin-right: 2rem;
  gap: 10px;
}

/* =========================================================
   ⬇️ BOTÃO DE ROLAR PARA BAIXO
   ========================================================= */
.scroll-down-btn {
    position: absolute; 
    bottom: 10px;
    left: 50%;
    z-index: 9999;
    display: inline-block;
    /* Centraliza o botão horizontalmente */
    transform: translateX(-50%); 
    color: var(--text-color);
    font : normal 400 20px/1 'Fira Code', monospace;
    text-align: center;
    letter-spacing: .1em;
    text-decoration: none;
    transition: opacity .3s;
    padding-top: 60px; 
}

/* Define a cor do círculo, seta e pulsação com base no tema */
.scroll-down-btn span {
    position: absolute; top: 0; left: 50%; width: 46px; height: 46px;
    margin-left: -23px; border: 1px solid var(--text-color); /* Borda com cor do texto */
    border-radius: 100%; box-sizing: border-box;
}

.scroll-down-btn span::after {
    position: absolute; top: 50%; left: 50%; content: '';
    width: 16px; height: 16px; margin: -12px 0 0 -8px;
    border-left: 1px solid var(--text-color); /* Seta com cor do texto */
    border-bottom: 1px solid var(--text-color);
    transform: rotate(-45deg); box-sizing: border-box;
}

.scroll-down-btn span::before {
    position: absolute; top: 0; left: 0; z-index: -1; content: '';
    width: 44px; height: 44px; 
    /* Pulsação e a cor dela */
    box-shadow: 0 0 0 0 var(--text-color); 
    border-radius: 100%; opacity: 0; 
    animation: sdb03 3s infinite; box-sizing: border-box;
}

.scroll-down-btn p {
    margin: 0;
    margin-top: 5px;
    font-size: 14px;
    color: var(--text-color);
}

/* Definição da animação de pulso */
@keyframes sdb03 {
    0% { opacity: 0; }
    30% { opacity: 1; }
    60% { box-shadow: 0 0 0 4px var(--text-color); opacity: 0; } 
    20% { opacity: 1; }
}

/* Inclue os prefixos webkit para melhor compatibilidade em alguns navegadores */
@-webkit-keyframes sdb03 {
    0% { opacity: 0; }
    30% { opacity: 1; }
    60% { -webkit-box-shadow: 0 0 0 4px var(--text-color); opacity: 0; }
    20% { opacity: 1; }
}

/* =========================================================
   ↔️ BOTÕES DE SETA LATERAIS DOS PROJETOS
   ========================================================= */
/* Configuraçoes do botao */
.arrowbtn {
  --btn-size: 30px;
  --btn-arrowsize: 6px;

/* Cores do botão por tema */
  --btn-color: var(--text-color); /* Cor da seta */
  --btn-bg: transparent; /* Fundo transparente */
  --btn-border: var(--text-color); /* Cor da borda */

/* Cores de hover */
  --btn-hover-color: var(--bg-color); /* Cor da seta no hover (contraste do fundo) */
  --btn-bg-hover: var(--text-color); /* Fundo no hover */
  --btn-hover-border-color: var(--text-color); /* Borda no hover */
}

.arrowbtn {
  position: relative;
  width: var(--btn-size);
  height: var(--btn-size);
  background: var(--btn-bg);
  border: 2px solid var(--btn-border);
  border-radius: 50%;
  color: var(--btn-color);
  cursor: pointer;
  line-height: var(--btn-size);
  transition: all 0.25s ease-in-out;
  z-index: 10;
}
  
.arrowbtn:hover {
  background: var(--btn-bg-hover);
  border-color: var(--btn-hover-border-color);
  color: var(--btn-hover-color);
}

.arrowbtn::after {
  position: absolute;
  display: inline-block;
  content: "";
  width: var(--btn-arrowsize);
  height: var(--btn-arrowsize);
  top: 50%;
  left: 50%;
  /* A cor da borda da seta herda de 'color' no .arrowbtn ou .arrowbtn:hover */
}

.arrowbtn-left::after {
  margin-left: calc(-1 * var(--btn-arrowsize) * 0.7); /* Centraliza horizontalmente */
  margin-top: calc(-1 * var(--btn-arrowsize) * 0.5);
  border-top: 2px solid;
  border-left: 2px solid;
  transform: rotateZ(-45deg);
}

/* Botão Direito */

.arrowbtn-right::after {
  margin-left: calc(-1 * var(--btn-arrowsize) * 0.3); /* Centraliza horizontalmente */
  margin-top: calc(-1 * var(--btn-arrowsize) * 0.5);
  border-bottom: 2px solid;
  border-right: 2px solid;
  transform: rotateZ(-45deg);
}

/* Ocultar botões em telas muito pequenas onde eles atrapalhariam a rolagem manual */
@media (max-width: 600px) {
    .arrowbtn {
        display: none;
    }
    .project-grid {
        /* Adicione algum padding extra em telas pequenas para não tocar nas bordas */
        padding: 10px 5px; 
    }
}

/* =========================================================
   📱 Responsividade do Padding da #Home
   ========================================================= */
@media (max-width: 600px) {
    #home {
        padding-top: 15rem; 
    }
}

/* =========================================================
   🌐 SELETOR DE IDIOMAS (DROPDOWN)
   ========================================================= */

/* Contêiner principal para posicionamento */
.language-selector {
    position: relative; /* Essencial para posicionar o dropdown menu */
    display: inline-block;
}

/* Botão que exibe o idioma ativo */
.lang-display-button {
    background: var(--header-bg);
    color: var(--header-text);
    border: 1px solid var(--header-text);
    padding: 6px 10px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    transition: all 0.2s ease-in-out;
    font-size: 0.95rem; 
}

.lang-display-button::after {
  content: '▼';
  font-size: 0.6rem;
  margin-left: 8px;
  transition: transform 0.2s;
  line-height: 1;
}

.lang-dropdown-menu.visible + .lang-display-button::after {
  transform: rotate(180deg);
}

.lang-display-button:hover {
    background: #ffffff1a;
}

/* Estilo para as bandeiras */
#current-lang-flag {
    margin-right: 8px;
    font-size: 1.2rem; /* Tamanho da bandeira/emoji */
}

/* Estilo para a Lista Suspensa */
.lang-dropdown-menu {
    position: absolute;
    top: calc(100% + 5px); /* 5px abaixo do botao */
    right: 0;
    list-style: none;
    padding: 0;
    margin: 0;
    margin-top: 5px;
    background-color: var(--header-bg);
    border: 1px solid var(--text-color);
    border-color: #ffffff33;
    border-radius: 10px;
    min-width: 150px;
    z-index: 1001;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transform: translate(-5px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
}

.lang-dropdown-menu.visible {
    opacity: 1;
    visibility: visible;
    transform: translate(0);
}

.lang-dropdown-menu li {
    padding: 8px 15px;
    cursor: pointer;
    color: var(--text-color);
    transition: background-color 0.2s;
    font-weight: 400;
}

.lang-dropdown-menu li:hover {
    background-color: var(--accent-color);
    color: var(--bg-color); /* Texto no hover */
}

/* Remove a borda arredondada superior no primeiro item e inferior no último */
.lang-dropdown-menu li:first-child {
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
}
.lang-dropdown-menu li:last-child {
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
}