/* ============================================================
   TECHNOOCEAN DESIGN SYSTEM — Animations & Effects
   ============================================================ */

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

/* Slide In (from bottom) */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(100%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Scale In */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

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

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

/* Glow (box-shadow pulse) */
@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 10px rgb(var(--color-primary-rgb) / 0.2);
  }
  50% {
    box-shadow: 0 0 25px rgb(var(--color-primary-rgb) / 0.4);
  }
}

/* Typewriter */
@keyframes typewriter {
  from { width: 0; }
  to { width: 100%; }
}

/* Cursor Blink */
@keyframes blink {
  0%, 100% { border-color: transparent; }
  50% { border-color: var(--color-primary); }
}

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

/* Count Up helper (shake) */
@keyframes countUp {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }
  60% {
    opacity: 1;
    transform: translateY(-3px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ----------------------------------------------------------
   Scroll-Triggered Animations
   ---------------------------------------------------------- */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Direction variants */
.animate-on-scroll.animate-left {
  transform: translateX(-30px);
}

.animate-on-scroll.animate-left.visible {
  transform: translateX(0);
}

.animate-on-scroll.animate-right {
  transform: translateX(30px);
}

.animate-on-scroll.animate-right.visible {
  transform: translateX(0);
}

.animate-on-scroll.animate-scale {
  transform: scale(0.95);
}

.animate-on-scroll.animate-scale.visible {
  transform: scale(1);
}

/* Staggered delays */
.animate-delay-1 { transition-delay: 0.1s; }
.animate-delay-2 { transition-delay: 0.2s; }
.animate-delay-3 { transition-delay: 0.3s; }
.animate-delay-4 { transition-delay: 0.4s; }
.animate-delay-5 { transition-delay: 0.5s; }

/* ----------------------------------------------------------
   Hover Effects
   ---------------------------------------------------------- */

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

.hover-lift:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

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

.hover-glow:hover {
  box-shadow: 0 0 30px rgb(var(--color-primary-rgb) / 0.25);
}

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

.hover-scale:hover {
  transform: scale(1.05);
}

/* ----------------------------------------------------------
   Parallax
   ---------------------------------------------------------- */
.parallax-subtle {
  will-change: transform;
  transition: transform 0.1s linear;
}

/* ----------------------------------------------------------
   Gradient Text
   ---------------------------------------------------------- */
.gradient-text {
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ----------------------------------------------------------
   Skeleton Loading Placeholder
   ---------------------------------------------------------- */
.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--color-bg-alt);
  border-radius: var(--radius-md);
  color: transparent !important;
  pointer-events: none;
  user-select: none;
}

.skeleton * {
  visibility: hidden;
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.5) 50%,
    transparent 100%
  );
  animation: skeletonShimmer 1.5s ease-in-out infinite;
}

@keyframes skeletonShimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* Skeleton variants */
.skeleton-text {
  height: 1em;
  margin-bottom: 0.5em;
  border-radius: var(--radius-sm);
}

.skeleton-text:last-child {
  width: 70%;
}

.skeleton-heading {
  height: 2em;
  width: 60%;
  margin-bottom: 0.75em;
  border-radius: var(--radius-sm);
}

.skeleton-avatar {
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius-full);
}

.skeleton-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg);
}

.skeleton-button {
  height: 2.75rem;
  width: 10rem;
  border-radius: var(--radius-lg);
}

/* ----------------------------------------------------------
   Spinner (CSS-only loading indicator)
   ---------------------------------------------------------- */
.spinner {
  display: inline-block;
  width: 2rem;
  height: 2rem;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: var(--radius-full);
  animation: spin 0.7s linear infinite;
}

.spinner-sm {
  width: 1.25rem;
  height: 1.25rem;
  border-width: 2px;
}

.spinner-lg {
  width: 3rem;
  height: 3rem;
  border-width: 4px;
}

/* Dots variant */
.spinner-dots {
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
}

.spinner-dots span {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  animation: dotPulse 1.2s ease-in-out infinite;
}

.spinner-dots span:nth-child(2) {
  animation-delay: 0.15s;
}

.spinner-dots span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes dotPulse {
  0%, 80%, 100% {
    transform: scale(0.6);
    opacity: 0.4;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* ----------------------------------------------------------
   Utility Animation Classes
   ---------------------------------------------------------- */
.animate-fadeIn {
  animation: fadeIn 0.5s ease both;
}

.animate-fadeInUp {
  animation: fadeInUp 0.6s ease both;
}

.animate-fadeInLeft {
  animation: fadeInLeft 0.6s ease both;
}

.animate-fadeInRight {
  animation: fadeInRight 0.6s ease both;
}

.animate-scaleIn {
  animation: scaleIn 0.5s ease both;
}

.animate-float {
  animation: float 3s ease-in-out infinite;
}

.animate-pulse {
  animation: pulse 2s ease-in-out infinite;
}

.animate-glow {
  animation: glow 2s ease-in-out infinite;
}

.animate-spin {
  animation: spin 1s linear infinite;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .animate-on-scroll {
    opacity: 1;
    transform: none;
  }

  .hover-lift:hover,
  .hover-scale:hover {
    transform: none;
  }
}
