/* ============================================
   MEDUSA X — Animações Avançadas v1
   Melhorias de Design & Interatividade
   ============================================ */

/* --- Respeitar preferências de acessibilidade --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================
   1. ANIMAÇÕES AO SCROLL (Stagger Reveal)
   ============================================ */

.section-item {
  opacity: 0;
  transform: translateY(40px) rotateX(10deg);
  animation: revealItem 0.85s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.section-item:nth-child(1) { animation-delay: 0.1s; }
.section-item:nth-child(2) { animation-delay: 0.25s; }
.section-item:nth-child(3) { animation-delay: 0.4s; }
.section-item:nth-child(4) { animation-delay: 0.55s; }
.section-item:nth-child(5) { animation-delay: 0.7s; }

@keyframes revealItem {
  from {
    opacity: 0;
    transform: translateY(40px) rotateX(10deg);
  }
  to {
    opacity: 1;
    transform: translateY(0) rotateX(0);
  }
}

/* ============================================
   2. HERO PARALLAX AVANÇADO
   ============================================ */


/* Animação heroPan removida — imagem estática */

/* ============================================
   3. LINHA ANIMADA EM SECÇÕES
   ============================================ */

.section {
  position: relative;
}

.section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--magenta),
    transparent
  );
  animation: slideDown 1.5s ease-out forwards;
  opacity: 0.5;
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
  }
  to {
    transform: translateY(0);
  }
}

/* ============================================
   4. HOVER EFFECTS AVANÇADOS — Cards
   ============================================ */

.card {
  position: relative;
  overflow: hidden;
  --glow: 0;
  --glow-x: 50%;
  --glow-y: 50%;
}

/* Glow dinâmico ao hover */
.card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at var(--glow-x) var(--glow-y),
    rgba(255, 55, 255, 0.4),
    transparent 50%
  );
  opacity: var(--glow);
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 0;
}

.card > * {
  position: relative;
  z-index: 1;
}

.card:hover {
  --glow: 1;
  border-color: rgba(255, 55, 255, 0.5);
  transform: translateY(-6px) rotateX(1deg);
}

/* Shine effect em cards */
.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  animation: shine 3s infinite;
  pointer-events: none;
  z-index: 2;
}

@keyframes shine {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

/* ============================================
   5. HOVER EFFECTS — Galeria com 3D
   ============================================ */

.gallery-item {
  perspective: 1000px;
  position: relative;
}

.gallery-item:hover {
  transform: rotateY(2deg) rotateX(-2deg) scale(1.02);
}

/* Overlay gradient ao hover */
.gallery-item::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 55, 255, 0.15) 0%,
    rgba(0, 0, 0, 0.8) 100%
  );
  opacity: 0;
  transition: opacity 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 1;
  border-radius: 2px;
}

.gallery-item:hover::before {
  opacity: 1;
}

.gallery-item:hover .event-img {
  filter: saturate(1.2) brightness(1.15) drop-shadow(0 0 25px rgba(255, 55, 255, 0.4));
  transform: scale(1.08) rotate(0.5deg);
}

/* ============================================
   6. GRID GALERIA — Masonry Layout
   ============================================ */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

/* Variação de tamanho para visual dinâmico */
.gallery-item:nth-child(2) {
  grid-column: span 1;
}

.gallery-item:nth-child(3) {
  grid-row: span 1;
}

.gallery-item:nth-child(5) {
  grid-column: span 1;
}

@media (max-width: 1024px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .gallery-item:nth-child(2) {
    grid-column: span 1;
  }
  .gallery-item:nth-child(3) {
    grid-row: span 1;
  }
}

@media (max-width: 768px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
  .gallery-item {
    grid-column: span 1 !important;
    grid-row: span 1 !important;
  }
}

@media (max-width: 480px) {
  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
}

/* ============================================
   7. BOTÕES COM ANIMAÇÕES
   ============================================ */

/* Underline animado em botões ghost */
.btn--ghost {
  position: relative;
}

.btn--ghost::before {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--magenta);
  transition: width 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn--ghost:hover::before {
  width: 100%;
}

/* Glow em botão primário */
.btn--primary {
  position: relative;
  box-shadow: 0 0 20px rgba(255, 55, 255, 0.4);
  animation: pulseGlow 3s ease-in-out infinite;
}

.btn--primary:hover {
  animation: pulseGlow 1.5s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(255, 55, 255, 0.4);
  }
  50% {
    box-shadow: 0 0 40px rgba(255, 55, 255, 0.7);
  }
}

/* ============================================
   8. FLOATING ELEMENTS
   ============================================ */

.floating {
  animation: float 4s ease-in-out infinite;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-12px);
  }
}

/* Aplicar em seções específicas */
.quote {
  animation: float 5s ease-in-out infinite;
}

.stat__number {
  animation: float 6s ease-in-out infinite;
  animation-delay: calc(var(--stat-index, 0) * 0.3s);
}

/* ============================================
   9. SCROLL INDICATOR COM FADE
   ============================================ */

.scroll-indicator {
  animation: scrollBounce 2.5s infinite, scrollFade 3s ease-in-out infinite;
}

@keyframes scrollFade {
  0%, 100% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
}

/* ============================================
   10. LABEL TEXT COM SLIDE-IN
   ============================================ */

.label-text {
  display: inline-block;
  animation: slideInRight 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}

.section:nth-child(1) .label-text { animation-delay: 0.1s; }
.section:nth-child(2) .label-text { animation-delay: 0.15s; }
.section:nth-child(3) .label-text { animation-delay: 0.2s; }
.section:nth-child(4) .label-text { animation-delay: 0.25s; }
.section:nth-child(5) .label-text { animation-delay: 0.3s; }

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ============================================
   11. IMAGENS COM FADE-IN SUAVE
   ============================================ */

.event-img {
  animation: imageFadeIn 0.8s ease-out forwards;
}

@keyframes imageFadeIn {
  from {
    opacity: 0;
    transform: scale(0.98);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ============================================
   12. NAVBAR FIXED — Entrada suave
   ============================================ */

.navbar {
  animation: navbarSlideDown 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes navbarSlideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ============================================
   13. TOUCH DEVICES — Desativar animações excessivas
   ============================================ */

@media (hover: none) and (pointer: coarse) {
  .card:hover {
    transform: none;
    border-color: rgba(255, 55, 255, 0.15);
  }

  .card::after {
    display: none;
  }

  .gallery-item:hover {
    transform: scale(1.02);
  }

  .btn--primary:hover {
    transform: none;
    box-shadow: 0 0 20px rgba(255, 55, 255, 0.4);
  }

  .btn--ghost:hover::before {
    width: 0;
  }

  .hero__img-bg {
    animation: none;
  }

  /* Manter animações sutis mas sem movimento excessivo */
  .floating {
    animation: float 6s ease-in-out infinite;
  }
}

/* ============================================
   14. ANIMAÇÕES EM ACCORDION (FAQ)
   ============================================ */

.faq-answer {
  animation: expandAnswer 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes expandAnswer {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   15. FORM INPUTS COM FOCUS ANIMADO
   ============================================ */

.form-input,
.form-textarea {
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
}

.form-input:focus,
.form-textarea:focus {
  transform: scale(1.01);
  box-shadow: 0 0 0 3px var(--magenta-dim), 0 0 20px rgba(255, 55, 255, 0.2);
}

/* ============================================
   16. MEDIA RESPONSIVA — Ajustes
   ============================================ */

@media (max-width: 768px) {
  .section::before {
    opacity: 0.3;
  }

  .card:hover {
    transform: translateY(-3px);
  }

  .gallery-item:hover {
    transform: scale(1.01);
  }

  .btn--primary {
    animation: pulseGlow 4s ease-in-out infinite;
  }

  .floating {
    animation: float 5s ease-in-out infinite;
  }
}

@media (max-width: 480px) {
  .section-item {
    animation: revealItem 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  }

  .floating {
    animation: float 6s ease-in-out infinite;
  }

  .btn--primary {
    animation: pulseGlow 5s ease-in-out infinite;
  }
}

/* ============================================
   17. PRINT STYLES — Desativar animações
   ============================================ */

@media print {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* ============================================
   FIM — Animações Avançadas
   ============================================ */
