/**
 * Animations for Fondation pour la promotion des droits website
 * Provides engaging animation effects to enhance user experience
 */

/* Fade in animation */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Fade in from bottom animation */
@keyframes fadeInUp {
  from { 
    opacity: 0;
    transform: translateY(20px);
  }
  to { 
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fade in from left animation */
@keyframes fadeInLeft {
  from { 
    opacity: 0;
    transform: translateX(-20px);
  }
  to { 
    opacity: 1;
    transform: translateX(0);
  }
}

/* Fade in from right animation */
@keyframes fadeInRight {
  from { 
    opacity: 0;
    transform: translateX(20px);
  }
  to { 
    opacity: 1;
    transform: translateX(0);
  }
}

/* Scale animation */
@keyframes scaleIn {
  from { 
    opacity: 0;
    transform: scale(0.95);
  }
  to { 
    opacity: 1;
    transform: scale(1);
  }
}

/* Rotate animation */
@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Pulse animation */
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* Bounce animation */
@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-20px); }
  60% { transform: translateY(-10px); }
}

/* Shake animation */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
  20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Wiggle animation */
@keyframes wiggle {
  0%, 100% { transform: rotate(-3deg); }
  50% { transform: rotate(3deg); }
}

/* Animation classes */
.fade-in {
  animation: fadeIn 0.8s ease forwards;
}

.fade-in-up {
  animation: fadeInUp 0.8s ease forwards;
}

.fade-in-left {
  animation: fadeInLeft 0.8s ease forwards;
}

.fade-in-right {
  animation: fadeInRight 0.8s ease forwards;
}

.scale-in {
  animation: scaleIn 0.8s ease forwards;
}

.rotate {
  animation: rotate 1s linear infinite;
}

.pulse {
  animation: pulse 2s ease infinite;
}

.bounce {
  animation: bounce 2s ease infinite;
}

.shake {
  animation: shake 0.5s ease;
}

.wiggle {
  animation: wiggle 0.8s ease;
}

/* Animation delays */
.delay-100 {
  animation-delay: 100ms;
}

.delay-200 {
  animation-delay: 200ms;
}

.delay-300 {
  animation-delay: 300ms;
}

.delay-400 {
  animation-delay: 400ms;
}

.delay-500 {
  animation-delay: 500ms;
}

.delay-600 {
  animation-delay: 600ms;
}

.delay-700 {
  animation-delay: 700ms;
}

.delay-800 {
  animation-delay: 800ms;
}

.delay-900 {
  animation-delay: 900ms;
}

.delay-1000 {
  animation-delay: 1000ms;
}

/* Animation durations */
.duration-300 {
  animation-duration: 300ms;
}

.duration-500 {
  animation-duration: 500ms;
}

.duration-700 {
  animation-duration: 700ms;
}

.duration-1000 {
  animation-duration: 1000ms;
}

.duration-1500 {
  animation-duration: 1500ms;
}

.duration-2000 {
  animation-duration: 2000ms;
}

/* Animation triggers */
.animate-on-scroll {
  opacity: 0;
}

.animate-on-scroll.is-visible {
  opacity: 1;
}

/* Hover effect - grow */
.hover-grow {
  transition: transform 0.3s ease;
}

.hover-grow:hover {
  transform: scale(1.05);
}

/* Hover effect - rotate */
.hover-rotate {
  transition: transform 0.3s ease;
}

.hover-rotate:hover {
  transform: rotate(5deg);
}

/* Hover effect - shadow */
.hover-shadow {
  transition: box-shadow 0.3s ease;
}

.hover-shadow:hover {
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* Hover effect - float */
.hover-float {
  transition: transform 0.3s ease;
}

.hover-float:hover {
  transform: translateY(-5px);
}

/* Counter animation */
.counter {
  transition: transform 0.3s ease, color 0.3s ease;
}

.counter:hover {
  transform: scale(1.2);
  color: #0d6efd;
}

/* Icon animations */
.icon-spin {
  animation: rotate 2s linear infinite;
}

.icon-pulse {
  animation: pulse 2s infinite ease-in-out;
}

/* Animated notification badge */
.notification-badge {
  position: relative;
}

.notification-badge::after {
  content: '';
  position: absolute;
  top: -5px;
  right: -5px;
  width: 10px;
  height: 10px;
  background-color: #dc3545;
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}

/* Loading screen animation */
.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #fff;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-screen.loaded {
  opacity: 0;
  visibility: hidden;
}

.loading-screen .spinner {
  width: 50px;
  height: 50px;
  border: 3px solid rgba(13, 110, 253, 0.3);
  border-radius: 50%;
  border-top-color: #0d6efd;
  animation: rotate 1s linear infinite;
}

/* Animated typing cursor effect */
.typing-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background-color: currentColor;
  margin-left: 2px;
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  from, to { opacity: 1; }
  50% { opacity: 0; }
}

/* Reveal animations for sections */
.reveal-section {
  position: relative;
  overflow: hidden;
}

.reveal-section::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #0d6efd;
  transform: translateX(-100%);
  transition: transform 0.8s ease;
}

.reveal-section.revealed::after {
  transform: translateX(100%);
}

/* Scroll down indicator animation */
.scroll-indicator {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  width: 30px;
  height: 50px;
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 15px;
}

.scroll-indicator::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 50%;
  width: 6px;
  height: 6px;
  margin-left: -3px;
  background-color: #fff;
  border-radius: 50%;
  animation: scrollDown 2s infinite;
}

@keyframes scrollDown {
  0% { transform: translateY(0); opacity: 1; }
  80% { transform: translateY(20px); opacity: 0; }
  100% { transform: translateY(0); opacity: 0; }
} 