/* ============================================================
   YKS Hızlı Okuma — Animations & Keyframes
   ============================================================ */

/* === GENERAL UI ANIMATIONS === */

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-24px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideLeft {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes slideRight {
  from { opacity: 0; transform: translateX(-24px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.8); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.06); }
}

@keyframes glow {
  0%, 100% { box-shadow: 0 0 12px hsla(210, 100%, 60%, 0.2); }
  50%      { box-shadow: 0 0 28px hsla(210, 100%, 60%, 0.45); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 50%, 90% { transform: translateX(-6px); }
  30%, 70%      { transform: translateX(6px); }
}

@keyframes bounce {
  0%   { transform: translateY(0); }
  20%  { transform: translateY(-14px); }
  40%  { transform: translateY(0); }
  55%  { transform: translateY(-6px); }
  70%  { transform: translateY(0); }
  85%  { transform: translateY(-2px); }
  100% { transform: translateY(0); }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes ripple {
  from {
    transform: scale(0);
    opacity: 0.55;
  }
  to {
    transform: scale(4);
    opacity: 0;
  }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}


/* === EXERCISE-SPECIFIC ANIMATIONS === */

/* Saccadic — dot expansion pulse */
@keyframes dotPulse {
  0% {
    transform: scale(0.4);
    opacity: 0;
    box-shadow: 0 0 0 0 hsla(210, 100%, 60%, 0.5);
  }
  50% {
    transform: scale(1);
    opacity: 1;
    box-shadow: 0 0 16px 4px hsla(210, 100%, 60%, 0.35);
  }
  100% {
    transform: scale(0.4);
    opacity: 0;
    box-shadow: 0 0 0 0 hsla(210, 100%, 60%, 0);
  }
}

/* Tachistoscope — word flash appear / disappear */
@keyframes flashWord {
  0%   { opacity: 0; transform: scale(0.85); filter: blur(6px); }
  15%  { opacity: 1; transform: scale(1);    filter: blur(0); }
  75%  { opacity: 1; transform: scale(1);    filter: blur(0); }
  100% { opacity: 0; transform: scale(1.05); filter: blur(4px); }
}

/* Block reading — left-to-right highlight sweep */
@keyframes sweepHighlight {
  from {
    background-size: 0% 100%;
    background-position: left center;
  }
  to {
    background-size: 100% 100%;
    background-position: left center;
  }
}

/* Subvocalization — top-to-bottom shadow overlay */
@keyframes shadowDrop {
  from { transform: translateY(-100%); }
  to   { transform: translateY(0); }
}

/* Counter animation for subvocalization metronome */
@keyframes countUp {
  0%   { opacity: 0; transform: translateY(8px) scale(0.8); }
  30%  { opacity: 1; transform: translateY(0)   scale(1.15); }
  60%  { opacity: 1; transform: translateY(0)   scale(1); }
  100% { opacity: 0; transform: translateY(-8px) scale(0.9); }
}

/* Progress bar fill */
@keyframes progressFill {
  from { width: 0%; }
  to   { width: var(--progress, 100%); }
}

/* Typewriter text reveal */
@keyframes typewriter {
  from { width: 0; }
  to   { width: 100%; }
}


/* === UTILITY CLASSES === */

.animate-fadeIn {
  animation: fadeIn 400ms ease both;
}

.animate-scaleIn {
  animation: scaleIn 350ms var(--transition-spring) both;
}

.animate-slideUp {
  animation: slideUp 400ms ease both;
}

.animate-slideDown {
  animation: slideDown 400ms ease both;
}

.animate-slideLeft {
  animation: slideLeft 400ms ease both;
}

.animate-slideRight {
  animation: slideRight 400ms ease both;
}

.animate-pulse {
  animation: pulse 2s ease-in-out infinite;
}

.animate-glow {
  animation: glow 2s ease-in-out infinite;
}

.animate-shake {
  animation: shake 500ms ease both;
}

.animate-bounce {
  animation: bounce 600ms ease both;
}

.animate-spin {
  animation: spin 1s linear infinite;
}

.animate-float {
  animation: float 3s ease-in-out infinite;
}


/* === STAGGER DELAYS === */

.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }

/* === LASER SCANNER ANIMATION === */
@keyframes laserScan {
  0%   { top: 0%; }
  50%  { top: 100%; }
  100% { top: 0%; }
}

.animate-laser {
  animation: laserScan 2s linear infinite;
}

/* === ADVANCED 20+ MICRO-ANIMATIONS === */

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes bgMesh {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes bounceSoft {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

@keyframes pulseGlow {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 2px var(--color-primary)); opacity: 0.9; }
  50% { transform: scale(1.02); filter: drop-shadow(0 0 12px var(--color-primary)); opacity: 1; }
}

@keyframes particleBurst {
  0% { transform: scale(0) rotate(0deg); opacity: 1; }
  100% { transform: scale(1.4) rotate(180deg); opacity: 0; }
}

@keyframes confettiFall {
  0% { transform: translateY(-50px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

@keyframes scalePop {
  0% { transform: scale(0.9); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

@keyframes spinGlow {
  0% { transform: rotate(0deg); filter: drop-shadow(0 0 5px var(--color-secondary)); }
  50% { filter: drop-shadow(0 0 15px var(--color-accent)); }
  100% { transform: rotate(360deg); filter: drop-shadow(0 0 5px var(--color-secondary)); }
}

@keyframes drawLine {
  from { stroke-dashoffset: 1000; }
  to { stroke-dashoffset: 0; }
}

@keyframes gaugeSweep {
  from { transform: rotate(-90deg); }
  to { transform: rotate(var(--gauge-angle, 0deg)); }
}

@keyframes textGlow {
  0%, 100% { text-shadow: 0 0 8px rgba(255,255,255,0.1); }
  50% { text-shadow: 0 0 15px var(--color-accent), 0 0 3px var(--color-primary); }
}

@keyframes borderGlowPulse {
  0%, 100% { border-color: var(--glass-border); box-shadow: 0 0 0 rgba(0,0,0,0); }
  50% { border-color: var(--color-primary); box-shadow: 0 0 15px hsla(210, 100%, 60%, 0.2); }
}

@keyframes slideInTopElastic {
  0% { transform: translateY(-100px); opacity: 0; }
  60% { transform: translateY(10px); opacity: 0.8; }
  100% { transform: translateY(0); opacity: 1; }
}

@keyframes slideInBottomElastic {
  0% { transform: translateY(100px); opacity: 0; }
  60% { transform: translateY(-10px); opacity: 0.8; }
  100% { transform: translateY(0); opacity: 1; }
}

@keyframes ringPulse {
  0% { transform: scale(0.95); opacity: 0.5; stroke-width: 2px; }
  50% { transform: scale(1.05); opacity: 1; stroke-width: 4px; }
  100% { transform: scale(0.95); opacity: 0.5; stroke-width: 2px; }
}

@keyframes waveMove {
  0% { transform: translateX(0) translateZ(0) scaleY(1); }
  50% { transform: translateX(-25%) translateZ(0) scaleY(0.8); }
  100% { transform: translateX(-50%) translateZ(0) scaleY(1); }
}

/* Animations Classes */
.animate-shimmer {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite linear;
}

.animate-bgMesh {
  background: linear-gradient(-45deg, #0a0f1d, #140d25, #081622, #0b1a13);
  background-size: 400% 400%;
  animation: bgMesh 15s ease infinite;
}

.animate-bounceSoft {
  animation: bounceSoft 2s ease-in-out infinite;
}

.animate-pulseGlow {
  animation: pulseGlow 3s ease-in-out infinite;
}

.animate-scalePop {
  animation: scalePop 0.4s var(--ease-elastic-2) forwards;
}

.animate-spinGlow {
  animation: spinGlow 4s linear infinite;
}

.animate-textGlow {
  animation: textGlow 2s ease-in-out infinite;
}

.animate-borderGlow {
  animation: borderGlowPulse 3s ease-in-out infinite;
}

.animate-elasticTop {
  animation: slideInTopElastic 0.6s var(--ease-elastic-2) forwards;
}

.animate-elasticBottom {
  animation: slideInBottomElastic 0.6s var(--ease-elastic-2) forwards;
}

/* === 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;
  }
}
