/* ===================================
   Animation Classes & Keyframes
   =================================== */

/* Fade In Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

@keyframes scaleUp {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.05);
  }
}

/* Slide Animations */
@keyframes slideInFromTop {
  from {
    opacity: 0;
    transform: translateY(-50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInFromBottom {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Rotate Animations */
@keyframes rotateIn {
  from {
    opacity: 0;
    transform: rotate(-180deg);
  }
  to {
    opacity: 1;
    transform: rotate(0deg);
  }
}

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

/* Bounce Animation */
@keyframes bounce {
  0%, 20%, 53%, 80%, 100% {
    transform: translate3d(0,0,0);
  }
  40%, 43% {
    transform: translate3d(0,-30px,0);
  }
  70% {
    transform: translate3d(0,-15px,0);
  }
  90% {
    transform: translate3d(0,-4px,0);
  }
}

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

/* Typewriter Animation */
@keyframes typewriter {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

@keyframes blink {
  0%, 50% {
    border-color: transparent;
  }
  51%, 100% {
    border-color: var(--accent-color);
  }
}

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

/* Progress Bar Animation */
@keyframes progressBar {
  0% {
    width: 0%;
  }
  100% {
    width: var(--progress-width, 100%);
  }
}

/* Floating Animation */
@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* Glow Animation */
@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 5px rgba(27, 55, 132, 0.3);
  }
  50% {
    box-shadow: 0 0 20px rgba(27, 55, 132, 0.6);
  }
}

/* ===================================
   Animation Utility Classes
   =================================== */

/* Fade Animations */
.fade-in {
  animation: fadeIn 0.6s ease-out;
}

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

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

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

.fade-in-down {
  animation: slideInFromTop 0.8s ease-out;
}

/* Scale Animations */
.scale-in {
  animation: scaleIn 0.6s ease-out;
}

.scale-up {
  animation: scaleUp 0.3s ease-out;
}

/* Slide Animations */
.slide-in-top {
  animation: slideInFromTop 0.8s ease-out;
}

.slide-in-bottom {
  animation: slideInFromBottom 0.8s ease-out;
}

/* Special Animations */
.rotate-in {
  animation: rotateIn 0.8s ease-out;
}

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

.bounce-animation {
  animation: bounce 1s ease-out;
}

.shake-animation {
  animation: shake 0.5s ease-out;
}

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

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

/* ===================================
   Intersection Observer Animations
   =================================== */

/* Elements that animate on scroll */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease-out;
}

.animate-on-scroll.animated {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered animations for lists */
.animate-stagger > * {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease-out;
}

.animate-stagger.animated > *:nth-child(1) { transition-delay: 0.1s; }
.animate-stagger.animated > *:nth-child(2) { transition-delay: 0.2s; }
.animate-stagger.animated > *:nth-child(3) { transition-delay: 0.3s; }
.animate-stagger.animated > *:nth-child(4) { transition-delay: 0.4s; }
.animate-stagger.animated > *:nth-child(5) { transition-delay: 0.5s; }
.animate-stagger.animated > *:nth-child(6) { transition-delay: 0.6s; }

.animate-stagger.animated > * {
  opacity: 1;
  transform: translateY(0);
}

/* ===================================
   Hover Animations
   =================================== */

/* Card hover effects */
.hover-lift {
  transition: all var(--transition-base);
}

.hover-lift:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-xl);
}

.hover-scale {
  transition: all var(--transition-base);
}

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

.hover-glow {
  transition: all var(--transition-base);
}

.hover-glow:hover {
  box-shadow: 0 0 20px rgba(27, 55, 132, 0.3);
}

/* Button hover effects */
.btn-hover-slide {
  position: relative;
  overflow: hidden;
  transition: all var(--transition-base);
}

.btn-hover-slide::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.2);
  transition: left var(--transition-base);
}

.btn-hover-slide:hover::before {
  left: 0;
}

/* ===================================
   Loading States
   =================================== */

.loading {
  position: relative;
  pointer-events: none;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid transparent;
  border-top: 2px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* ===================================
   Form Animations
   =================================== */

/* Form field focus animations */
.form-control:focus {
  animation: glow 0.3s ease-out;
}

/* Success animation */
.form-success {
  animation: fadeInUp 0.5s ease-out;
}

/* Error animation */
.form-error {
  animation: shake 0.5s ease-out;
}

/* Progress indicator */
.progress-bar {
  height: 4px;
  background: var(--primary-color);
  border-radius: 2px;
  animation: progressBar 0.5s ease-out;
}

/* ===================================
   Page Transitions
   =================================== */

.page-enter {
  opacity: 0;
  transform: translateY(20px);
}

.page-enter-active {
  opacity: 1;
  transform: translateY(0);
  transition: all 0.5s ease-out;
}

.page-exit {
  opacity: 1;
  transform: translateY(0);
}

.page-exit-active {
  opacity: 0;
  transform: translateY(-20px);
  transition: all 0.3s ease-in;
}

/* ===================================
   Responsive Animation Adjustments
   =================================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 767.98px) {
  .animate-on-scroll {
    transform: translateY(20px);
  }
  
  .fade-in-up,
  .slide-in-bottom {
    animation-duration: 0.6s;
  }
}

/* ===================================
   Performance Optimizations
   =================================== */

/* Use transform and opacity for better performance */
.will-animate {
  will-change: transform, opacity;
}

/* GPU acceleration for smooth animations */
.gpu-accelerated {
  transform: translateZ(0);
  backface-visibility: hidden;
  perspective: 1000px;
}

/* ===================================
   Custom Animation Classes
   =================================== */

/* Hero specific animations */
.hero-logo {
  animation: fadeInUp 1s ease-out 0.2s both;
}

.hero-title {
  animation: fadeInLeft 1s ease-out 0.4s both;
}

.hero-subtitle {
  animation: fadeInLeft 1s ease-out 0.6s both;
}

.benefits-list {
  animation: fadeInLeft 1s ease-out 0.8s both;
}

.hero-cta {
  animation: fadeInUp 1s ease-out 1s both;
}

.enrollment-form {
  animation: fadeInRight 1s ease-out 0.6s both;
}

/* Section entrance animations */
.section-header {
  animation: fadeInUp 0.8s ease-out both;
}

.program-card,
.testimonial-card,
.structure-card {
  animation: fadeInUp 0.8s ease-out both;
}

/* Staggered card animations */
.program-card:nth-child(1) { animation-delay: 0.1s; }
.program-card:nth-child(2) { animation-delay: 0.2s; }
.program-card:nth-child(3) { animation-delay: 0.3s; }
.program-card:nth-child(4) { animation-delay: 0.4s; }

.testimonial-card:nth-child(1) { animation-delay: 0.1s; }
.testimonial-card:nth-child(2) { animation-delay: 0.2s; }
.testimonial-card:nth-child(3) { animation-delay: 0.3s; }

.structure-card:nth-child(1) { animation-delay: 0.1s; }
.structure-card:nth-child(2) { animation-delay: 0.2s; }
.structure-card:nth-child(3) { animation-delay: 0.3s; }
