/* ==========================================================================
   Animations & Keyframes - FullDevGear
   ========================================================================== */

/* --- SPA & Animation Classes --- */
main#main-content .main-content-area {
  display: none;
  opacity: 0;
}

main#main-content .main-content-area:not([hidden]) {
  display: block;
  opacity: 1;
}

.main-title {
  opacity: 0;
  animation: fadeInUp var(--animation-duration-default) var(--animation-timing-ease-out) forwards;
  animation-delay: var(--delay-main-title);
}

main#main-content>section>article[data-animation-item]:not(.main-title) {
  opacity: 0;
  animation: fadeInUp var(--animation-duration-default) var(--animation-timing-ease-out) forwards;
  animation-delay: var(--delay-article-content);
}

main#main-content>section#freelance-content>article.late-animation-item {
  animation-delay: var(--delay-late-article-content);
}

.fade-in {
  animation: fadeIn var(--animation-duration-default) var(--animation-timing-ease-out) forwards;
}

.fade-out {
  animation: fadeOut var(--animation-duration-default) var(--animation-timing-ease-out) forwards;
}

#page-transition-wave {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--color-accent-yellow);
  z-index: var(--z-index-page-transition);
  transform: translateX(-100%);
  pointer-events: none;
  /* Optimisations pour mobile */
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.wave-transition-sweep-in {
  animation: wave-sweep-in var(--animation-duration-fast) var(--animation-timing-ease-in-out) forwards;
  /* Force le rendu immédiat sur mobile */
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

.wave-transition-sweep-out {
  animation: wave-sweep-out var(--animation-duration-fast) var(--animation-timing-ease-in-out) forwards;
  /* Force le rendu immédiat sur mobile */
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

.wave-transition-sweep-in-reverse {
  animation: wave-sweep-in-reverse var(--animation-duration-fast) var(--animation-timing-ease-in-out) forwards;
  /* Force le rendu immédiat sur mobile */
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

.wave-transition-sweep-out-reverse {
  animation: wave-sweep-out-reverse var(--animation-duration-fast) var(--animation-timing-ease-in-out) forwards;
  /* Force le rendu immédiat sur mobile */
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

/* --- Keyframes --- */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

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

/* fadeInDownMobile removed - no longer used */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

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

@keyframes zoomIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

@keyframes slideInFromRight {
  from {
    opacity: 0;
    transform: translateX(100%);
  }

  to {
    opacity: 1;
    transform: translateX(-50%);
  }
}

@keyframes wave-sweep-in {
  from {
    transform: translateX(-100%);
  }

  to {
    transform: translateX(0%);
  }
}

@keyframes wave-sweep-out {
  from {
    transform: translateX(0%);
  }

  to {
    transform: translateX(100%);
  }
}

/* Animations sens inverse */
@keyframes wave-sweep-in-reverse {
  from {
    transform: translateX(100%);
  }

  to {
    transform: translateX(0%);
  }
}

@keyframes wave-sweep-out-reverse {
  from {
    transform: translateX(0%);
  }

  to {
    transform: translateX(-100%);
  }
}

@keyframes halo-pulse {

  0%,
  100% {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2), 0 0 6px var(--tile-glow-color, rgba(200, 200, 200, 0.5)), 0 0 12px var(--tile-glow-color, rgba(210, 210, 210, 0.3));
  }

  50% {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2), 0 0 12px var(--tile-glow-color, rgba(220, 220, 220, 0.7)), 0 0 22px var(--tile-glow-color, rgba(230, 230, 230, 0.5));
  }
}

/* navInvert animations removed - using fixed color like contact button */

/* Animations légères optimisées pour la performance */
@keyframes navFadeIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* navColorTransition removed - no longer used with fixed nav color */

@keyframes profileGlow {

  0%,
  100% {
    opacity: 0;
    transform: rotate(0deg);
  }

  50% {
    opacity: 0.3;
    transform: rotate(180deg);
  }
}

@keyframes statusPulse {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.6;
    transform: scale(1.2);
  }
}

@keyframes skillFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

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

/* Mobile Active State Keyframes */
@keyframes skillPulse {
  0% {
    transform: translateY(-2px) scale(1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), 0 0 20px rgba(255, 255, 255, 0.1);
  }

  50% {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5), 0 0 25px rgba(255, 255, 255, 0.15);
  }

  100% {
    transform: translateY(-2px) scale(1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), 0 0 20px rgba(255, 255, 255, 0.1);
  }
}

@keyframes softSkillGlow {
  0% {
    background: var(--cv-dm-border);
    box-shadow: none;
  }

  50% {
    background: var(--cv-dm-accent-secondary);
    box-shadow: 0 0 15px rgba(124, 58, 237, 0.4);
  }

  100% {
    background: var(--cv-dm-border);
    box-shadow: none;
  }
}

@keyframes languageHighlight {
  0% {
    box-shadow: none;
  }

  50% {
    box-shadow: inset 5px 0 0 var(--cv-dm-accent-primary);
  }

  100% {
    box-shadow: none;
  }
}

@keyframes experienceSlide {
  0% {
    transform: translateX(0);
  }

  30% {
    transform: translateX(2px);
  }

  100% {
    transform: translateX(0);
  }
}

@keyframes arcRotate {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* Animations pour l'effet univers stellaire */
@keyframes starTwinkle {
  0% {
    opacity: 0.6;
    transform: scale(1);
  }

  50% {
    opacity: 0.8;
    transform: scale(1.1);
  }

  100% {
    opacity: 0.4;
    transform: scale(0.9);
  }
}

@keyframes starTwinkleSecondary {
  0% {
    opacity: 0.3;
    transform: scale(0.8);
  }

  50% {
    opacity: 0.6;
    transform: scale(1.2);
  }

  100% {
    opacity: 0.2;
    transform: scale(0.9);
  }
}

@keyframes nebulaDrift {
  0% {
    transform: rotate(0deg) translate(-2%, -2%);
  }

  25% {
    transform: rotate(90deg) translate(-1%, -3%);
  }

  50% {
    transform: rotate(180deg) translate(-3%, -1%);
  }

  75% {
    transform: rotate(270deg) translate(-1%, -2%);
  }

  100% {
    transform: rotate(360deg) translate(-2%, -2%);
  }
}

/* Logo Animation - Subtle floating effect */
@keyframes logoFloat {

  0%,
  100% {
    transform: translateY(0px) rotate(0deg);
  }

  33% {
    transform: translateY(-3px) rotate(1deg);
  }

  66% {
    transform: translateY(-1px) rotate(-1deg);
  }
}

/* Logo Glow Animation */
@keyframes logoGlow {

  0%,
  100% {
    filter: drop-shadow(0 0 5px rgba(255, 241, 0, 0.3));
  }

  50% {
    filter: drop-shadow(0 0 15px rgba(255, 241, 0, 0.6));
  }
}

/* Performance optimization: Pause animations during scroll */
.scrolling * {
  animation-play-state: paused !important;
  transition-duration: 0s !important;
}

/* Optimisations mobiles pour une transition plus fluide */
@media (max-width: 768px) {
  .main-content-area {
    /* Forcer l'accélération matérielle sur mobile */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    /* Optimiser le rendu des changements de visibilité */
    will-change: auto;
  }
}



/* Respect user preference for reduced motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}