/* ============================================================
   GURUDEV INTERNATIONAL PUBLIC SCHOOL — ANIMATIONS
   ============================================================ */

/* ============================================================
   KEYFRAME DEFINITIONS
   ============================================================ */

/* Fade & Slide Animations */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(40px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

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

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

@keyframes zoomIn {
  from { opacity: 0; transform: scale(0.85); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes zoomOut {
  from { opacity: 0; transform: scale(1.15); }
  to   { opacity: 1; transform: scale(1); }
}

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

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

/* Float / Hover */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-12px); }
}

@keyframes float-shape {
  0%   { transform: translate(0, 0) scale(1); }
  33%  { transform: translate(30px, -30px) scale(1.05); }
  66%  { transform: translate(-20px, 20px) scale(0.95); }
  100% { transform: translate(0, 0) scale(1); }
}

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

@keyframes pulse-text {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

@keyframes pulse-ring {
  0%   { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.5); }
  70%  { box-shadow: 0 0 0 20px rgba(212, 175, 55, 0); }
  100% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0); }
}

/* Marquee */
@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* Gradient Shift */
@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Ripple Effect */
@keyframes ripple-effect {
  to { transform: scale(4); opacity: 0; }
}

/* Scroll Dot */
@keyframes scroll-dot {
  0%   { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(10px); opacity: 0; }
}

/* Shimmer (Skeleton) */
@keyframes shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

/* Wave */
@keyframes wave-motion {
  0%   { transform: translateX(0); }
  50%  { transform: translateX(-25%); }
  100% { transform: translateX(-50%); }
}

/* Text Reveal */
@keyframes text-reveal {
  from { clip-path: inset(0 100% 0 0); }
  to   { clip-path: inset(0 0% 0 0); }
}

/* Blob Morph */
@keyframes blobMorph {
  0%   { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
  50%  { border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; }
  100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
}

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

/* Draw underline */
@keyframes drawLine {
  from { width: 0; }
  to   { width: 100%; }
}

/* Glow */
@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 20px rgba(212, 175, 55, 0.3); }
  50%       { box-shadow: 0 0 40px rgba(212, 175, 55, 0.7); }
}

/* Appear from bottom stagger */
@keyframes staggerFadeUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   INTERSECTION OBSERVER CLASSES
   (Applied by animations.js when elements enter viewport)
   ============================================================ */

/* Initial states — invisible before animation */
[data-aos] { opacity: 0; will-change: opacity, transform; }

[data-aos="fade-up"]    { transform: translateY(40px); }
[data-aos="fade-down"]  { transform: translateY(-40px); }
[data-aos="fade-left"]  { transform: translateX(50px); }
[data-aos="fade-right"] { transform: translateX(-50px); }
[data-aos="zoom-in"]    { transform: scale(0.85); }
[data-aos="zoom-out"]   { transform: scale(1.15); }
[data-aos="flip-left"]  { transform: perspective(400px) rotateY(30deg); }
[data-aos="flip-right"] { transform: perspective(400px) rotateY(-30deg); }

/* Animated state */
[data-aos].aos-animate {
  opacity: 1;
  transform: none;
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Delay utilities */
[data-aos-delay="100"].aos-animate { transition-delay: 100ms; }
[data-aos-delay="200"].aos-animate { transition-delay: 200ms; }
[data-aos-delay="300"].aos-animate { transition-delay: 300ms; }
[data-aos-delay="400"].aos-animate { transition-delay: 400ms; }
[data-aos-delay="500"].aos-animate { transition-delay: 500ms; }
[data-aos-delay="600"].aos-animate { transition-delay: 600ms; }
[data-aos-delay="700"].aos-animate { transition-delay: 700ms; }
[data-aos-delay="800"].aos-animate { transition-delay: 800ms; }

/* ============================================================
   HOVER ANIMATION CLASSES
   ============================================================ */

/* Card lift */
.hover-lift {
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.hover-lift:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 60px rgba(11, 61, 145, 0.2);
}

/* Image zoom */
.img-hover-zoom { overflow: hidden; }
.img-hover-zoom img {
  transition: transform 0.6s ease;
}
.img-hover-zoom:hover img { transform: scale(1.06); }

/* Glow on hover */
.hover-glow {
  transition: box-shadow 0.3s ease;
}
.hover-glow:hover {
  box-shadow: 0 0 30px rgba(212, 175, 55, 0.4);
}

/* Animated underline */
.animated-underline {
  position: relative;
  display: inline-block;
}
.animated-underline::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--primary));
  transition: width 0.4s ease;
}
.animated-underline:hover::after { width: 100%; }

/* 3D Tilt (JS controlled via data attribute) */
.tilt-card {
  transform-style: preserve-3d;
  transition: transform 0.15s ease;
}

/* Float animation class */
.anim-float { animation: float 3s ease-in-out infinite; }

/* Spin animation class */
.anim-spin { animation: spin 2s linear infinite; }

/* Blob animation */
.anim-blob {
  animation: blobMorph 8s ease-in-out infinite;
}

/* Gradient text animation */
.anim-gradient-text {
  background: linear-gradient(270deg, var(--accent), var(--primary-light), var(--accent));
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 4s ease infinite;
}

/* Glow pulse */
.anim-glow { animation: glowPulse 2.5s ease-in-out infinite; }

/* Page transition overlay */
.page-transition-overlay {
  position: fixed;
  inset: 0;
  background: var(--primary);
  z-index: 9999;
  transform: translateX(-100%);
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.page-transition-overlay.sliding-in  { transform: translateX(0); }
.page-transition-overlay.sliding-out { transform: translateX(100%); }

/* ============================================================
   PARTICLE CANVAS
   ============================================================ */
#particle-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

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

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

/* ============================================================
   SCROLL PROGRESS ANIMATION
   ============================================================ */
@keyframes progress-glow {
  0%, 100% { box-shadow: 0 0 8px rgba(212, 175, 55, 0.5); }
  50%       { box-shadow: 0 0 16px rgba(212, 175, 55, 0.9); }
}

#scroll-progress { animation: progress-glow 2s ease-in-out infinite; }

/* ============================================================
   TIMELINE ANIMATION
   ============================================================ */
.timeline {
  position: relative;
  padding: 20px 0;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), var(--primary), var(--accent));
  transform: translateX(-50%);
}

.timeline-item {
  display: flex;
  justify-content: flex-end;
  padding-right: calc(50% + 40px);
  margin-bottom: 50px;
  position: relative;
  opacity: 0;
  transition: opacity 0.6s ease, transform 0.6s ease;
  transform: translateX(-30px);
}

.timeline-item:nth-child(even) {
  justify-content: flex-start;
  padding-right: 0;
  padding-left: calc(50% + 40px);
  transform: translateX(30px);
}

.timeline-item.in-view {
  opacity: 1;
  transform: translateX(0);
}

.timeline-dot {
  position: absolute;
  left: 50%;
  top: 20px;
  width: 16px;
  height: 16px;
  background: var(--accent);
  border: 3px solid var(--secondary);
  border-radius: 50%;
  transform: translateX(-50%);
  box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.2);
}

.timeline-content {
  background: var(--secondary);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
  max-width: 380px;
  width: 100%;
  transition: var(--transition-normal);
}

.timeline-content:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-lg);
}

.timeline-year {
  font-family: var(--font-accent);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.timeline-title {
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.timeline-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ============================================================
   LOGO INFINITE SLIDER
   ============================================================ */
.logo-slider {
  overflow: hidden;
  background: var(--bg-section);
  padding: 30px 0;
  position: relative;
}

.logo-slider-track {
  display: flex;
  align-items: center;
  gap: 60px;
  animation: marquee-scroll 20s linear infinite;
  width: max-content;
}

.logo-slider-track:hover { animation-play-state: paused; }

.logo-slide-item {
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0.5;
  transition: opacity var(--transition-fast);
  white-space: nowrap;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.logo-slide-item:hover { opacity: 1; color: var(--primary); }

/* ============================================================
   HERO BLOB BACKGROUNDS
   ============================================================ */
.hero-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
}

.hero-blob-1 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(11, 61, 145, 0.3), transparent);
  top: -200px;
  right: -200px;
  animation: float-shape 12s ease-in-out infinite;
}

.hero-blob-2 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.15), transparent);
  bottom: -100px;
  left: -100px;
  animation: float-shape 10s ease-in-out infinite reverse;
}

/* ============================================================
   SECTION REVEAL (Used with IntersectionObserver)
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal-left.revealed {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(50px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal-right.revealed {
  opacity: 1;
  transform: translateX(0);
}

/* ============================================================
   MOUSE GLOW EFFECT
   ============================================================ */
.mouse-glow {
  position: fixed;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(11, 61, 145, 0.06) 0%, transparent 70%);
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 0;
  transition: transform 0.15s ease;
}
