/**
 * Azim LMS - Frontend Animations & Modern Effects
 * Premium animations for hero sections, cards, buttons, and interactions
 * Optimized for performance - uses GPU-accelerated transforms
 */

/* ====================================================================
   SCROLL-TRIGGERED ANIMATIONS (Fade In, Slide Up, Scale)
   ==================================================================== */

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

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

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

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

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

/* Animation classes for JS-triggered animations */
.animate-fade-in-up {
  animation: fadeInUp 0.6s ease-out forwards;
}

.animate-slide-in-left {
  animation: slideInLeft 0.6s ease-out forwards;
}

.animate-slide-in-right {
  animation: slideInRight 0.6s ease-out forwards;
}

.animate-scale-in {
  animation: scaleIn 0.6s ease-out forwards;
}

.animate-fade-in {
  animation: fadeIn 0.6s ease-out forwards;
}

/* Staggered animation delays */
.animation-delay-1 { animation-delay: 0.1s; }
.animation-delay-2 { animation-delay: 0.2s; }
.animation-delay-3 { animation-delay: 0.3s; }
.animation-delay-4 { animation-delay: 0.4s; }
.animation-delay-5 { animation-delay: 0.5s; }

/* ====================================================================
   HERO SECTION ANIMATIONS
   ==================================================================== */

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

@keyframes gradientShift {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

.hero-background {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 0;
  overflow: hidden;
}

.hero-background-image {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-size: cover;
  background-position: center;
  animation: heroBackgroundZoom 20s ease-out forwards;
  filter: brightness(0.4);
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 50% 100%, rgba(166, 191, 6, 0.1) 0%, transparent 70%);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  animation: fadeInUp 1s ease-out 0.3s forwards;
  opacity: 0;
}

/* ====================================================================
   CARD HOVER EFFECTS
   ==================================================================== */

.card-hover-lift {
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.card-hover-lift:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  border-color: rgba(166, 191, 6, 0.5) !important;
}

.course-card-premium {
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.course-card-premium:hover {
  transform: translateY(-12px);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3);
}

.course-card-premium::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.course-card-premium:hover::before {
  opacity: 1;
}

/* Category card effects */
.category-card {
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.category-card:hover {
  transform: translateY(-6px);
  border-color: var(--brand-primary) !important;
}

.category-card:hover .category-icon {
  transform: scale(1.1) rotate(5deg);
  color: var(--brand-primary) !important;
}

.category-icon {
  transition: all 0.3s ease;
}

/* ====================================================================
   BUTTON ANIMATIONS & HOVER EFFECTS
   ==================================================================== */

.btn {
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
  pointer-events: none;
}

.btn:hover::after {
  width: 300px;
  height: 300px;
}

.btn-primary:hover,
.btn-affiliate:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

.btn:active {
  transform: translateY(0) scale(0.98);
}

/* Glow effect for primary buttons */
.btn-primary {
  box-shadow: 0 0 20px rgba(166, 191, 6, 0.0);
  transition: box-shadow 0.3s ease;
}

.btn-primary:hover {
  box-shadow: 0 0 30px rgba(166, 191, 6, 0.4);
}

/* ====================================================================
   IMAGE EFFECTS & PARALLAX
   ==================================================================== */

@keyframes imageZoom {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.08);
  }
}

.image-zoom-on-hover {
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.image-zoom-on-hover img {
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.image-zoom-on-hover:hover img {
  transform: scale(1.08);
}

/* Parallax scroll effect */
.parallax-image {
  background-attachment: fixed;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  position: relative;
}

/* ====================================================================
   TEXT & HEADING ANIMATIONS
   ==================================================================== */

@keyframes textGradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.gradient-text {
  background: linear-gradient(135deg, var(--brand-primary) 0%, #C8DC56 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: textGradientShift 3s ease infinite;
  background-size: 200% 200%;
}

.animated-counter {
  transition: all 0.3s ease;
}

/* ====================================================================
   BADGE & PILL ANIMATIONS
   ==================================================================== */

.badge-pulse {
  animation: badge-pulse-animation 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes badge-pulse-animation {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.05);
  }
}

.badge-shine {
  animation: badge-shine-animation 3s linear infinite;
  background-size: 200% 100%;
}

@keyframes badge-shine-animation {
  0% {
    background-position: -200% center;
  }
  100% {
    background-position: 200% center;
  }
}

/* ====================================================================
   SECTION FADE-IN EFFECTS
   ==================================================================== */

.section-fade-in {
  opacity: 0;
  animation: fadeInUp 0.8s ease-out forwards;
}

.section-bg-animation {
  position: relative;
  overflow: hidden;
}

.section-bg-animation::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(166, 191, 6, 0.05) 0%, transparent 70%);
  animation: float-animation 15s ease-in-out infinite;
  z-index: 0;
  pointer-events: none;
}

@keyframes float-animation {
  0%, 100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(50px, 30px);
  }
}

/* ====================================================================
   FLOATING & FLOATING ELEMENTS
   ==================================================================== */

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

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

.float-animation-delay-1 { animation-delay: 0s; }
.float-animation-delay-2 { animation-delay: 0.5s; }
.float-animation-delay-3 { animation-delay: 1s; }

/* ====================================================================
   LINK & NAV ANIMATIONS
   ==================================================================== */

.nav-link-animated {
  position: relative;
  transition: color 0.3s ease;
}

.nav-link-animated::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--brand-primary);
  transition: width 0.3s ease;
}

.nav-link-animated:hover::after {
  width: 100%;
}

/* ====================================================================
   FORM INPUT ANIMATIONS
   ==================================================================== */

.form-control,
.form-select {
  transition: all 0.3s ease;
  border-color: rgba(166, 191, 6, 0.2);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(166, 191, 6, 0.1);
  transform: translateY(-1px);
}

/* ====================================================================
   LOADING & PROGRESS ANIMATIONS
   ==================================================================== */

@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

.shimmer-animation {
  animation: shimmer 2s infinite;
  background: linear-gradient(90deg, #111827 25%, #1e293b 50%, #111827 75%);
  background-size: 1000px 100%;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.spin-animation {
  animation: spin 1s linear infinite;
}

/* ====================================================================
   RESPONSIVE ADJUSTMENTS
   ==================================================================== */

@media (max-width: 768px) {
  .hero-background-image {
    animation: none;
  }

  .course-card-premium:hover {
    transform: translateY(-6px);
  }

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

  .parallax-image {
    background-attachment: scroll;
  }
}

/* ====================================================================
   ACCESSIBILITY - RESPECT USER PREFERENCES
   ==================================================================== */

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

  .hero-background-image,
  .gradient-text,
  .float-animation,
  .shimmer-animation,
  .spin-animation {
    animation: none !important;
  }
}

/* ====================================================================
   PERFORMANCE OPTIMIZATION
   ==================================================================== */

/* Use will-change sparingly - only on animated elements */
.will-animate {
  will-change: transform;
}

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

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Disable smooth scroll on reduced motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
