/* ============================================
   AileBağı — All Animations
   ============================================ */

/* ===== KEYFRAMES ===== */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

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

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

@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: scale(1); }
}

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

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

@keyframes slideUp {
  from { opacity: 0; transform: translateY(100%); }
  to   { opacity: 1; transform: translateY(0); }
}

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

@keyframes popIn {
  0%   { transform: scale(0.7); opacity: 0; }
  70%  { transform: scale(1.05); }
  100% { transform: scale(1); opacity: 1; }
}

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

@keyframes pulseShadow {
  0%, 100% { box-shadow: var(--glow-brand); }
  50%       { box-shadow: 0 0 40px rgba(124,58,237,0.8), 0 0 80px rgba(124,58,237,0.3); }
}

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

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

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

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  25%       { transform: scale(1.1); }
  50%       { transform: scale(0.95); }
  75%       { transform: scale(1.08); }
}

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

@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(-1deg); }
  50%       { transform: translateY(-10px) rotate(1deg); }
}

@keyframes glow-pulse {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(124,58,237,0.5)); }
  50%       { filter: drop-shadow(0 0 20px rgba(124,58,237,0.9)); }
}

@keyframes swipe-right-anim {
  0%   { transform: translateX(0) rotate(0deg); opacity: 1; }
  100% { transform: translateX(120vw) rotate(30deg); opacity: 0; }
}

@keyframes swipe-left-anim {
  0%   { transform: translateX(0) rotate(0deg); opacity: 1; }
  100% { transform: translateX(-120vw) rotate(-30deg); opacity: 0; }
}

@keyframes card-return {
  0%   { transform: translateX(var(--dx, 0)) rotate(var(--rot, 0deg)); }
  100% { transform: translateX(0) rotate(0deg); }
}

@keyframes score-pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.4); }
  70%  { transform: scale(0.9); }
  100% { transform: scale(1); }
}

@keyframes check-draw {
  from { stroke-dashoffset: 100; }
  to   { stroke-dashoffset: 0; }
}

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

@keyframes wave {
  0%, 100% { transform: scaleY(1); }
  50%       { transform: scaleY(0.4); }
}

@keyframes loading-bar {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

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

@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); }
  30%            { transform: translateY(-8px); }
}

/* ===== UTILITY CLASSES ===== */
.animate-fadeIn       { animation: fadeIn 0.4s ease forwards; }
.animate-fadeInUp     { animation: fadeInUp 0.5s ease forwards; }
.animate-fadeInDown   { animation: fadeInDown 0.5s ease forwards; }
.animate-fadeInScale  { animation: fadeInScale 0.4s var(--t-spring) forwards; }
.animate-slideInRight { animation: slideInRight 0.5s ease forwards; }
.animate-slideInLeft  { animation: slideInLeft 0.5s ease forwards; }
.animate-slideUp      { animation: slideUp 0.5s ease forwards; }
.animate-scaleIn      { animation: scaleIn 0.4s var(--t-spring) forwards; }
.animate-popIn        { animation: popIn 0.5s var(--t-bounce) forwards; }
.animate-pulse        { animation: pulse 2s ease infinite; }
.animate-bounce       { animation: bounce 1.5s ease infinite; }
.animate-spin         { animation: spin 1s linear infinite; }
.animate-heartbeat    { animation: heartbeat 1.5s ease infinite; }
.animate-float        { animation: float 3s ease-in-out infinite; }

/* Stagger animations */
.stagger > * { animation: fadeInUp 0.4s ease both; }
.stagger > *:nth-child(1) { animation-delay: 0.05s; }
.stagger > *:nth-child(2) { animation-delay: 0.10s; }
.stagger > *:nth-child(3) { animation-delay: 0.15s; }
.stagger > *:nth-child(4) { animation-delay: 0.20s; }
.stagger > *:nth-child(5) { animation-delay: 0.25s; }
.stagger > *:nth-child(6) { animation-delay: 0.30s; }
.stagger > *:nth-child(7) { animation-delay: 0.35s; }
.stagger > *:nth-child(8) { animation-delay: 0.40s; }

/* ===== LOADING SCREEN ===== */
.loading-screen {
  position: fixed;
  inset: 0;
  z-index: var(--z-loading);
  background: var(--g-hero);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-md);
  animation: fadeInUp 0.6s ease;
}

.loading-logo {
  position: relative;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-emoji {
  font-size: 2.5rem;
  animation: heartbeat 1.5s ease infinite;
  z-index: 1;
}

.loading-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: var(--c-brand-500);
  border-right-color: var(--c-pink-400);
  animation: spin 1.2s linear infinite;
}

.loading-ring::after {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-bottom-color: var(--c-brand-300);
  animation: spin 0.8s linear infinite reverse;
}

.loading-title {
  font-size: 1.75rem;
  font-weight: 800;
  background: var(--g-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.loading-sub {
  font-size: 0.875rem;
  color: var(--c-text-muted);
}

.loading-bar {
  width: 160px;
  height: 3px;
  background: rgba(255,255,255,0.1);
  border-radius: var(--r-full);
  overflow: hidden;
}

.loading-progress {
  height: 100%;
  background: var(--g-brand);
  border-radius: var(--r-full);
  transform-origin: left;
  animation: loading-bar 1.5s ease forwards;
}

/* ===== PAGE TRANSITIONS ===== */
.page-enter { animation: fadeInUp 0.35s ease; }
.page-exit  { animation: fadeIn 0.2s ease reverse; }

/* ===== GRADIENT TEXT ===== */
.gradient-text {
  background: var(--g-brand);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradient-shift 3s linear infinite;
}

.gradient-text-static {
  background: var(--g-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== SHIMMER SKELETON ===== */
.skeleton {
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0.05) 0%,
    rgba(255,255,255,0.1) 50%,
    rgba(255,255,255,0.05) 100%
  );
  background-size: 1000px 100%;
  animation: shimmer 1.5s linear infinite;
  border-radius: var(--r-md);
}

/* ===== RIPPLE EFFECT ===== */
.ripple-container {
  position: relative;
  overflow: hidden;
}

.ripple-effect {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  transform: scale(0);
  animation: ripple 0.6s linear;
  pointer-events: none;
}

/* ===== CONFETTI (winner) ===== */
@keyframes confetti-fall {
  0%   { transform: translateY(-10px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

.confetti-piece {
  position: fixed;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  animation: confetti-fall var(--duration, 3s) ease-in var(--delay, 0s) forwards;
  z-index: 9998;
}

/* ===== TOAST ANIMATIONS ===== */
@keyframes toast-in {
  from { transform: translateY(100px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

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