/* =========================================================
   SBS College — Animations & Micro-interactions
   ========================================================= */

/* =============================================
   KEYFRAME ANIMATIONS
   ============================================= */

/* Fade In */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Fade In Up */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Fade In Down */
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Fade In Left */
@keyframes fadeInLeft {
  from { opacity: 0; transform: translateX(-30px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Fade In 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); }
}

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

/* Pulse */
@keyframes pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(244, 160, 21, 0.4); }
  50% { transform: scale(1.04); box-shadow: 0 0 0 12px rgba(244, 160, 21, 0); }
}

/* Shimmer */
@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

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

/* Bounce */
@keyframes bounce {
  0%, 20%, 53%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-16px); }
  60% { transform: translateY(-6px); }
}

/* Shake */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}

/* Glow pulse */
@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 10px rgba(244, 160, 21, 0.3); }
  50% { box-shadow: 0 0 30px rgba(244, 160, 21, 0.7); }
}

/* Slide in right (for ticker) */
@keyframes ticker-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Number count animation shimmer effect */
@keyframes countShimmer {
  0% { color: var(--accent-light); }
  50% { color: var(--white); }
  100% { color: var(--white); }
}

/* =============================================
   SCROLL-TRIGGERED ANIMATION CLASSES
   (applied via IntersectionObserver in JS)
   ============================================= */

.animate {
  opacity: 0;
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.animate.from-up { transform: translateY(35px); }
.animate.from-down { transform: translateY(-20px); }
.animate.from-left { transform: translateX(-35px); }
.animate.from-right { transform: translateX(35px); }
.animate.from-scale { transform: scale(0.92); }
.animate.visible {
  opacity: 1;
  transform: none;
}

/* Stagger delays for children */
.stagger-children > *:nth-child(1) { transition-delay: 0.05s; }
.stagger-children > *:nth-child(2) { transition-delay: 0.15s; }
.stagger-children > *:nth-child(3) { transition-delay: 0.25s; }
.stagger-children > *:nth-child(4) { transition-delay: 0.35s; }
.stagger-children > *:nth-child(5) { transition-delay: 0.45s; }
.stagger-children > *:nth-child(6) { transition-delay: 0.55s; }

/* =============================================
   HOVER MICRO-INTERACTIONS
   ============================================= */

/* Lift on hover */
.hover-lift {
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}
.hover-lift:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

/* Scale on hover */
.hover-scale {
  transition: transform var(--transition-base);
}
.hover-scale:hover { transform: scale(1.04); }

/* Glow on hover */
.hover-glow {
  transition: box-shadow var(--transition-base);
}
.hover-glow:hover { box-shadow: var(--shadow-glow); }

/* Underline animation */
.hover-underline {
  position: relative;
}
.hover-underline::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width var(--transition-base);
}
.hover-underline:hover::after { width: 100%; }

/* =============================================
   LOADING STATES
   ============================================= */

/* Skeleton shimmer */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 400% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

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

/* =============================================
   SPECIFIC COMPONENT ANIMATIONS
   ============================================= */

/* Hero section entrance */
.hero-content .hero-badge {
  animation: fadeInDown 0.6s ease 0.2s both;
}
.hero-content .hero-title {
  animation: fadeInUp 0.7s ease 0.35s both;
}
.hero-content .hero-subtitle {
  animation: fadeInUp 0.7s ease 0.5s both;
}
.hero-content .hero-actions {
  animation: fadeInUp 0.7s ease 0.65s both;
}

/* News ticker */
.ticker-inner {
  animation: ticker-scroll 38s linear infinite;
}

/* Floating badge */
.principal-badge {
  animation: float 4s ease-in-out infinite;
}

/* Stats numbers pulse when visible */
.stat-number.animating {
  animation: countShimmer 0.5s ease;
}

/* Accreditation cards */
.accred-item { transition: all var(--transition-base); }
.accred-item:hover { transform: translateY(-4px) scale(1.02); }

/* Course card icon pop */
.course-card:hover .course-icon {
  animation: bounce 0.6s ease;
}

/* Dept card icon pop */
.dept-card:hover .dept-icon {
  animation: scaleIn 0.3s ease;
}

/* Button ripple effect */
.btn {
  position: relative;
  overflow: hidden;
}
.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.15);
  border-radius: inherit;
  transform: scale(0);
  transition: transform 0.4s ease;
}
.btn:active::before { transform: scale(2); opacity: 0; transition: transform 0.6s ease, opacity 0.4s ease; }

/* Notice item slide in */
.notice-item {
  transition: transform var(--transition-fast), background var(--transition-fast);
}
.notice-item:hover { transform: translateX(4px); }

/* Step card entrance */
.step-card {
  animation: fadeInUp 0.6s ease both;
}
.process-steps .step-card:nth-child(1) { animation-delay: 0.1s; }
.process-steps .step-card:nth-child(2) { animation-delay: 0.2s; }
.process-steps .step-card:nth-child(3) { animation-delay: 0.3s; }
.process-steps .step-card:nth-child(4) { animation-delay: 0.4s; }

/* Scroll to top button */
.scroll-top {
  animation: none;
}
.scroll-top.visible {
  animation: scaleIn 0.3s ease;
}

/* Page banner decorative circles */
.page-banner-bg::before {
  animation: float 6s ease-in-out infinite;
}
.page-banner-bg::after {
  animation: float 8s ease-in-out infinite reverse;
}

/* Gallery item */
.gallery-item .gallery-overlay { transition: opacity var(--transition-base); }

/* Form focus animation */
.form-group input:focus,
.form-group textarea:focus {
  animation: none;
}
.form-group.success input { border-color: var(--success); }
.form-group.error input { border-color: var(--danger); animation: shake 0.4s ease; }

/* Research card border animation */
.research-centre-card {
  border-left-color: var(--primary);
  transition: border-left-color var(--transition-base), box-shadow var(--transition-base), transform var(--transition-base);
}
.research-centre-card:hover { border-left-color: var(--accent); }

/* Timeline dot pulse */
.timeline-dot { animation: glowPulse 2s ease-in-out infinite; }

/* =============================================
   REDUCED MOTION SUPPORT
   ============================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .ticker-inner { animation: none; }
  .principal-badge { animation: none; }
  .timeline-dot { animation: none; }
}
