/* Reset e Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #070773, #242440);
  color: #fff;
  line-height: 1.6;
  overflow-x: hidden;
  transition: background 0.3s ease, color 0.3s ease;
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: auto;
  padding: 0 20px;
}

/* Particles Background */
#particles-js {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

/* Theme Toggle */
#toggle-theme {
  position: fixed;
  top: 20px;
  right: 20px;
  background: rgba(108, 92, 231, 0.2);
  border: 2px solid #6c5ce7;
  color: #6c5ce7;
  font-size: 18px;
  cursor: pointer;
  z-index: 9999;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

#toggle-theme:hover {
  background: rgba(108, 92, 231, 0.3);
  transform: scale(1.1);
}

/* Header */
header, .navbar, .header {
  background: rgba(255, 255, 255, 0.1) !important;
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  
  /* Altura responsiva */
  height: clamp(100px, 12vh, 160px);
  min-height: 100px;
  
  /* Layout e alinhamento */
  display: flex;
  align-items: center;
  padding: 0 20px;
  
  /* Transição suave para mudanças */
  transition: all 0.3s ease;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
}

/* Container interno para organizar o conteúdo */
header .container,
header .header-content,
.navbar .container,
.navbar .navbar-content,
.header .container,
.header .header-content {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
}

header.scrolled {
  background: rgba(0, 0, 0, 0.95) !important;
  height: 80px;
}

header h1 {
  color: #6c5ce7;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 1px;
}

nav {
  display: flex;
  align-items: center;
  gap: 30px;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 30px;
  margin: 0;
}

nav ul li a {
  color: #ccc;
  text-decoration: none;
  font-weight: 500;
  position: relative;
  padding: 5px 0;
  transition: color 0.3s ease;
}

nav ul li a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: #6c5ce7;
  transition: width 0.3s ease;
}

nav ul li a:hover,
nav ul li a.active {
  color: #fff;
}

nav ul li a:hover::after,
nav ul li a.active::after {
  width: 100%;
}

.botao {
  background: linear-gradient(45deg, #6c5ce7, #5a4bcc);
  color: #fff;
  padding: 12px 24px;
  border-radius: 25px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(108, 92, 231, 0.3);
  position: relative;
  overflow: hidden;
}

.botao::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.botao:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(108, 92, 231, 0.4);
}

.botao:hover::before {
  left: 100%;
}

/* Mobile Menu Toggle */
.mobile-toggle {
  display: none;
  flex-direction: column;
  cursor: pointer;
  gap: 4px;
}

.mobile-toggle span {
  width: 25px;
  height: 3px;
  background: #fff;
  transition: 0.3s;
  transform-origin: center;
}

.mobile-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.mobile-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* Intro Section */
.intro {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 120px 0 80px;
  position: relative;
}

.intro .container {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 60px;
  align-items: center;
  width: 100%;
}

.intro .texto {
  max-width: 600px;
}

.intro h2 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  margin-bottom: 20px;
  line-height: 1.2;
  font-weight: 700;
}

.intro h2 .letra {
  opacity: 0;
  animation: aparecer 0.8s ease forwards;
  display: inline-block;
}

.intro h2 .letra:nth-child(1) { animation-delay: 0.2s; }
.intro h2 .letra:nth-child(2) { animation-delay: 0.4s; }

.intro h2 span {
  background: linear-gradient(45deg, #6c5ce7, #8b7cf7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.intro h3 {
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  margin-bottom: 24px;
  color: #a8a8a8;
  font-weight: 400;
}

.intro p {
  font-size: 1.1rem;
  margin-bottom: 30px;
  color: #ccc;
  line-height: 1.8;
}

.foto {
  position: relative;
}

.avatar {
  width: 300px;
  height: 300px;
  border-radius: 50%;
  border: 4px solid #6c5ce7;
  box-shadow: 0 20px 40px rgba(108, 92, 231, 0.3);
  transition: all 0.3s ease;
  object-fit: cover;
  position: relative;
  z-index: 1;
}

.avatar:hover {
  transform: scale(1.05);
  box-shadow: 0 25px 50px rgba(108, 92, 231, 0.4);
}

.foto::before {
  content: '';
  position: absolute;
  top: -20px;
  right: -20px;
  width: 340px;
  height: 340px;
  border: 2px solid rgba(108, 92, 231, 0.3);
  border-radius: 50%;
  z-index: 0;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

@keyframes aparecer {
  from { 
    opacity: 0; 
    transform: translateY(20px);
  }
  to { 
    opacity: 1; 
    transform: translateY(0);
  }
}

.social-icons {
  margin-top: 40px;
  display: flex;
  gap: 20px;
}

.social-icons a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  background: rgba(108, 92, 231, 0.1);
  border: 2px solid rgba(108, 92, 231, 0.3);
  border-radius: 12px;
  color: #6c5ce7;
  font-size: 20px;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.social-icons a:hover {
  background: rgba(108, 92, 231, 0.2);
  border-color: #6c5ce7;
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(108, 92, 231, 0.3);
}

/* Sections */
section {
  padding: 80px 0;
  position: relative;
}

section h2 {
  text-align: center;
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 60px;
  color: #fff;
  position: relative;
}

section h2::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: linear-gradient(45deg, #6c5ce7, #8b7cf7);
  border-radius: 2px;
}

/* Services */
.servico-lista {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  list-style: none;
}

.cartao {
  background: rgba(26, 26, 46, 0.8);
  backdrop-filter: blur(10px);
  padding: 40px 30px;
  border-radius: 20px;
  text-align: center;
  transition: all 0.3s ease;
  border: 1px solid rgba(108, 92, 231, 0.2);
  position: relative;
  overflow: hidden;
}

.cartao::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(108, 92, 231, 0.1), transparent);
  transition: left 0.6s ease;
}

.cartao:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(108, 92, 231, 0.2);
  border-color: rgba(108, 92, 231, 0.5);
}

.cartao:hover::before {
  left: 100%;
}

.cartao h3 {
  font-size: 1.4rem;
  margin-bottom: 15px;
  color: #6c5ce7;
}

.cartao p {
  color: #ccc;
  line-height: 1.6;
}

/* Projects */
.projetos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 30px;
}

.projeto {
  background: rgba(26, 26, 39, 0.8);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  overflow: hidden;
  transition: all 0.3s ease;
  border: 1px solid rgba(108, 92, 231, 0.2);
}

.projeto:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(108, 92, 231, 0.2);
}

.projeto .cartao {
  background: transparent;
  border: none;
  backdrop-filter: none;
}

.projeto .cartao h3 {
  font-size: 1.3rem;
  margin-bottom: 10px;
}

.projeto .cartao a {
  color: #6c5ce7;
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 15px;
  transition: color 0.3s ease;
}

.projeto .cartao a:hover {
  color: #8b7cf7;
}

.projeto img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 12px;
  margin: 15px 0;
  transition: transform 0.3s ease;
}

.projeto:hover img {
  transform: scale(1.02);
}

/* Loading Container para projetos */
.loading-container {
  width: 100%;
  height: 200px;
  background: linear-gradient(45deg, #6c5ce7, #8b7cf7);
  border-radius: 12px;
  margin: 15px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.1rem;
  position: relative;
  overflow: hidden;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-left: 4px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 15px;
}

.loading-text {
  font-weight: 500;
  letter-spacing: 0.5px;
}

.dots {
  display: inline-block;
  animation: dots 1.5s infinite;
}

/* Animação do spinner */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Animação dos pontos */
@keyframes dots {
  0%, 20% { opacity: 1; }
  50% { opacity: 0.3; }
  100% { opacity: 1; }
}

/* Efeito de brilho opcional */
.loading-container::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
  animation: shine 2s infinite;
}

@keyframes shine {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Skills */
#habilidades {
  background: rgba(0, 0, 0, 0.3);
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
}

.barra-skill {
  background: rgba(26, 26, 46, 0.5);
  padding: 25px;
  border-radius: 15px;
  border: 1px solid rgba(108, 92, 231, 0.2);
}

.barra-skill span {
  display: block;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 15px;
  color: #fff;
}

.barra {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  height: 12px;
  overflow: hidden;
  position: relative;
}

.barra div {
  background: linear-gradient(45deg, #6c5ce7, #8b7cf7);
  height: 100%;
  border-radius: 10px;
  transition: width 2s ease;
  position: relative;
  overflow: hidden;
}

.barra div::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* Contact */
#contato {
  background: rgba(0, 0, 0, 0.2);
}

.contato {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: start;
}

form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

form h2 {
  text-align: left;
  margin-bottom: 30px;
  font-size: 2rem;
}

form h2::after {
  display: none;
}

input, textarea {
  padding: 15px 20px;
  border: 2px solid rgba(108, 92, 231, 0.3);
  border-radius: 10px;
  background: rgba(26, 26, 46, 0.5);
  color: #fff;
  font-size: 1rem;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

input::placeholder, textarea::placeholder {
  color: #999;
}

input:focus, textarea:focus {
  outline: none;
  border-color: #6c5ce7;
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.1);
}

textarea {
  min-height: 120px;
  resize: vertical;
}

button {
  background: linear-gradient(45deg, #6c5ce7, #5a4bcc);
  color: #fff;
  padding: 15px 30px;
  border: none;
  border-radius: 10px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(108, 92, 231, 0.3);
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(108, 92, 231, 0.4);
}

.infos {
  background: rgba(26, 26, 46, 0.5);
  padding: 40px;
  border-radius: 20px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(108, 92, 231, 0.2);
  height: fit-content;
}

.infos h3 {
  color: #6c5ce7;
  font-size: 1.3rem;
  margin-bottom: 20px;
}

.infos p {
  color: #ccc;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.infos p i {
  color: #6c5ce7;
  width: 20px;
}

/* Footer */
footer {
  background: rgba(21, 21, 31, 0.8);
  text-align: center;
  padding: 30px 0;
  border-top: 1px solid rgba(108, 92, 231, 0.3);
  backdrop-filter: blur(10px);
}

/* Light Theme */
.light-theme {
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  color: #212529;
}

.light-theme header {
  background: rgba(255, 255, 255, 0.9);
}

.light-theme header h1,
.light-theme .intro h2 span,
.light-theme .cartao h3,
.light-theme .social-icons a,
.light-theme .infos h3 {
  color: #6c5ce7;
}

.light-theme nav ul li a {
  color: #495057;
}

.light-theme nav ul li a:hover {
  color: #212529;
}

.light-theme .cartao,
.light-theme .projeto,
.light-theme .barra-skill,
.light-theme .infos {
  background: rgba(255, 255, 255, 0.8);
  color: #212529;
  border-color: rgba(108, 92, 231, 0.2);
}

.light-theme input,
.light-theme textarea {
  background: rgba(255, 255, 255, 0.8);
  color: #212529;
}

.light-theme footer {
  background: rgba(248, 249, 250, 0.9);
  color: #495057;
}

/* Responsive */
@media (max-width: 768px) {
  header, .navbar, .header {
    height: 80px;
    min-height: 80px;
    padding: 0 15px;
  }
  
  .mobile-toggle {
    display: flex;
  }
  
  nav ul {
    position: fixed;
    top: 80px;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    flex-direction: column;
    padding: 30px 0;
    gap: 20px;
    transform: translateY(-100vh);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
  }
  
  nav ul.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
  
  .intro .container {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 40px;
  }
  
  .avatar {
    width: 250px;
    height: 250px;
  }
  
  .foto::before {
    width: 270px;
    height: 270px;
    top: -10px;
    right: -10px;
  }
  
  .contato {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  
  .servico-lista,
  .projetos-grid,
  .skills-grid {
    grid-template-columns: 1fr;
  }
  
  #toggle-theme {
    top: 15px;
    right: 15px;
    width: 45px;
    height: 45px;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  header, .navbar, .header {
    height: 100px;
    padding: 0 20px;
  }
}

@media (min-width: 1025px) {
  header, .navbar, .header {
    height: 120px;
    padding: 0 30px;
  }
}

@media (min-width: 1440px) {
  header, .navbar, .header {
    height: 140px;
  }
}

@media (max-width: 480px) {
  header, .navbar, .header {
    height: 70px;
    min-height: 70px;
  }
  
  .container {
    width: 95%;
    padding: 0 15px;
  }
  
  section {
    padding: 60px 0;
  }
  
  .avatar {
    width: 200px;
    height: 200px;
  }
  
  .foto::before {
    width: 220px;
    height: 220px;
  }
  
  .cartao {
    padding: 30px 20px;
  }
}