/* ============================================
   NEXUSWEB - Animations & Keyframes
   ============================================ */

/* ----- 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(-30px);
  }
  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);
  }
}

/* ----- Glow Pulse ----- */
@keyframes glowPulse {
  0%, 100% {
    box-shadow: 0 0 20px rgba(79, 124, 255, 0.15);
  }
  50% {
    box-shadow: 0 0 40px rgba(79, 124, 255, 0.3);
  }
}

/* ----- Spin ----- */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ----- Float Animation (already in style.css for hero, but general) ----- */
@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-15px);
  }
}

/* ----- Typing Cursor ----- */
@keyframes blink {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

/* ----- Gradient Shift (for backgrounds) ----- */
@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* ============================================
   SCROLL-TRIGGERED ANIMATION CLASSES
   ============================================ */

/* Initial state - hidden */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.animate-on-scroll.animate-left {
  transform: translateX(-30px);
}

.animate-on-scroll.animate-right {
  transform: translateX(30px);
}

.animate-on-scroll.animate-scale {
  transform: scale(0.9);
}

/* Visible state */
.animate-on-scroll.animated {
  opacity: 1;
  transform: translateY(0) translateX(0) scale(1);
}

/* Stagger delays for children */
.stagger-children > .animate-on-scroll:nth-child(1) { transition-delay: 0ms; }
.stagger-children > .animate-on-scroll:nth-child(2) { transition-delay: 100ms; }
.stagger-children > .animate-on-scroll:nth-child(3) { transition-delay: 200ms; }
.stagger-children > .animate-on-scroll:nth-child(4) { transition-delay: 300ms; }
.stagger-children > .animate-on-scroll:nth-child(5) { transition-delay: 400ms; }
.stagger-children > .animate-on-scroll:nth-child(6) { transition-delay: 500ms; }
.stagger-children > .animate-on-scroll:nth-child(7) { transition-delay: 600ms; }
.stagger-children > .animate-on-scroll:nth-child(8) { transition-delay: 700ms; }

/* ============================================
   LOADING SPINNER
   ============================================ */
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--color-border);
  border-top: 3px solid var(--color-accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: var(--space-8) auto;
}

/* ============================================
   PAGE TRANSITION
   ============================================ */
.page-transition {
  animation: fadeInUp 0.6s ease forwards;
}

/* ============================================
   COUNTER ANIMATION
   ============================================ */
.counter-value {
  display: inline-block;
}

/* ============================================
   HOVER EFFECTS
   ============================================ */

/* Card lift */
.hover-lift {
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

/* Image zoom */
.hover-zoom {
  overflow: hidden;
}

.hover-zoom img {
  transition: transform var(--transition-slow);
}

.hover-zoom:hover img {
  transform: scale(1.05);
}

/* Border glow */
.hover-glow {
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.hover-glow:hover {
  border-color: var(--color-accent-primary);
  box-shadow: 0 0 20px rgba(79, 124, 255, 0.15);
}

/* ============================================
   SKELETON LOADING STATES
   ============================================ */
.skeleton-card {
  padding: var(--space-6);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.skeleton-card .skeleton-image {
  width: 100%;
  aspect-ratio: 16/9;
  margin-bottom: var(--space-4);
}

.skeleton-card .skeleton-title {
  height: 24px;
  width: 70%;
  margin-bottom: var(--space-3);
}

.skeleton-card .skeleton-text {
  height: 14px;
  width: 100%;
  margin-bottom: var(--space-2);
}

.skeleton-card .skeleton-text:last-child {
  width: 60%;
}

/* ============================================
   MOBILE MENU OVERLAY
   ============================================ */
.mobile-menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: calc(var(--z-overlay) - 1);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}

.mobile-menu-overlay.visible {
  opacity: 1;
  visibility: visible;
}

/* ============================================
   SMOOTH SCROLL INDICATOR
   ============================================ */
.scroll-indicator {
  position: absolute;
  bottom: var(--space-8);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-text-tertiary);
  font-size: var(--font-size-xs);
  animation: fadeInUp 1s ease 2s forwards;
  opacity: 0;
}

.scroll-indicator .mouse {
  width: 24px;
  height: 38px;
  border: 2px solid var(--color-text-tertiary);
  border-radius: 12px;
  position: relative;
}

.scroll-indicator .mouse::after {
  content: '';
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  height: 8px;
  background: var(--color-accent-primary);
  border-radius: 2px;
  animation: scrollWheel 1.5s ease-in-out infinite;
}

@keyframes scrollWheel {
  0% {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(12px);
  }
}

/* ============================================
   GLOWING ORB (background decoration)
   ============================================ */
.glow-orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(80px);
  opacity: 0.4;
}

.glow-orb.blue {
  background: rgba(79, 124, 255, 0.15);
}

.glow-orb.teal {
  background: rgba(0, 212, 170, 0.1);
}

.glow-orb.purple {
  background: rgba(139, 92, 246, 0.1);
}
