/*
 * animations.css
 * Jios2 — All @keyframes and animation utility classes
 */

/* ─── Keyframes ─────────────────────────────── */

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

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

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

@keyframes slideFromBottom {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(.9); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes scaleInBounce {
  0%   { opacity: 0; transform: scale(.8); }
  70%  { transform: scale(1.04); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .5; }
}

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

@keyframes shimmer {
  0%   { background-position: -400% 0; }
  100% { background-position:  400% 0; }
}

@keyframes ripple {
  to { transform: scale(4); opacity: 0; }
}

@keyframes drawCheck {
  from { stroke-dashoffset: 48; }
  to   { stroke-dashoffset: 0; }
}

@keyframes radarPulse {
  0%   { transform: scale(1);   opacity: .6; }
  100% { transform: scale(1.6); opacity: 0; }
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); animation-timing-function: cubic-bezier(.8,0,1,1); }
  50%       { transform: translateY(-8px); animation-timing-function: cubic-bezier(0,0,.2,1); }
}

@keyframes heartbeat {
  0%   { transform: scale(1); }
  14%  { transform: scale(1.2); }
  28%  { transform: scale(1); }
  42%  { transform: scale(1.15); }
  70%  { transform: scale(1); }
}

@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ─── Animation Utilities ───────────────────── */

.anim-fade-in       { animation: fadeIn         .4s ease both; }
.anim-fade-in-up    { animation: fadeInUp        .5s cubic-bezier(.16,1,.3,1) both; }
.anim-fade-in-down  { animation: fadeInDown      .5s cubic-bezier(.16,1,.3,1) both; }
.anim-slide-left    { animation: slideFromLeft   .6s cubic-bezier(.16,1,.3,1) both; }
.anim-slide-right   { animation: slideFromRight  .6s cubic-bezier(.16,1,.3,1) both; }
.anim-slide-bottom  { animation: slideFromBottom .5s cubic-bezier(.16,1,.3,1) both; }
.anim-scale-in      { animation: scaleIn         .3s cubic-bezier(.16,1,.3,1) both; }
.anim-scale-bounce  { animation: scaleInBounce   .5s cubic-bezier(.16,1,.3,1) both; }
.anim-float         { animation: float           3s ease-in-out infinite; }
.anim-pulse         { animation: pulse           2s ease-in-out infinite; }
.anim-spin          { animation: spin            1s linear infinite; }
.anim-bounce        { animation: bounce          1s infinite; }
.anim-heartbeat     { animation: heartbeat       1.4s ease both; }
.anim-draw-check    {
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: drawCheck .6s cubic-bezier(.16,1,.3,1) .2s forwards;
}
.anim-radar-pulse   { animation: radarPulse 2s ease-out infinite; }

/* Stagger delays */
.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
.delay-400 { animation-delay: 400ms; }
.delay-500 { animation-delay: 500ms; }
.delay-600 { animation-delay: 600ms; }
.delay-800 { animation-delay: 800ms; }

/* ─── Hover Micro-Interactions ──────────────── */

/* Card lift */
.hover-lift {
  transition: transform var(--tr-normal), box-shadow var(--tr-normal);
}
.hover-lift:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-card-hover);
}

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

/* Button press */
.press-effect:active { transform: scale(.96); }

/* Shine effect on hover */
.hover-shine {
  position: relative;
  overflow: hidden;
}

.hover-shine::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 60%; height: 100%;
  background: linear-gradient(
    105deg,
    transparent 0%,
    rgba(255,255,255,.25) 50%,
    transparent 100%
  );
  transform: skewX(-15deg);
  transition: left .6s ease;
}

.hover-shine:hover::after { left: 150%; }

/* Nav underline reveal */
.nav-underline {
  position: relative;
}

.nav-underline::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 50%;
  width: 0; height: 2px;
  background: var(--clr-gradient);
  border-radius: var(--r-full);
  transform: translateX(-50%);
  transition: width var(--tr-normal);
}

.nav-underline:hover::after { width: 80%; }

/* Gradient animated background */
.gradient-animated {
  background: linear-gradient(270deg, hsl(225,70%,55%), hsl(262,60%,58%), hsl(290,60%,55%));
  background-size: 300% 300%;
  animation: gradientShift 8s ease infinite;
}

/* ─── Page Transition ───────────────────────── */

.page-enter {
  animation: fadeInUp .4s cubic-bezier(.16,1,.3,1) both;
}

/* ─── Scroll Reveal (JS driven) ─────────────── */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .6s cubic-bezier(.16,1,.3,1), transform .6s cubic-bezier(.16,1,.3,1);
}

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

.reveal-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity .6s cubic-bezier(.16,1,.3,1), transform .6s cubic-bezier(.16,1,.3,1);
}

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

.reveal-right {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity .6s cubic-bezier(.16,1,.3,1), transform .6s cubic-bezier(.16,1,.3,1);
}

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

/* ─── Loading States ────────────────────────── */

.spinner {
  width: 24px; height: 24px;
  border: 2.5px solid var(--bg-overlay);
  border-top-color: var(--clr-primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}

.spinner-sm { width: 16px; height: 16px; border-width: 2px; }
.spinner-lg { width: 40px; height: 40px; border-width: 3px; }
.spinner-white {
  border-color: rgba(255,255,255,.3);
  border-top-color: #fff;
}

/* ─── Mouse Cursor Trail (canvas overlay) ──── */
/* Implemented via JS, this class is set on <canvas> */
.cursor-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: var(--z-toast);
  mix-blend-mode: screen;
}
