/* ============================================================
   THE INSPIRE INDIA - Animations CSS
   ============================================================ */

/* ============================================================
   KEYFRAMES
   ============================================================ */
@keyframes float-card {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-16px); }
}

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

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

@keyframes preloader-progress {
  0%   { width: 0%; }
  30%  { width: 40%; }
  60%  { width: 70%; }
  80%  { width: 88%; }
  100% { width: 100%; }
}

@keyframes scroll-wheel {
  0%   { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(16px); opacity: 0; }
}

@keyframes marquee-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

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

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

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

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

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

@keyframes slideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

@keyframes ripple {
  0%   { transform: scale(0); opacity: 0.5; }
  100% { transform: scale(4); opacity: 0; }
}

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

@keyframes bounce-in {
  0%   { transform: scale(0.3); opacity: 0; }
  50%  { transform: scale(1.05); }
  70%  { transform: scale(0.9); }
  100% { transform: scale(1); opacity: 1; }
}

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

@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 20px rgba(232,69,30,0.3); }
  50%       { box-shadow: 0 0 40px rgba(232,69,30,0.6); }
}

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

@keyframes text-wave {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}

@keyframes count-up {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Geometric shapes */
@keyframes orbit {
  0%   { transform: rotate(0deg) translateX(60px) rotate(0deg); }
  100% { transform: rotate(360deg) translateX(60px) rotate(-360deg); }
}

@keyframes morph {
  0%, 100% { border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%; }
  34%       { border-radius: 70% 30% 50% 50% / 30% 30% 70% 70%; }
  67%       { border-radius: 100% 60% 60% 100% / 100% 100% 60% 60%; }
}

/* ============================================================
   AOS (Animate on Scroll) CUSTOM ANIMATIONS
   Using AOS library with custom classes
   ============================================================ */
[data-aos="fade-up"] {
  transform: translateY(40px);
  opacity: 0;
  transition-property: transform, opacity;
}
[data-aos="fade-up"].aos-animate {
  transform: translateY(0);
  opacity: 1;
}

[data-aos="fade-left"] {
  transform: translateX(40px);
  opacity: 0;
  transition-property: transform, opacity;
}
[data-aos="fade-left"].aos-animate {
  transform: translateX(0);
  opacity: 1;
}

[data-aos="fade-right"] {
  transform: translateX(-40px);
  opacity: 0;
  transition-property: transform, opacity;
}
[data-aos="fade-right"].aos-animate {
  transform: translateX(0);
  opacity: 1;
}

[data-aos="zoom-in"] {
  transform: scale(0.8);
  opacity: 0;
  transition-property: transform, opacity;
}
[data-aos="zoom-in"].aos-animate {
  transform: scale(1);
  opacity: 1;
}

[data-aos="flip-up"] {
  transform: perspective(2500px) rotateX(-20deg);
  opacity: 0;
  transition-property: transform, opacity;
}
[data-aos="flip-up"].aos-animate {
  transform: perspective(2500px) rotateX(0);
  opacity: 1;
}

/* ============================================================
   HERO ANIMATIONS
   ============================================================ */
.hero-text .hero-badge {
  animation: fadeInDown 0.8s ease-out both;
}

.hero-title {
  animation: fadeInUp 0.9s ease-out 0.2s both;
}

.hero-tagline {
  animation: fadeInUp 0.9s ease-out 0.35s both;
}

.hero-desc {
  animation: fadeInUp 0.9s ease-out 0.5s both;
}

.hero-actions {
  animation: fadeInUp 0.9s ease-out 0.65s both;
}

.hero-stats {
  animation: fadeInUp 0.9s ease-out 0.8s both;
}

.hero-visual {
  animation: fadeInRight 1s ease-out 0.4s both;
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   TYPING EFFECT
   ============================================================ */
.typing-cursor {
  display: inline-block;
  width: 3px;
  height: 1em;
  background: var(--primary-light);
  margin-left: 4px;
  animation: cursor-blink 1s step-end infinite;
  vertical-align: text-bottom;
}

@keyframes cursor-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* ============================================================
   COUNTER ANIMATION
   ============================================================ */
.counter-animated {
  animation: count-up 0.6s ease-out both;
}

/* ============================================================
   BUTTON RIPPLE
   ============================================================ */
.btn .ripple-effect {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.35);
  transform: scale(0);
  animation: ripple 0.6s linear;
  pointer-events: none;
}

/* ============================================================
   PAGE TRANSITIONS
   ============================================================ */
.page-transition-overlay {
  position: fixed;
  inset: 0;
  background: var(--primary);
  z-index: 9999;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.5s cubic-bezier(0.77, 0, 0.175, 1);
  pointer-events: none;
}

.page-transition-overlay.entering {
  transform: scaleX(1);
  transform-origin: left;
}

/* ============================================================
   GRADIENT TEXT
   ============================================================ */
.gradient-text {
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gradient-text-animated {
  background: linear-gradient(270deg, #E8451E, #F7C948, #E8451E, #FF6B3D);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradient-shift 4s ease infinite;
}

/* ============================================================
   BLOB SHAPES (decorative)
   ============================================================ */
.blob-shape {
  position: absolute;
  border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
  animation: morph 8s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

.blob-1 {
  width: 400px;
  height: 400px;
  background: rgba(232,69,30,0.06);
  top: -100px;
  right: -100px;
  animation-delay: 0s;
}

.blob-2 {
  width: 300px;
  height: 300px;
  background: rgba(27,58,107,0.06);
  bottom: -80px;
  left: -80px;
  animation-delay: -4s;
}

/* ============================================================
   3D CARD HOVER
   ============================================================ */
.card-3d {
  transform-style: preserve-3d;
  transform: perspective(1000px);
  transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1), box-shadow 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

@media (hover: hover) and (pointer: fine) {
  .card-3d:hover {
    transform: perspective(1000px) rotateX(4deg) rotateY(-4deg) translateZ(10px);
  }
}

/* ============================================================
   GLOW EFFECTS — subtle shadow, no outer neon glow
   ============================================================ */
.glow-primary {
  box-shadow: 0 8px 32px rgba(232,69,30,0.2);
  transition: box-shadow 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

@media (hover: hover) and (pointer: fine) {
  .glow-primary:hover {
    box-shadow: 0 12px 40px rgba(232,69,30,0.32);
  }
}

/* ============================================================
   SHIMMER (loading state)
   ============================================================ */
.shimmer {
  background: linear-gradient(90deg, #f0f2f5 25%, #e8eaed 50%, #f0f2f5 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* ============================================================
   PARALLAX
   ============================================================ */
.parallax-bg {
  background-attachment: fixed;
  background-size: cover;
  background-position: center;
}

/* ============================================================
   NOTIFICATION TOAST
   ============================================================ */
.toast {
  position: fixed;
  top: 100px;
  right: 24px;
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 16px 24px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 9000;
  transform: translateY(-16px) translateX(0);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.36s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.28s ease;
  max-width: 360px;
  border: 1px solid rgba(39,174,96,0.2);
  border-top: 3px solid var(--green);
}

.toast.show {
  transform: translateY(0) translateX(0);
  opacity: 1;
  pointer-events: auto;
}
.toast.error { border-top-color: var(--primary); border-color: rgba(232,69,30,0.18); }
.toast.warning { border-top-color: var(--accent); border-color: rgba(247,201,72,0.22); }

.toast-icon { font-size: 1.3rem; color: var(--green); flex-shrink: 0; }
.toast.error .toast-icon { color: var(--primary); }
.toast.warning .toast-icon { color: var(--accent); }

.toast-message { font-size: 0.875rem; color: var(--text-dark); line-height: 1.5; }

/* ============================================================
   FLOATING ELEMENTS (decorative)
   ============================================================ */
.floating-shapes {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.floating-shape {
  position: absolute;
  opacity: 0.05;
  animation: float-card 8s ease-in-out infinite;
}

.floating-shape.circle {
  border-radius: 50%;
  background: var(--white);
}

.floating-shape.square {
  border-radius: 12px;
  background: var(--white);
  transform: rotate(45deg);
}

/* ============================================================
   SCROLL PROGRESS BAR
   ============================================================ */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--grad-primary);
  z-index: 9999;
  width: 0%;
  transition: width 0.1s linear;
}

/* ============================================================
   HOVER LIFT CLASSES
   ============================================================ */
.hover-lift {
  transition: transform 0.28s cubic-bezier(0.23, 1, 0.32, 1), box-shadow 0.28s cubic-bezier(0.23, 1, 0.32, 1);
}

@media (hover: hover) and (pointer: fine) {
  .hover-lift:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
  }
}

.hover-scale {
  transition: transform 0.28s cubic-bezier(0.23, 1, 0.32, 1);
}

@media (hover: hover) and (pointer: fine) {
  .hover-scale:hover {
    transform: scale(1.03);
  }
}

/* ============================================================
   WAVY DIVIDER
   ============================================================ */
.wave-divider {
  position: relative;
  overflow: hidden;
}

.wave-divider svg {
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: auto;
}

/* ============================================================
   COUNTERS
   ============================================================ */
.stats-section .stat-number {
  animation: none;
}

.stats-section.animated .stat-number {
  animation: count-up 0.6s ease-out both;
}

/* ============================================================
   REDUCED MOTION — graceful degradation, not total disable
   Keep color/opacity for comprehension; remove movement/position
   ============================================================ */
/* ============================================================
   AOS VISIBILITY FALLBACK
   Belt-and-suspenders: if AOS never adds .aos-animate (e.g. slow CDN, file://)
   a CSS animation forces elements visible after a brief delay.
   The JS safety net in main.js adds .aos-animate after 2s, which makes
   the transition actually play. This CSS fallback ensures content is
   NEVER permanently hidden regardless of JS timing.
   ============================================================ */
[data-aos]:not(.aos-animate) {
  animation: aos-fallback-show 0.01ms 2.5s forwards;
}

@keyframes aos-fallback-show {
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  /* Stop continuous animations */
  .blob-shape,
  .floating-shape,
  .hero-main-card,
  .hero-float,
  .scroll-wheel,
  .typing-cursor,
  .partners-marquee,
  .glow-primary {
    animation: none !important;
  }

  /* Reduce entrance animations to simple fades */
  .hero-text .hero-badge,
  .hero-title,
  .hero-tagline,
  .hero-desc,
  .hero-actions,
  .hero-stats,
  .hero-visual,
  .hero::before,
  .hero::after,
  #particles-js,
  .badge-glow,
  .gold-shimmer,
  .progress-glow,
  .aurora-drift,
  .blob-shift,
  .grid-move {
    animation: fadeIn 0.3s ease both !important;
  }

  /* Disable transform transitions — keep color/opacity */
  .btn,
  .hover-lift,
  .hover-scale,
  .card-3d,
  .nav-donate-btn,
  [data-aos] {
    transition: color 0.2s ease, background-color 0.2s ease, opacity 0.2s ease !important;
    transform: none !important;
  }

  /* Show AOS elements immediately */
  [data-aos] {
    opacity: 1 !important;
    transform: none !important;
  }
}
