/* ============================================================
   ReadyOnShift — Animations & Visual Enhancements
   Sections:
     1. Keyframe Animations
     2. Hero Section Enhancements
     3. Page Header Enhancements
     4. Floating Particles
     5. Section Background Decorations
     6. Scroll-Reveal (fade-in) Animations
     7. Card Hover Enhancements
     8. Utility Animation Classes
   ============================================================ */

/* ============================================================
   1. Keyframe Animations
   ============================================================ */

/* Gradient shift for hero backgrounds */
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Floating up-down movement for particles */
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); opacity: 0.6; }
  50% { transform: translateY(-20px) rotate(5deg); opacity: 1; }
}

@keyframes floatReverse {
  0%, 100% { transform: translateY(0) rotate(0deg); opacity: 0.5; }
  50% { transform: translateY(20px) rotate(-5deg); opacity: 0.8; }
}

/* Slow rotation for decorative blobs */
@keyframes rotateBlob {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.05); }
  100% { transform: rotate(360deg) scale(1); }
}

/* Pulse effect for icons and badges */
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* Fade in upward */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fade in from left */
@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Fade in from right */
@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Scale in */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Shimmer / shine sweep across elements */
@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

/* Subtle breathing glow */
@keyframes glow {
  0%, 100% { box-shadow: 0 0 20px rgba(192, 57, 43, 0.2); }
  50% { box-shadow: 0 0 40px rgba(192, 57, 43, 0.4); }
}

/* Wave motion for decorative lines */
@keyframes wave {
  0% { transform: translateX(0) translateY(0); }
  25% { transform: translateX(-5px) translateY(3px); }
  50% { transform: translateX(0) translateY(-3px); }
  75% { transform: translateX(5px) translateY(3px); }
  100% { transform: translateX(0) translateY(0); }
}

/* ============================================================
   2. Hero Section Enhancements
   ============================================================ */

/* Override hero with animated gradient background */
.hero {
  background: linear-gradient(-45deg, #0f1c33, #16294B, #22375f, #0f1c33, #16294B);
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
}

/* Animated geometric pattern overlay */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M40 0l40 40-40 40L0 40z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.02'%3E%3Ccircle cx='30' cy='30' r='4'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
  animation: wave 20s ease-in-out infinite;
}

/* Decorative floating blobs behind hero content */
.hero::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(192, 57, 43, 0.15) 0%, transparent 70%);
  animation: rotateBlob 25s linear infinite;
  pointer-events: none;
}

/* Second decorative blob */
.hero .container::before {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -15%;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(230, 126, 34, 0.1) 0%, transparent 70%);
  animation: rotateBlob 20s linear infinite reverse;
  pointer-events: none;
}

/* Hero content entrance animations */
.hero__title {
  animation: fadeInUp 0.8s ease-out both;
}

.hero__tagline {
  animation: fadeInUp 0.8s ease-out 0.2s both;
}

.hero__cta {
  animation: fadeInUp 0.8s ease-out 0.4s both;
  position: relative;
  overflow: hidden;
}

/* Shimmer effect on CTA button */
.hero__cta::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  animation: shimmer 3s ease-in-out infinite;
}

/* Floating particle dots in hero */
.hero-particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.hero-particles span {
  position: absolute;
  display: block;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
}

.hero-particles span:nth-child(1) {
  width: 80px;
  height: 80px;
  top: 10%;
  left: 10%;
  animation: float 6s ease-in-out infinite;
}

.hero-particles span:nth-child(2) {
  width: 40px;
  height: 40px;
  top: 60%;
  left: 80%;
  animation: floatReverse 8s ease-in-out infinite;
}

.hero-particles span:nth-child(3) {
  width: 60px;
  height: 60px;
  top: 30%;
  left: 65%;
  animation: float 7s ease-in-out infinite 1s;
}

.hero-particles span:nth-child(4) {
  width: 30px;
  height: 30px;
  top: 75%;
  left: 25%;
  animation: floatReverse 5s ease-in-out infinite 0.5s;
}

.hero-particles span:nth-child(5) {
  width: 50px;
  height: 50px;
  top: 15%;
  left: 45%;
  animation: float 9s ease-in-out infinite 2s;
}

.hero-particles span:nth-child(6) {
  width: 20px;
  height: 20px;
  top: 80%;
  left: 55%;
  animation: floatReverse 6s ease-in-out infinite 1.5s;
}

/* ============================================================
   3. Page Header Enhancements (Inner Pages)
   ============================================================ */

.page-header {
  background: linear-gradient(-45deg, #0f1c33, #16294B, #22375f, #182d52);
  background-size: 300% 300%;
  animation: gradientShift 12s ease infinite;
  position: relative;
  overflow: hidden;
}

/* Decorative geometric pattern for page headers */
.page-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M50 0L100 50 50 100 0 50z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

/* Glowing accent line at bottom of header */
.page-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent), var(--color-primary));
  background-size: 200% auto;
  animation: shimmer 4s linear infinite;
}

/* Decorative circle accent */
.page-header .container {
  position: relative;
}

.page-header .container::before {
  content: '';
  position: absolute;
  top: 50%;
  right: -80px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(192, 57, 43, 0.12) 0%, transparent 70%);
  transform: translateY(-50%);
  pointer-events: none;
}

/* Title entrance animation for page headers */
.page-header__title {
  animation: fadeInLeft 0.6s ease-out both;
}

.page-header__subtitle {
  animation: fadeInLeft 0.6s ease-out 0.15s both;
}

/* ============================================================
   4. Floating Particles (reusable)
   ============================================================ */

.particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.particles span {
  position: absolute;
  display: block;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}

.particles span:nth-child(1) {
  width: 60px;
  height: 60px;
  top: 20%;
  left: 5%;
  animation: float 7s ease-in-out infinite;
}

.particles span:nth-child(2) {
  width: 30px;
  height: 30px;
  top: 50%;
  right: 10%;
  animation: floatReverse 5s ease-in-out infinite 0.5s;
}

.particles span:nth-child(3) {
  width: 45px;
  height: 45px;
  bottom: 15%;
  left: 70%;
  animation: float 8s ease-in-out infinite 1s;
}

/* ============================================================
   5. Section Background Decorations
   ============================================================ */

/* Mission section gets a subtle radial glow */
.mission {
  position: relative;
  overflow: hidden;
}

.mission::before {
  content: '';
  position: absolute;
  top: -100px;
  right: -100px;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(192, 57, 43, 0.04) 0%, transparent 70%);
  pointer-events: none;
}

/* Mission icon wrap pulse */
.mission__icon-wrap {
  animation: pulse 3s ease-in-out infinite;
}

/* How-it-works section — subtle diagonal lines */
.how-it-works {
  position: relative;
  overflow: hidden;
}

.how-it-works::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      135deg,
      transparent,
      transparent 40px,
      rgba(44, 62, 80, 0.015) 40px,
      rgba(44, 62, 80, 0.015) 41px
    );
  pointer-events: none;
}

/* Events preview — top gradient fade */
.events-preview {
  position: relative;
}

.events-preview::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, transparent, var(--color-primary), var(--color-accent), transparent);
  opacity: 0.3;
}

/* About stats section — decorative dots pattern */
.about-stats {
  position: relative;
  overflow: hidden;
}

.about-stats::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle, rgba(44, 62, 80, 0.03) 1px, transparent 1px);
  background-size: 30px 30px;
  pointer-events: none;
}

/* About values section — subtle gradient overlay */
.about-values {
  position: relative;
  overflow: hidden;
}

.about-values::after {
  content: '';
  position: absolute;
  bottom: -150px;
  left: -150px;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(230, 126, 34, 0.04) 0%, transparent 70%);
  pointer-events: none;
}

/* Course section — subtle diagonal stripes */
.course-section {
  position: relative;
  overflow: hidden;
}

.course-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 60px,
      rgba(44, 62, 80, 0.01) 60px,
      rgba(44, 62, 80, 0.01) 61px
    );
  pointer-events: none;
}

/* Contact section — gradient bottom border */
.contact-section {
  position: relative;
}

.contact-section::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--color-border), transparent);
  pointer-events: none;
}

/* ============================================================
   6. Scroll-Reveal (fade-in) Animations
   ============================================================ */

/* Elements start hidden and animate in when visible */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered delays for child elements */
.animate-on-scroll.delay-1 { transition-delay: 0.1s; }
.animate-on-scroll.delay-2 { transition-delay: 0.2s; }
.animate-on-scroll.delay-3 { transition-delay: 0.3s; }
.animate-on-scroll.delay-4 { transition-delay: 0.4s; }
.animate-on-scroll.delay-5 { transition-delay: 0.5s; }

/* Scale variant */
.animate-on-scroll--scale {
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.animate-on-scroll--scale.is-visible {
  opacity: 1;
  transform: scale(1);
}

/* Slide from left variant */
.animate-on-scroll--left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll--left.is-visible {
  opacity: 1;
  transform: translateX(0);
}

/* Slide from right variant */
.animate-on-scroll--right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll--right.is-visible {
  opacity: 1;
  transform: translateX(0);
}

/* ============================================================
   7. Card Hover Enhancements
   ============================================================ */

/* Lift and glow on hover for hiw steps */
.hiw__step {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hiw__step:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

/* Step number pulse on card hover */
.hiw__step:hover .hiw__step-number {
  animation: pulse 0.6s ease-in-out;
}

/* Event card subtle lift */
.event-card {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card:has(.event-card):hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

/* Resource card shine effect on hover */
.resource-card::before {
  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;
  pointer-events: none;
}

.resource-card {
  position: relative;
  overflow: hidden;
}

.resource-card:hover::before {
  left: 100%;
}

/* Module card header subtle shimmer on hover */
.module-card__header {
  position: relative;
  overflow: hidden;
}

.module-card__header::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.05),
    transparent
  );
  transition: left 0.6s ease;
  pointer-events: none;
}

.module-card__header:hover::after {
  left: 100%;
}

/* ============================================================
   8. Utility Animation Classes
   ============================================================ */

.animate-pulse {
  animation: pulse 2s ease-in-out infinite;
}

.animate-float {
  animation: float 4s ease-in-out infinite;
}

.animate-glow {
  animation: glow 3s ease-in-out infinite;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .animate-on-scroll,
  .animate-on-scroll--scale,
  .animate-on-scroll--left,
  .animate-on-scroll--right {
    opacity: 1;
    transform: none;
  }

  .hero-particles,
  .particles {
    display: none;
  }
}


/* ============================================================
   9. Background Images — Body, Mission, Events
   ============================================================ */

/* Body background — subtle repeating pattern for color */
body {
  background-image: url('../assets/images/bg-body-pattern.svg');
  background-repeat: repeat;
  background-size: 400px 400px;
  background-attachment: fixed;
}

/* Mission section — colorful blobs and accents */
.mission {
  background-image: url('../assets/images/bg-mission.svg');
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
}

/* Events sections — calendar-inspired colored accents */
.events-preview,
.events-section {
  background-image: url('../assets/images/bg-events.svg');
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
}


/* Course section — modules and progress with book-inspired accents */
.course-section {
  background-image: url('../assets/images/bg-course.svg');
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
}

/* About page sections — team and values with vibrant shapes */
.about-story,
.about-stats,
.about-values,
.about-team {
  background-image: url('../assets/images/bg-about.svg');
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
}


/* How It Works section — step-inspired colorful background */
.how-it-works {
  background-image: url('../assets/images/bg-how-it-works.svg');
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
}
