/* ============================================================
   JANTA SCHOOL ERP — Animations Stylesheet
   animations.css
   ============================================================ */

/* ---- Keyframes Library ---- */

/* Fade variants */
@keyframes fadeIn         { from { opacity: 0; }              to { opacity: 1; } }
@keyframes fadeInUp       { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInDown     { 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); } }

/* Scale variants */
@keyframes scaleIn        { from { opacity: 0; transform: scale(0.8); } to { opacity: 1; transform: scale(1); } }
@keyframes scaleInBounce  { from { opacity: 0; transform: scale(0.5); } to { opacity: 1; transform: scale(1); } }
@keyframes popIn          { 0% { opacity: 0; transform: scale(0.6) translateY(20px); } 70% { transform: scale(1.05); } 100% { opacity: 1; transform: scale(1) translateY(0); } }

/* Slide variants */
@keyframes slideUp        { from { transform: translateY(100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes slideDown      { from { transform: translateY(-100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* Float & pulse */
@keyframes float          { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes floatReverse   { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(12px); } }
@keyframes spin           { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes spinSlow       { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes bounce         { 0%, 100% { transform: translateY(0); } 30% { transform: translateY(-20px); } 60% { transform: translateY(-10px); } }
@keyframes pulseShadow    { 0%, 100% { box-shadow: 0 0 0 0 rgba(37,99,235,0.4); } 50% { box-shadow: 0 0 0 12px rgba(37,99,235,0); } }
@keyframes shimmer        { 0% { background-position: -200% center; } 100% { background-position: 200% center; } }
@keyframes gradientShift  { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
@keyframes typing         { from { width: 0; } to { width: 100%; } }
@keyframes blink          { 0%, 100% { border-color: transparent; } 50% { border-color: currentColor; } }
@keyframes wiggle         { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
@keyframes zoomIn         { from { transform: scale(1.1); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes drawLine       { from { stroke-dashoffset: 1000; } to { stroke-dashoffset: 0; } }

/* Counter counting animation helper */
@keyframes countUp        { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* Loading skeleton */
@keyframes skeletonPulse  {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}
.skeleton {
  background: linear-gradient(90deg, var(--border-light) 25%, var(--border) 50%, var(--border-light) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

/* ---- Animation Utility Classes ---- */

/* Entry animations */
.anim-fade-in       { animation: fadeIn 0.6s ease forwards; }
.anim-fade-in-up    { animation: fadeInUp 0.7s ease forwards; }
.anim-fade-in-left  { animation: fadeInLeft 0.7s ease forwards; }
.anim-fade-in-right { animation: fadeInRight 0.7s ease forwards; }
.anim-scale-in      { animation: scaleIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }
.anim-pop-in        { animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }
.anim-slide-up      { animation: slideUp 0.5s ease forwards; }

/* Continuous animations */
.anim-float         { animation: float 5s ease-in-out infinite; }
.anim-float-slow    { animation: float 8s ease-in-out infinite; }
.anim-float-delay   { animation: float 6s ease-in-out infinite; animation-delay: -2s; }
.anim-spin          { animation: spin 2s linear infinite; }
.anim-spin-slow     { animation: spinSlow 12s linear infinite; }
.anim-bounce        { animation: bounce 2s ease infinite; }
.anim-pulse         { animation: pulseShadow 2s ease-in-out infinite; }
.anim-wiggle        { animation: wiggle 1s ease-in-out infinite; }

/* Gradient text animation */
.anim-gradient-text {
  background: linear-gradient(90deg, #2563EB, #7C3AED, #06B6D4, #10B981, #2563EB);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 4s ease infinite;
}

/* Shimmer button effect */
.btn-shimmer::after {
  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 2.5s ease infinite;
}

/* Delay helpers */
.anim-delay-100 { animation-delay: 0.1s; }
.anim-delay-200 { animation-delay: 0.2s; }
.anim-delay-300 { animation-delay: 0.3s; }
.anim-delay-400 { animation-delay: 0.4s; }
.anim-delay-500 { animation-delay: 0.5s; }
.anim-delay-600 { animation-delay: 0.6s; }
.anim-delay-700 { animation-delay: 0.7s; }
.anim-delay-800 { animation-delay: 0.8s; }

/* ---- Mouse Tilt Card ---- */
.tilt-card {
  transform-style: preserve-3d;
  transition: transform 0.1s ease;
}
.tilt-card-inner {
  transform-style: preserve-3d;
  transition: transform 0.1s ease;
}

/* ---- Hover Elevation ---- */
.hover-lift {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}
.hover-lift:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.12);
}

/* ---- Gradient Border on hover ---- */
.gradient-border {
  position: relative;
}
.gradient-border::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: var(--grad-primary);
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.3s;
  z-index: -1;
}
.gradient-border:hover::before { opacity: 1; }

/* ---- Animated Underline ---- */
.animated-underline {
  position: relative;
  display: inline-block;
}
.animated-underline::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0; right: 0;
  height: 2px;
  background: var(--grad-primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}
.animated-underline:hover::after { transform: scaleX(1); }

/* ---- Pricing Card Hover ---- */
.pricing-card {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease, border-color 0.3s;
}
.pricing-card:hover {
  transform: translateY(-12px) scale(1.02);
  box-shadow: 0 30px 60px rgba(37,99,235,0.15);
  border-color: var(--primary);
}
.pricing-card.featured {
  background: var(--grad-primary);
  color: #fff;
  transform: scale(1.05);
}
.pricing-card.featured:hover { transform: translateY(-12px) scale(1.07); }

/* ---- Loading Spinner ---- */
.loading-spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ---- Animated Icon Ring ---- */
.icon-ring {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.icon-ring::before {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px solid currentColor;
  opacity: 0.2;
  animation: pulseShadow 2s ease-in-out infinite;
}

/* ---- Lottie-like SVG animations ---- */
.svg-path-draw {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: drawLine 2s ease forwards;
}

/* ---- Number counter animation ---- */
.counter-number {
  animation: countUp 0.5s ease forwards;
}

/* ---- Blob background ---- */
.blob-bg {
  position: relative;
  overflow: hidden;
}
.blob-bg::before,
.blob-bg::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  pointer-events: none;
}
.blob-bg::before {
  width: 400px; height: 400px;
  background: rgba(37,99,235,0.12);
  top: -100px; right: -100px;
  animation: blobPulse 8s ease-in-out infinite;
}
.blob-bg::after {
  width: 300px; height: 300px;
  background: rgba(124,58,237,0.10);
  bottom: -80px; left: -80px;
  animation: blobPulse 10s ease-in-out infinite reverse;
}

/* ---- Image zoom on hover ---- */
.img-zoom-wrap {
  overflow: hidden;
  border-radius: inherit;
}
.img-zoom-wrap img {
  transition: transform 0.5s ease;
}
.img-zoom-wrap:hover img {
  transform: scale(1.06);
}

/* ---- Accordion animation ---- */
.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.3s ease;
  opacity: 0;
}
.accordion-body.open {
  opacity: 1;
}
.accordion-icon {
  transition: transform 0.3s ease;
}
.accordion-item.open .accordion-icon {
  transform: rotate(45deg);
}

/* ---- Timeline animation ---- */
.timeline-item {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.timeline-item.revealed {
  opacity: 1;
  transform: translateX(0);
}
.timeline-line {
  position: relative;
}
.timeline-line::before {
  content: '';
  position: absolute;
  left: 20px; top: 0; bottom: 0;
  width: 2px;
  background: var(--border);
}

/* ---- Hero title gradient animation ---- */
.hero-gradient-animate {
  background: linear-gradient(135deg, #60A5FA 0%, #A78BFA 33%, #34D399 66%, #FBBF24 100%);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 5s ease infinite;
}

/* ---- Notification dot pulse ---- */
.notif-dot {
  width: 10px; height: 10px;
  background: var(--danger);
  border-radius: 50%;
  animation: pulseShadow 1.5s ease-in-out infinite;
}

/* ---- Infinite floating icons ---- */
.floating-icon {
  animation: float 4s ease-in-out infinite;
}
.floating-icon:nth-child(2) { animation-delay: -1.3s; }
.floating-icon:nth-child(3) { animation-delay: -2.6s; }
.floating-icon:nth-child(4) { animation-delay: -0.7s; }
.floating-icon:nth-child(5) { animation-delay: -3.1s; }

/* ---- Stagger children animations (set by JS) ---- */
.stagger-children > * {
  opacity: 0;
  transform: translateY(20px);
}
.stagger-children.animating > *:nth-child(1) { animation: fadeInUp 0.5s 0.0s ease forwards; }
.stagger-children.animating > *:nth-child(2) { animation: fadeInUp 0.5s 0.1s ease forwards; }
.stagger-children.animating > *:nth-child(3) { animation: fadeInUp 0.5s 0.2s ease forwards; }
.stagger-children.animating > *:nth-child(4) { animation: fadeInUp 0.5s 0.3s ease forwards; }
.stagger-children.animating > *:nth-child(5) { animation: fadeInUp 0.5s 0.4s ease forwards; }
.stagger-children.animating > *:nth-child(6) { animation: fadeInUp 0.5s 0.5s ease forwards; }
.stagger-children.animating > *:nth-child(7) { animation: fadeInUp 0.5s 0.6s ease forwards; }
.stagger-children.animating > *:nth-child(8) { animation: fadeInUp 0.5s 0.7s ease forwards; }
.stagger-children.animating > *:nth-child(9) { animation: fadeInUp 0.5s 0.8s ease forwards; }
.stagger-children.animating > *:nth-child(10){ animation: fadeInUp 0.5s 0.9s ease forwards; }
.stagger-children.animating > *:nth-child(11){ animation: fadeInUp 0.5s 1.0s ease forwards; }
.stagger-children.animating > *:nth-child(12){ animation: fadeInUp 0.5s 1.1s ease forwards; }
.stagger-children.animating > *:nth-child(13){ animation: fadeInUp 0.5s 1.2s ease forwards; }
.stagger-children.animating > *:nth-child(14){ animation: fadeInUp 0.5s 1.3s ease forwards; }
.stagger-children.animating > *:nth-child(15){ animation: fadeInUp 0.5s 1.4s ease forwards; }
