* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ========================================
   HEADER PRINCIPAL - OTIMIZADO
   ======================================== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: rgba(30, 59, 138, 0.192);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 1000;
  transition: all 0.3s ease;
  /* Otimização para performance */
  will-change: transform, background;
  contain: layout style paint;
}

.header.scrolled {
  background: rgba(30, 58, 138, 0.98);
  box-shadow: 0 5px 30px rgba(0, 0, 0, 0.2);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  max-width: 1200px;
  margin: 0 auto;
  cursor: pointer;
  /* Otimização para layout shift */
  min-height: 80px;
}

/* ========================================
   LOGO - OTIMIZADO
   ======================================== */
.logo {
  z-index: 1001;
  padding-top: 3.5rem;
  margin-right: 9rem;
  /* Prevenção de layout shift */
  width: 112px; /* 7rem = 112px */
  height: 112px;
  display: flex;
  align-items: center;
}

.logo img {
  height: auto;
  width: 15rem;
  transition: transform 0.3s ease;
  /* Otimizações de imagem */
  object-fit: contain;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  /* Prevenção de layout shift */
}

.logo:hover img {
  transform: scale(1.05);
}

/* ========================================
   NAVEGAÇÃO DESKTOP
   ======================================== */
.nav-links {
  display: flex;
  list-style: none;
  gap: 30px;
  align-items: center;
  /* Prevenção de layout shift */
  min-height: 40px;
}

.nav-links li a {
  color: white;
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;
  transition: all 0.3s ease;
  position: relative;
  padding: 8px 0;
  cursor: pointer;
  /* Otimização para hover */
  will-change: transform, color;
}

.nav-links li a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #06b6d4, #3b82f6);
  transition: width 0.3s ease;
}

.nav-links li a:hover::after,
.nav-links li a.active::after {
  width: 100%;
}

.nav-links li a:hover {
  color: #06b6d4;
  transform: translateY(-2px);
}

/* ========================================
   CTA BUTTON DESKTOP
   ======================================== */
.cta-button {
  background: linear-gradient(135deg, #06b6d4, #3b82f6);
  padding: 12px 25px;
  border-radius: 25px;
  transition: all 0.3s ease;
  border: 2px solid transparent;
  /* Prevenção de layout shift */
  min-width: 180px;
  text-align: center;
  /* Otimização para hover */
  will-change: transform, box-shadow;
}

.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(6, 182, 212, 0.4);
  border-color: rgba(255, 255, 255, 0.2);
}

.cta-button a {
  color: white;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}

/* ========================================
   MOBILE MENU BUTTON - OTIMIZADO
   ======================================== */
.mobile-menu-btn {
  display: none;
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 15px;
  cursor: pointer;
  position: relative;
  z-index: 1001;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  /* Otimização para performance */
  will-change: transform, background;
}

.mobile-menu-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(1.05);
}

.mobile-menu-btn.active {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
  transform: rotate(180deg);
}

/* Ícone do Menu (Animado) */
.menu-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 24px;
  height: 18px;
}

.menu-line {
  position: absolute;
  width: 100%;
  height: 2px;
  background: white;
  border-radius: 2px;
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.menu-line:nth-child(1) {
  top: 0;
}

.menu-line:nth-child(2) {
  top: 50%;
  transform: translateY(-50%);
}

.menu-line:nth-child(3) {
  bottom: 0;
}

/* Animação do X */
.mobile-menu-btn.active .menu-line:nth-child(1) {
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
  background: #ef4444;
}

.mobile-menu-btn.active .menu-line:nth-child(2) {
  opacity: 0;
  transform: translateY(-50%) scale(0);
}

.mobile-menu-btn.active .menu-line:nth-child(3) {
  bottom: 50%;
  transform: translateY(50%) rotate(-45deg);
  background: #ef4444;
}

/* ========================================
   MOBILE MENU OVERLAY - OTIMIZADO
   ======================================== */
.mobile-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: linear-gradient(
    135deg,
    rgba(30, 58, 138, 0.95) 0%,
    rgba(59, 130, 246, 0.9) 50%,
    rgba(6, 182, 212, 0.85) 100%
  );
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  /* Otimização para performance */
  will-change: opacity, visibility;
}

.mobile-menu-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Menu Content */
.mobile-menu-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100%;
  padding: 80px 20px 20px;
  text-align: center;
}

/* Mobile Navigation Links */
.mobile-nav-links {
  list-style: none;
  margin-bottom: 40px;
}

.mobile-nav-links li {
  margin: 20px 0;
  transform: translateY(50px);
  opacity: 0;
  transition: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.mobile-menu-overlay.active .mobile-nav-links li {
  transform: translateY(0);
  opacity: 1;
}

/* Delay nas animações */
.mobile-nav-links li:nth-child(1) {
  transition-delay: 0.1s;
}
.mobile-nav-links li:nth-child(2) {
  transition-delay: 0.2s;
}
.mobile-nav-links li:nth-child(3) {
  transition-delay: 0.3s;
}
.mobile-nav-links li:nth-child(4) {
  transition-delay: 0.4s;
}

.mobile-nav-links li a {
  color: white;
  text-decoration: none;
  font-size: 2rem;
  font-weight: 700;
  display: block;
  padding: 15px 30px;
  border-radius: 15px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.mobile-nav-links li a::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;
}

.mobile-nav-links li a:hover::before {
  left: 100%;
}

.mobile-nav-links li a:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.05);
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

.mobile-nav-links li a.active {
  background: rgba(6, 182, 212, 0.3);
  border: 2px solid rgba(6, 182, 212, 0.5);
}

/* Mobile CTA Button */
.mobile-cta {
  transform: translateY(50px);
  opacity: 0;
  transition: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  transition-delay: 0.5s;
}

.mobile-menu-overlay.active .mobile-cta {
  transform: translateY(0);
  opacity: 1;
}

.mobile-cta-button {
  background: linear-gradient(135deg, #06b6d4, #3b82f6);
  color: white;
  text-decoration: none;
  padding: 18px 40px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 1.2rem;
  display: inline-block;
  transition: all 0.3s ease;
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.mobile-cta-button:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  background: linear-gradient(135deg, #0891b2, #2563eb);
}

/* Social Links Mobile */
.mobile-social {
  margin-top: 40px;
  transform: translateY(50px);
  opacity: 0;
  transition: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  transition-delay: 0.6s;
}

.mobile-menu-overlay.active .mobile-social {
  transform: translateY(0);
  opacity: 1;
}

.social-links {
  display: flex;
  gap: 20px;
  justify-content: center;
}

.social-link {
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  text-decoration: none;
  font-size: 1.2rem;
  transition: all 0.3s ease;
}

.social-link:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1) rotate(360deg);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* ========================================
   RESPONSIVE BREAKPOINTS - OTIMIZADOS
   ======================================== */
@media (max-width: 1024px) {
  .nav-links,
  .cta-button {
    display: none;
  }

  .mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .logo {
    margin-right: 0;
  }
}

@media (max-width: 768px) {
  .nav-container {
    padding: 12px 15px;
    min-height: 70px;
  }

  .logo {
    width: 80px;
    height: 80px;
  }

  .logo img {
    height: 5rem;
  }

  .mobile-nav-links li a {
    font-size: 1.8rem;
  }

  .mobile-cta-button {
    padding: 15px 35px;
    font-size: 1.1rem;
  }
}

@media (max-width: 480px) {
  .nav-container {
    padding: 10px 15px;
    min-height: 65px;
  }

  .logo {
    width: 100%;
    height: 7rem;
  }

  .logo img {
    height: auto;
    padding: 1rem;
  }

  .mobile-menu-btn {
    width: 45px;
    height: 45px;
  }

  .mobile-nav-links li a {
    font-size: 1.5rem;
    padding: 12px 25px;
  }

  .mobile-cta-button {
    padding: 12px 30px;
    font-size: 1rem;
  }

  .social-link {
    width: 45px;
    height: 45px;
    font-size: 1.1rem;
  }
}

/* ========================================
   ANIMAÇÕES OTIMIZADAS
   ======================================== */
@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.mobile-cta-button {
  animation: pulse 2s infinite;
}

.social-link {
  animation: float 3s ease-in-out infinite;
}

.social-link:nth-child(2) {
  animation-delay: 0.5s;
}
.social-link:nth-child(3) {
  animation-delay: 1s;
}

/* Efeito de partículas no fundo - OTIMIZADO */
.mobile-menu-overlay::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(
      circle at 20% 20%,
      rgba(255, 255, 255, 0.1) 1px,
      transparent 1px
    ),
    radial-gradient(
      circle at 80% 80%,
      rgba(255, 255, 255, 0.1) 1px,
      transparent 1px
    ),
    radial-gradient(
      circle at 40% 60%,
      rgba(255, 255, 255, 0.05) 1px,
      transparent 1px
    );
  background-size: 50px 50px, 80px 80px, 60px 60px;
  animation: moveParticles 20s linear infinite;
  pointer-events: none;
  /* Otimização para performance */
  will-change: transform;
}

@keyframes moveParticles {
  0% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(-50px, -50px);
  }
}

/* ========================================
   OTIMIZAÇÕES DE PERFORMANCE
   ======================================== */

/* Preload de fontes críticas */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/inter-variable.woff2") format("woff2");
}

/* Fallback para fontes */
body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
}

/* Otimização para Core Web Vitals */
.header img {
  content-visibility: auto;
  contain-intrinsic-size: 112px 112px;
}

/* Performance hints */
.header {
  contain: layout style paint;
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Otimização para dispositivos de alta densidade */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .logo img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .header {
    background: rgba(30, 41, 59, 0.95);
  }

  .nav-links a {
    color: #f1f5f9;
  }

  .mobile-menu-btn span {
    background: #f1f5f9;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .header,
  .nav-links a,
  .cta-button,
  .mobile-menu-btn,
  .menu-line,
  .mobile-menu-overlay,
  .mobile-nav-links li,
  .mobile-cta,
  .mobile-social {
    transition: none;
    animation: none;
  }

  .mobile-menu-overlay::before {
    animation: none;
  }
}

/* Print styles */
@media print {
  .header {
    position: static;
    background: white;
    box-shadow: none;
    backdrop-filter: none;
  }

  .cta-button,
  .mobile-menu-btn {
    display: none;
  }
}
