/* ========================================
   ANIMAÇÕES AVANÇADAS PARA O MENU
   Animações extras e efeitos especiais
   ======================================== */

/* Animação de fade-in para os itens do menu mobile */
@keyframes menuItemFadeIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.nav-menu.active .nav-list > li {
  animation: menuItemFadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.nav-menu.active .nav-list > li:nth-child(1) { animation-delay: 0.05s; }
.nav-menu.active .nav-list > li:nth-child(2) { animation-delay: 0.1s; }
.nav-menu.active .nav-list > li:nth-child(3) { animation-delay: 0.15s; }
.nav-menu.active .nav-list > li:nth-child(4) { animation-delay: 0.2s; }
.nav-menu.active .nav-list > li:nth-child(5) { animation-delay: 0.25s; }
.nav-menu.active .nav-list > li:nth-child(6) { animation-delay: 0.3s; }

/* Animação de fade-in para dropdown desktop */
@keyframes dropdownFadeIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* Animação individual dos itens do dropdown */
@keyframes dropdownItemSlide {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (min-width: 768px) {
  .nav-list .menu-item-has-children:hover > .sub-menu .sub-menu-wrapper > li,
  .nav-list .menu-item-has-children:focus-within > .sub-menu .sub-menu-wrapper > li {
    animation: dropdownItemSlide 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  }
  
  .nav-list .menu-item-has-children:hover > .sub-menu .sub-menu-wrapper > li:nth-child(1),
  .nav-list .menu-item-has-children:focus-within > .sub-menu .sub-menu-wrapper > li:nth-child(1) {
    animation-delay: 0.05s;
  }
  
  .nav-list .menu-item-has-children:hover > .sub-menu .sub-menu-wrapper > li:nth-child(2),
  .nav-list .menu-item-has-children:focus-within > .sub-menu .sub-menu-wrapper > li:nth-child(2) {
    animation-delay: 0.1s;
  }
  
  .nav-list .menu-item-has-children:hover > .sub-menu .sub-menu-wrapper > li:nth-child(3),
  .nav-list .menu-item-has-children:focus-within > .sub-menu .sub-menu-wrapper > li:nth-child(3) {
    animation-delay: 0.15s;
  }
  
  .nav-list .menu-item-has-children:hover > .sub-menu .sub-menu-wrapper > li:nth-child(4),
  .nav-list .menu-item-has-children:focus-within > .sub-menu .sub-menu-wrapper > li:nth-child(4) {
    animation-delay: 0.2s;
  }
}

/* Efeito de pulse no hover do botão toggle */
@keyframes togglePulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 113, 75, 0.4);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(255, 113, 75, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 113, 75, 0);
  }
}

.nav-toggle:focus-visible {
  animation: togglePulse 1s infinite;
}

/* Efeito de brilho ao passar o mouse nos links */
@keyframes linkShine {
  0% {
    left: -100%;
  }
  50%, 100% {
    left: 100%;
  }
}

.nav-link::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(255, 255, 255, 0.3), 
    transparent);
  transition: left 0.5s ease;
  z-index: 1;
}

.nav-link:hover::after {
  animation: linkShine 1s ease-in-out;
}

/* Efeito de ripple ao clicar nos links do menu mobile */
.nav-link {
  overflow: hidden;
  position: relative;
}

@keyframes ripple {
  0% {
    transform: scale(0);
    opacity: 0.5;
  }
  100% {
    transform: scale(4);
    opacity: 0;
  }
}

/* Adicionar indicador visual de loading/hover nos links */
.nav-link::before {
  z-index: 0;
}

/* Micro-interações: bounce suave no hover */
@media (hover: hover) {
  @keyframes gentleBounce {
    0%, 100% {
      transform: translateY(-3px);
    }
    50% {
      transform: translateY(-5px);
    }
  }
  
  @media (min-width: 768px) {
    .nav-link:hover {
      animation: gentleBounce 0.6s ease-in-out;
    }
  }
}

/* Efeito de shimmer nos links desktop */
@media (min-width: 768px) {
  @keyframes shimmer {
    0% {
      background-position: -200% center;
    }
    100% {
      background-position: 200% center;
    }
  }
  
  .nav-link {
    background-size: 200% 100%;
    position: relative;
  }
  
  /* Brilho que atravessa o link ao hover */
  .nav-link:hover {
    background-image: linear-gradient(
      90deg,
      transparent 0%,
      transparent 40%,
      rgba(255, 255, 255, 0.3) 50%,
      transparent 60%,
      transparent 100%
    );
    animation: shimmer 1.5s ease-in-out infinite;
  }
}

/* Smooth entrance para o header ao carregar a página */
@keyframes headerSlideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.header {
  animation: headerSlideDown 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Efeito de brilho na logo ao hover */
@keyframes logoGlow {
  0%, 100% {
    filter: drop-shadow(0 0 0 transparent);
  }
  50% {
    filter: drop-shadow(0 0 8px rgba(255, 113, 75, 0.4));
  }
}

.logo-link:hover .logo {
  animation: logoGlow 1s ease-in-out;
}

/* Efeito parallax suave no scroll do dropdown */
@media (min-width: 768px) {
  .nav-list .sub-menu {
    will-change: transform, opacity;
  }
  
  @keyframes dropdownGlow {
    0%, 100% {
      box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12), 
                  0 0 0 1px rgba(255, 113, 75, 0.1);
    }
    50% {
      box-shadow: 0 12px 50px rgba(255, 113, 75, 0.15), 
                  0 0 0 1px rgba(255, 113, 75, 0.2);
    }
  }
  
  .nav-list .menu-item-has-children:hover > .sub-menu {
    animation: dropdownGlow 2s ease-in-out infinite;
  }
}

/* Loading state para links (caso tenha navegação assíncrona no futuro) */
@keyframes linkLoading {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.nav-link.loading {
  background: linear-gradient(90deg, 
    rgba(255, 113, 75, 0.1), 
    rgba(255, 113, 75, 0.3), 
    rgba(255, 113, 75, 0.1));
  background-size: 200% 100%;
  animation: linkLoading 1.5s ease-in-out infinite;
}

/* Efeito de destaque ao focar com teclado (acessibilidade) */
.nav-link:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 4px;
  border-radius: var(--radius-md);
  animation: none;
}

/* Transição suave entre estados do menu */
.nav-menu,
.nav-overlay {
  will-change: opacity, visibility, right;
}

/* Otimização de performance */
.nav-link,
.nav-toggle span,
.sub-menu {
  will-change: transform;
}

/* Efeito de glow pulsante no link ativo (desktop) */
@media (min-width: 768px) {
  @keyframes activeGlow {
    0%, 100% {
      box-shadow: 0 4px 15px rgba(255, 113, 75, 0.4),
                  0 2px 5px rgba(0, 0, 0, 0.1),
                  inset 0 1px 2px rgba(255, 255, 255, 0.3);
    }
    50% {
      box-shadow: 0 6px 25px rgba(255, 113, 75, 0.6),
                  0 3px 8px rgba(0, 0, 0, 0.15),
                  inset 0 1px 2px rgba(255, 255, 255, 0.4);
    }
  }
  
  .nav-link.active,
  .current-menu-item > .nav-link {
    animation: activeGlow 2s ease-in-out infinite;
  }
  
  /* Efeito de partículas sutis ao redor do link ativo */
  @keyframes particleFloat {
    0%, 100% {
      transform: translateY(0) scale(1);
      opacity: 0.3;
    }
    50% {
      transform: translateY(-4px) scale(1.1);
      opacity: 0.6;
    }
  }
}

/* Efeito de brilho nos cantos ao hover */
@media (min-width: 768px) {
  .nav-link {
    overflow: hidden;
  }
  
  .nav-link:hover {
    overflow: visible;
  }
}

/* ========================================
   ANIMAÇÕES DA PAGINAÇÃO
   ======================================== */

/* Entrada animada dos botões de paginação */
@keyframes paginationFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.pagination .page-numbers {
  animation: paginationFadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}

.pagination .page-numbers:nth-child(1) { animation-delay: 0.05s; }
.pagination .page-numbers:nth-child(2) { animation-delay: 0.1s; }
.pagination .page-numbers:nth-child(3) { animation-delay: 0.15s; }
.pagination .page-numbers:nth-child(4) { animation-delay: 0.2s; }
.pagination .page-numbers:nth-child(5) { animation-delay: 0.25s; }
.pagination .page-numbers:nth-child(6) { animation-delay: 0.3s; }
.pagination .page-numbers:nth-child(7) { animation-delay: 0.35s; }
.pagination .page-numbers:nth-child(8) { animation-delay: 0.4s; }
.pagination .page-numbers:nth-child(9) { animation-delay: 0.45s; }

/* Efeito de bounce nos botões ao hover */
@keyframes paginationBounce {
  0%, 100% {
    transform: translateY(-2px);
  }
  50% {
    transform: translateY(-5px);
  }
}

.pagination .page-numbers:not(.current):hover {
  animation: paginationBounce 0.5s ease-in-out;
}

/* Efeito de ripple ao clicar */
@keyframes paginationRipple {
  0% {
    transform: scale(0);
    opacity: 0.5;
  }
  100% {
    transform: scale(2.5);
    opacity: 0;
  }
}

.pagination .page-numbers:active::after {
  animation: paginationRipple 0.6s ease-out;
}

/* Shimmer effect nos botões Prev/Next */
@keyframes paginationShimmer {
  0% {
    background-position: -200% center;
  }
  100% {
    background-position: 200% center;
  }
}

.pagination .prev:hover,
.pagination .next:hover {
  background-image: 
    linear-gradient(135deg, var(--color-primary), var(--color-secondary-2)),
    linear-gradient(90deg, 
      transparent 0%, 
      transparent 40%, 
      rgba(255, 255, 255, 0.3) 50%, 
      transparent 60%, 
      transparent 100%
    );
  background-size: 100% 100%, 200% 100%;
  animation: paginationShimmer 2s linear infinite;
}

/* Reduzir animações para quem prefere menos movimento (acessibilidade) */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .nav-link::after,
  .nav-link::before {
    display: none;
  }
  
  .pagination .page-numbers {
    animation: none !important;
  }
}

