/* FONTES E CONFIGURAÇÕES GLOBAIS */
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap");

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* VARIÁVEIS DE COR (TEMAS) */
:root {
  --bg-color: #f0f8ff;
  --primary-text-color: #0b1c3d;
  --secondary-text-color: #3a507e;
  --accent-color: #0077ff;
  --sidebar-bg-color: #ffffff;
  --sidebar-icon-color: #3a507e;
  --sidebar-hover-color: #e6f2ff;
  --card-bg-color: #ffffff;
  --box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  --cursor-color: rgba(0, 119, 255, 0.6);
  --bg-animated-1: #e0f7fa;
  --bg-animated-2: #b3e5fc;
  --bg-animated-3: #81d4fa;
}
body.dark-mode {
  --bg-color: #0d1b2a;
  --primary-text-color: #e0e1dd;
  --secondary-text-color: #a9b3c4;
  --accent-color: #4895ef;
  --sidebar-bg-color: #1b263b;
  --sidebar-icon-color: #a9b3c4;
  --sidebar-hover-color: #415a77;
  --card-bg-color: #1b263b;
  --box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  --cursor-color: rgba(72, 149, 239, 0.6);
  --bg-animated-1: #1b263b;
  --bg-animated-2: #0d1b2a;
  --bg-animated-3: #415a77;
}

html {
  scroll-behavior: smooth;
}
body {
  font-family: "Poppins", sans-serif;
  background-color: var(--bg-color);
  color: var(--primary-text-color);
  display: flex;
  transition: background-color 0.3s, color 0.3s;
  overflow-x: hidden;
  position: relative;
}
body.no-scroll {
  overflow: hidden;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: linear-gradient(
    45deg,
    var(--bg-animated-1),
    var(--bg-animated-2),
    var(--bg-animated-3)
  );
  background-size: 400% 400%;
  animation: gradientAnimation 15s ease infinite;
  transition: background 0.5s ease;
}
@keyframes gradientAnimation {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

main {
  flex-grow: 1;
  padding-left: 90px;
}
section {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 80px 20px;
  border-bottom: 1px solid var(--sidebar-hover-color);
}
.content {
  max-width: 900px;
  text-align: center;
  width: 100%;
}
h1,
h2,
h3 {
  color: var(--primary-text-color);
}
h1 {
  font-size: 3.5rem;
  font-weight: 700;
  min-height: 1.2em;
}
h2 {
  font-size: 2.5rem;
  margin-bottom: 2rem;
  position: relative;
}
h2::after {
  content: "";
  display: block;
  width: 60px;
  height: 4px;
  background-color: var(--accent-color);
  margin: 10px auto;
  border-radius: 2px;
}
p {
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--secondary-text-color);
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 90px;
  background-color: var(--sidebar-bg-color);
  box-shadow: var(--box-shadow);
  padding: 20px 0;
  transition: width 0.4s ease;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.sidebar:hover {
  width: 280px;
}
.nav-links {
  list-style: none;
  width: 100%;
  padding: 0;
  margin: 0;
}
.nav-links li {
  display: flex;
}
.nav-link {
  display: flex;
  align-items: center;
  color: var(--sidebar-icon-color);
  text-decoration: none;
  padding: 20px 30px;
  width: 100%;
  height: 65px;
  white-space: nowrap;
  position: relative;
  transition: color 0.3s;
  background: none;
  border: none;
  cursor: pointer;
  font-family: "Poppins", sans-serif;
  overflow: hidden;
}
.nav-links li:hover,
#theme-toggle-btn:hover {
  background-color: var(--sidebar-hover-color);
}
.nav-links li:hover .nav-link,
#theme-toggle-btn:hover {
  color: var(--primary-text-color);
}
.nav-link .icon {
  font-size: 1.8rem;
  font-weight: 700;
  min-width: 30px;
  text-align: center;
  transition: width 0.3s ease, opacity 0.2s ease, margin-right 0.3s ease;
}
.nav-link .text {
  font-size: 1.1rem;
  font-weight: 500;
  opacity: 0;
  width: 0;
  overflow: hidden;
  transition: width 0.3s ease, opacity 0.3s ease;
}
.sidebar:hover .nav-link .icon {
  width: 0;
  opacity: 0;
}
.sidebar:hover .nav-link .text {
  opacity: 1;
  width: auto;
  font-size: 1.8rem;
  font-weight: 700;
}
.nav-link::after {
  content: "";
  position: absolute;
  bottom: 10px;
  left: 30px;
  width: 0;
  height: 3px;
  background-color: var(--accent-color);
  border-radius: 2px;
  transition: width 0.4s ease;
}
.nav-link.active {
  color: var(--primary-text-color);
}
.nav-link.active::after {
  width: 30px;
}
.sidebar:hover .nav-link.active::after {
  width: calc(100% - 60px);
}

#home .home-content {
  display: flex;
  align-items: center;
  justify-content: space-around;
  width: 100%;
  max-width: 1100px;
  flex-wrap: wrap;
  gap: 2rem;
}
#home .home-text {
  flex-basis: 50%;
  min-width: 300px;
  text-align: left;
}
.blob-container {
  flex-basis: 40%;
  display: flex;
  justify-content: center;
  align-items: center;
}
.blob {
  width: 350px;
  height: 350px;
  background-size: cover;
  background-position: center;
  border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
  box-shadow: var(--box-shadow);
  animation: morph 8s ease-in-out infinite, float 6s ease-in-out infinite;
}
@keyframes morph {
  0% {
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
  }
  50% {
    border-radius: 60% 40% 30% 70% / 60% 70% 30% 40%;
  }
  100% {
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
  }
}
@keyframes float {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-25px);
  }
  100% {
    transform: translateY(0);
  }
}
.typing-cursor {
  color: var(--accent-color);
  animation: blink 0.7s infinite;
}
@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}
.home-buttons {
  margin-top: 2rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.btn-service {
  background-color: transparent;
  color: var(--accent-color);
  border: 2px solid var(--accent-color);
  padding: 12px 25px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
}
.btn-service:hover {
  background-color: var(--accent-color);
  color: var(--sidebar-bg-color);
  transform: translateY(-5px);
}
.highlight-frontend {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--accent-color);
  display: block;
  margin-top: 10px;
  text-shadow: 0 0 5px rgba(0, 119, 255, 0.3);
  transition: color 0.3s, text-shadow 0.3s;
}
body.dark-mode .highlight-frontend {
  text-shadow: 0 0 5px rgba(72, 149, 239, 0.3);
}

.custom-cursor {
  display: none;
}
@media (pointer: fine) {
  body {
    cursor: none;
  }
  .custom-cursor {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 25px;
    height: 25px;
    background-color: var(--cursor-color);
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 9999;
    transition: width 0.2s ease-out, height 0.2s ease-out,
      background-color 0.2s ease-out, box-shadow 0.2s ease-out;
    mix-blend-mode: exclusion;
    box-shadow: 0 0 15px var(--accent-color);
  }
  a:hover ~ .custom-cursor,
  button:hover ~ .custom-cursor {
    width: 50px;
    height: 50px;
    background-color: var(--accent-color);
    box-shadow: 0 0 30px var(--accent-color);
  }
}

.btn-download {
  background-color: var(--accent-color);
  color: white;
  padding: 15px 30px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: transform 0.3s, background-color 0.3s;
  margin-top: 32px;
}
.btn-download:hover {
  transform: translateY(-5px);
  opacity: 0.9;
}

.carousel-container {
  position: relative;
  width: 100%;
  max-width: 1200px;
  height: 600px;
  margin-top: 2rem;
  perspective: 1500px;
}
.carousel {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
}
.project-card {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  margin: auto;
  width: 70%;
  height: 90%;
  max-height: 540px;
  cursor: pointer;
  transition: transform 0.5s ease, opacity 0.5s ease, z-index 0.5s;
}
.project-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.6s ease;
}
.project-card.flipped .project-card-inner {
  transform: rotateY(180deg);
}
.project-card-front,
.project-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background-color: var(--card-bg-color);
  border-radius: 15px;
  box-shadow: var(--box-shadow);
  overflow: hidden;
  text-align: center;
}
.project-card-front img {
  width: 100%;
  height: 85%;
  object-fit: cover;
}
.project-card-front h3 {
  margin-top: 15px;
  font-size: 1.5rem;
  padding: 0 10px;
}
.project-card-back {
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 30px;
}
.project-card-back h3 {
  font-size: 1.8rem;
  margin-bottom: 20px;
}
.project-card-back p {
  font-size: 1.1rem;
  line-height: 1.5;
  margin-bottom: 40px;
}
.project-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
}
.project-link {
  background-color: var(--sidebar-hover-color);
  color: var(--primary-text-color);
  padding: 12px 25px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background-color 0.3s;
}
.project-link:hover {
  background-color: var(--accent-color);
  color: white;
}

/* CORREÇÃO: Estilo dos botões do carrossel com mais contraste */
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(0, 0, 0, 0.4); /* Fundo escuro semi-transparente */
  border: 1px solid rgba(255, 255, 255, 0.2); /* Borda sutil */
  backdrop-filter: blur(4px); /* Efeito de vidro fosco */
  border-radius: 50%;
  width: 50px;
  height: 50px;
  cursor: pointer;
  z-index: 10;
  color: #ffffff; /* Ícone sempre branco */
  font-size: 2rem;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: background-color 0.3s;
}
.carousel-btn:hover {
  background-color: rgba(0, 0, 0, 0.6);
}
.prev-btn {
  left: -20px;
}
.next-btn {
  right: -20px;
}

.contact-links {
  margin-top: 3rem;
  display: flex;
  justify-content: center;
  gap: 40px;
}
.contact-links a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--secondary-text-color);
  text-decoration: none;
  font-size: 1rem;
  transition: color 0.3s, transform 0.3s;
}
.contact-links a:hover {
  color: var(--primary-text-color);
  transform: translateY(-5px);
}
.contact-links i {
  font-size: 3rem;
}

.hamburger-btn,
.mobile-nav {
  display: none;
}

/* --- MEDIA QUERIES (VERSÃO FINAL E CORRIGIDA) --- */
@media (max-width: 900px) {
  .sidebar {
    display: none;
  }
  main {
    padding-left: 0;
  }

  .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: 1001;
    position: fixed;
    top: 25px;
    right: 25px;
  }
  .hamburger-btn span {
    width: 100%;
    height: 3px;
    background-color: var(--primary-text-color);
    border-radius: 5px;
    transition: all 0.3s linear;
    position: relative;
    transform-origin: 1px;
  }
  .hamburger-btn.is-active span:nth-child(1) {
    transform: rotate(45deg);
  }
  .hamburger-btn.is-active span:nth-child(2) {
    opacity: 0;
    transform: translateX(-20px);
  }
  .hamburger-btn.is-active span:nth-child(3) {
    transform: rotate(-45deg);
  }

  .mobile-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--sidebar-bg-color);
    z-index: 1000;
    transform: translateX(100%);
    transition: transform 0.5s cubic-bezier(0.77, 0, 0.175, 1);
  }
  .mobile-nav.is-open {
    transform: translateX(0);
  }
  .mobile-nav ul {
    list-style: none;
    text-align: center;
  }
  .mobile-nav ul li {
    margin: 30px 0;
  }
  .mobile-nav .mobile-link {
    font-size: 2rem;
    font-weight: 600;
    color: var(--primary-text-color);
    text-decoration: none;
    background: none;
    border: none;
    font-family: "Poppins", sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    cursor: pointer;
  }

  #home .home-content {
    flex-direction: column-reverse;
    gap: 3rem;
  }
  #home .home-text {
    text-align: center;
    flex-basis: auto;
  }
  .home-buttons {
    justify-content: center;
  }
  h1 {
    font-size: 2.5rem;
  }
  h2 {
    font-size: 2rem;
  }
  .highlight-frontend {
    font-size: 1.1rem;
  }
  .blob {
    width: 280px;
    height: 280px;
  }

  /* CORREÇÃO FINAL: Carrossel para tablet e mobile */
  .carousel-container {
    height: auto;
    perspective: none;
    max-width: 100vw;
  }
  .carousel {
    display: flex;
    transform-style: flat;
    transition: transform 0.5s ease;
    gap: 20px;
    padding: 0 2.5%; /* Espaço nas laterais */
  }
  .project-card {
    position: relative;
    flex: 0 0 95%; /* Cada card ocupa 95% da largura da tela */
    width: 95%;
    margin: 0;
    height: auto;
    aspect-ratio: 16 / 9; /* Mantém a proporção de notebook */
    transform: none !important;
    opacity: 1 !important;
    z-index: 1 !important;
  }
  .carousel-btn {
    display: flex;
  } /* Garante que os botões apareçam */
  .prev-btn {
    left: 10px;
  }
  .next-btn {
    right: 10px;
  }
  .project-card-front {
    padding-bottom: 20px;
  }
}

@media (max-width: 450px) {
  h1 {
    font-size: 2.2rem;
  }
  .blob {
    width: 250px;
    height: 250px;
  }
  .home-buttons {
    gap: 0.5rem;
  }
  .btn-service {
    padding: 10px 20px;
    font-size: 0.9rem;
  }
  .project-card {
    flex-basis: 100%;
    width: 100%;
  }
  .carousel {
    padding: 0;
  }
  .project-card-back,
  .project-card-front {
    height: auto;
  }
  .carousel-btn {
    transform: translateY(150%);
  }
  .project-card-front {
    padding-bottom: 20px;
  }
}
