/* CSS Simplificado para Performance - Tema Preto Luxuoso com Neon Azul */
:root{ 
  --bg-900:#000000; 
  --bg-800:#0A0A0A; 
  --bg-700:#141414; 
  --blue-500:#0099FF; 
  --blue-neon:#00BFFF; 
  --blue-neon-bright:#00FFFF; 
  --white:#fff; 
}

/* Background preto luxuoso */
body{ 
  background: #000000;
  background-attachment: fixed;
  position: relative;
}

/* Linhas neon azuis decorativas no background - Removidas em mobile */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    linear-gradient(90deg, transparent 0%, rgba(0, 191, 255, 0.03) 50%, transparent 100%),
    linear-gradient(0deg, transparent 0%, rgba(0, 191, 255, 0.03) 50%, transparent 100%),
    radial-gradient(circle at 20% 30%, rgba(0, 191, 255, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(0, 255, 255, 0.05) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(0, 191, 255, 0.5), transparent);
  box-shadow: 0 0 20px rgba(0, 191, 255, 0.5);
  pointer-events: none;
  z-index: 1;
  animation: neonLine 3s ease-in-out infinite;
}

@keyframes neonLine {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

/* Remover linhas decorativas do body em mobile */
@media (max-width: 768px) {
  body::before,
  body::after {
    display: none !important;
  }
}

/* Loading animation simples */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-900);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.5s ease;
}

.loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 3px solid rgba(59,165,255,.3);
  border-top: 3px solid var(--blue-neon);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Chips para cases com neon azul */
.chip {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: rgba(0, 191, 255, 0.1);
  border: 1px solid rgba(0, 191, 255, 0.4);
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(0, 191, 255, 1);
  transition: all 0.3s ease;
  box-shadow: 0 0 10px rgba(0, 191, 255, 0.3);
  text-shadow: 0 0 10px rgba(0, 191, 255, 0.5);
}

.chip:hover {
  background: rgba(0, 191, 255, 0.2);
  border-color: rgba(0, 191, 255, 0.8);
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(0, 191, 255, 0.6), 0 0 40px rgba(0, 191, 255, 0.3);
}

/* Otimizações de espaçamento */
.section-compact { 
  padding-top: 3rem; 
  padding-bottom: 3rem; 
}

.section-tight { 
  padding-top: 2rem; 
  padding-bottom: 2rem; 
}

.text-compact {
  line-height: 1.4;
}

.mb-compact {
  margin-bottom: 1rem;
}

/* Animações GSAP - Estados iniciais serão controlados pelo JavaScript */

/* Fallback para garantir visibilidade */
#sobre, #cases, #marcas {
  opacity: 1 !important;
}

#sobre h2, #sobre p, #sobre img,
#cases h2, .case-card,
#marcas h2, #marcas img {
  opacity: 1 !important;
  transform: none !important;
}

/* Header que desaparece durante o scroll - com linhas neon */
header {
  transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
  position: relative;
}

header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,191,255,.6), transparent);
  box-shadow: 0 0 10px rgba(0,191,255,.5);
}

header.hidden {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}

/* Footer que desaparece durante o scroll */
footer {
  transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
  position: relative;
  z-index: 10;
}

footer.hidden {
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
}

/* Glassmorphism luxuoso com neon azul */
.glass{ 
  background: linear-gradient(135deg, rgba(0,191,255,.08), rgba(0,255,255,.05)); 
  backdrop-filter: blur(20px); 
  border: 1px solid rgba(0,191,255,.3);
  box-shadow: 0 0 20px rgba(0,191,255,.2);
  transition: all 0.3s ease;
  position: relative;
}

.glass::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,191,255,.5), transparent);
  box-shadow: 0 0 10px rgba(0,191,255,.5);
}

.glass:hover {
  background: linear-gradient(135deg, rgba(0,191,255,.15), rgba(0,255,255,.1));
  border-color: rgba(0,191,255,.6);
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(0,191,255,.4), 0 10px 30px rgba(0,0,0,.5);
}

/* Keyline luxuoso com neon azul */
.keyline{ 
  outline: 2px solid rgba(0,191,255,.4); 
  outline-offset: -2px; 
  transition: all 0.3s ease;
  position: relative;
}

.keyline::after {
  content: '';
  position: absolute;
  inset: -2px;
  border: 1px solid rgba(0,191,255,.6);
  box-shadow: 0 0 15px rgba(0,191,255,.5);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.keyline:hover {
  outline-color: var(--blue-neon);
  box-shadow: 0 0 25px rgba(0,191,255,.7), 0 0 50px rgba(0,191,255,.4);
}

.keyline:hover::after {
  opacity: 1;
}

/* Hover effects simples */
.card-hover {
  transition: all 0.3s ease;
}

.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px rgba(0,0,0,.2);
}

/* Scroll indicator */
.scroll-indicator {
  animation: scrollBounce 2s ease-in-out infinite;
}

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

/* Marquee simples */
.marquee{ 
  display: flex; 
  overflow: hidden; 
  gap: 3rem; 
}

.marquee-track{ 
  display: flex; 
  gap: 3rem; 
  animation: scroll 20s linear infinite; 
}

@keyframes scroll{ 
  0%{ transform: translateX(0) } 
  100%{ transform: translateX(-50%) } 
}

/* Animações de entrada simples */
.section-animate {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s ease;
}

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

.animate-fade-in-up {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Otimizações de performance */
* {
  box-sizing: border-box;
}

/* Otimizações de renderização */
html {
  scroll-behavior: smooth;
}

body {
  contain: layout style paint;
}

/* Containment para seções grandes */
section {
  contain: layout style;
}

/* Otimização de fontes */
@font-face {
  font-display: swap;
}

/* Lazy loading otimizado */
img {
  loading: lazy;
  decoding: async;
  content-visibility: auto;
}

/* Imagens críticas acima da dobra */
img[data-priority="high"],
.hero img,
header img {
  loading: eager;
  content-visibility: visible;
}

/* Performance para vídeo */
#heroVideo {
  will-change: auto;
  transform: translateZ(0);
}

/* Responsive */
@media (max-width: 768px) {
  .marquee-track {
    animation-duration: 15s;
  }
}

/* Acessibilidade - neon azul */
*:focus {
  outline: 2px solid rgba(0,191,255,.8);
  outline-offset: 2px;
  box-shadow: 0 0 10px rgba(0,191,255,.5);
}

/* Linhas neon decorativas para seções - Removidas em mobile */
section {
  position: relative;
}

section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,191,255,.3), transparent);
  box-shadow: 0 0 8px rgba(0,191,255,.3);
}

/* Remover linhas decorativas em mobile para evitar sobreposição */
@media (max-width: 768px) {
  section::before {
    display: none !important;
  }
  
  .divider {
    margin: 1rem 0 !important;
  }
}

/* Divisórias neon azul */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,191,255,.5), transparent);
  box-shadow: 0 0 10px rgba(0,191,255,.4);
  margin: 2rem 0;
}

/* Redução de movimento */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================
   CORREÇÕES ESPECÍFICAS PARA MOBILE - iOS E ANDROID
   ============================================ */

@media (max-width: 768px) {
  /* Remover todas as linhas decorativas que sobrepõem */
  section::before {
    display: none !important;
  }
  
  body::before,
  body::after {
    display: none !important;
  }
  
  header::after {
    display: none !important;
  }
  
  /* Reduzir espaçamentos para evitar sobreposição */
  .divider {
    margin: 0.75rem 0 !important;
    opacity: 0.5 !important;
  }
  
  /* Garantir que elementos não saiam da tela */
  body, html {
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100vw !important;
  }
  
  /* Grids sempre em 1 coluna em mobile */
  .grid {
    grid-template-columns: 1fr !important;
  }
  
  /* Padding reduzido */
  section {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
}

@media (max-width: 480px) {
  /* Espaçamentos ainda menores */
  section {
    padding-top: 1.5rem !important;
    padding-bottom: 1.5rem !important;
  }
  
  /* Remover todos os pseudo-elementos decorativos */
  *::before,
  *::after {
    display: none !important;
  }
  
  /* Exceção apenas para elementos essenciais */
  .glass::before,
  .keyline::before {
    display: block !important;
  }
}

/* ====== MOBILE ONLY ====== */
@media (max-width: 640px) {
  /* Espaços gerais */
  #parceiros,
  #cases,
  #marcas {
    padding-inline: 16px;
  }

  /* Grid dos cards em 1 coluna */
  #parceiros .grid,
  #cases .grid,
  #marcas .grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* Card base */
  .case-card,
  .lazy-card {
    padding: 16px;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
    overflow: hidden;
  }

  /* Imagem do card */
  .card-image-container,
  .case-card img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 12px;
  }

  /* Tipografia responsiva (sem estourar) */
  .case-card h3,
  .lazy-card h3,
  .card-content h3 {
    font-size: clamp(20px, 5vw, 28px) !important;
    line-height: 1.2;
    word-break: break-word;
  }

  .case-card p,
  .lazy-card p,
  .card-content p {
    font-size: clamp(14px, 3.8vw, 16px) !important;
    line-height: 1.55;
    color: rgba(255,255,255,0.85);
    display: -webkit-box;
    -webkit-line-clamp: 2; /* evita texto gigante */
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  /* CTA acessível (44px de toque) */
  .lazy-card a,
  .case-card a,
  .lazy-card .flex.items-center {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    text-decoration: none;
  }

  /* Evitar sobreposição do header fixo ao ancorar */
  [id] { 
    scroll-margin-top: 84px; 
  }

  /* Botão flutuante WhatsApp não cobrindo conteúdo */
  .float-whats,
  a[href*="whatsapp"],
  a[href*="wa.me"] {
    right: max(16px, env(safe-area-inset-right)) !important;
    bottom: max(16px, env(safe-area-inset-bottom)) !important;
    z-index: 50;
  }
}
