/* ============================================
   TROF System v2.0 — Animations
   ============================================
   كل الحركات والانتقالات في الموقع
   يعتمد على tokens.css
   ============================================ */

/* ==========================================
   🎬 KEYFRAMES — الحركات الأساسية
   ========================================== */

/* ========== Fade ========== */

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fade-out {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

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

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

@keyframes fade-in-left {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fade-in-right {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ========== Slide ========== */

@keyframes slide-in-up {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

@keyframes slide-in-down {
  from {
    transform: translateY(-100%);
  }
  to {
    transform: translateY(0);
  }
}

@keyframes slide-in-left {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(0);
  }
}

@keyframes slide-in-right {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

@keyframes slide-out-up {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-100%);
  }
}

@keyframes slide-out-down {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(100%);
  }
}

@keyframes slide-out-left {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-100%);
  }
}

@keyframes slide-out-right {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(100%);
  }
}

/* ========== Scale ========== */

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

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

@keyframes scale-in-center {
  from {
    opacity: 0;
    transform: scale(0);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes pop-in {
  0% {
    opacity: 0;
    transform: scale(0.5);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* ========== Rotate ========== */

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

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

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

@keyframes pulse-rotate {
  0%, 100% {
    transform: rotate(0deg);
  }
  50% {
    transform: rotate(180deg);
  }
}

/* ========== Bounce ========== */

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

@keyframes bounce-sm {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

@keyframes bounce-lg {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-20px);
  }
}

/* ========== Pulse ========== */

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

@keyframes pulse-soft {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

@keyframes pulse-ring {
  0% {
    transform: scale(0.8);
    opacity: 1;
  }
  100% {
    transform: scale(2);
    opacity: 0;
  }
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(242, 194, 60, 0.3);
  }
  50% {
    box-shadow: 0 0 40px rgba(242, 194, 60, 0.6);
  }
}

/* ========== Shake ========== */

@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  10%, 30%, 50%, 70%, 90% {
    transform: translateX(-4px);
  }
  20%, 40%, 60%, 80% {
    transform: translateX(4px);
  }
}

@keyframes shake-sm {
  0%, 100% {
    transform: translateX(0);
  }
  25%, 75% {
    transform: translateX(-2px);
  }
  50% {
    transform: translateX(2px);
  }
}

@keyframes shake-y {
  0%, 100% {
    transform: translateY(0);
  }
  25%, 75% {
    transform: translateY(-4px);
  }
  50% {
    transform: translateY(4px);
  }
}

@keyframes wobble {
  0%, 100% {
    transform: rotate(0deg);
  }
  15% {
    transform: rotate(-5deg);
  }
  30% {
    transform: rotate(3deg);
  }
  45% {
    transform: rotate(-2deg);
  }
  60% {
    transform: rotate(1deg);
  }
  75% {
    transform: rotate(0deg);
  }
}

/* ========== Attention ========== */

@keyframes shake-attention {
  0%, 100% { transform: rotate(0deg); }
  10% { transform: rotate(14deg); }
  20% { transform: rotate(-8deg); }
  30% { transform: rotate(14deg); }
  40% { transform: rotate(-4deg); }
  50% { transform: rotate(10deg); }
  60% { transform: rotate(0deg); }
}

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

@keyframes jello {
  11.1% { transform: skewX(-12.5deg) skewY(-12.5deg); }
  22.2% { transform: skewX(6.25deg) skewY(6.25deg); }
  33.3% { transform: skewX(-3.125deg) skewY(-3.125deg); }
  44.4% { transform: skewX(1.5625deg) skewY(1.5625deg); }
  55.5% { transform: skewX(-0.78125deg) skewY(-0.78125deg); }
  66.6% { transform: skewX(0.390625deg) skewY(0.390625deg); }
  77.7% { transform: skewX(-0.1953125deg) skewY(-0.1953125deg); }
  88.8% { transform: skewX(0.09765625deg) skewY(0.09765625deg); }
  100% { transform: skewX(0) skewY(0); }
}

@keyframes flash {
  0%, 50%, 100% {
    opacity: 1;
  }
  25%, 75% {
    opacity: 0;
  }
}

@keyframes swing {
  20% { transform: rotate(15deg); }
  40% { transform: rotate(-10deg); }
  60% { transform: rotate(5deg); }
  80% { transform: rotate(-5deg); }
  100% { transform: rotate(0deg); }
}

/* ========== Loading ========== */

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

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

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

@keyframes dot-pulse {
  0%, 80%, 100% {
    transform: scale(0.6);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

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

/* ========== Progress ========== */

@keyframes progress-stripe {
  from {
    background-position: 40px 0;
  }
  to {
    background-position: 0 0;
  }
}

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

/* ========== Text ========== */

@keyframes text-shimmer {
  from {
    background-position: 0% center;
  }
  to {
    background-position: 200% center;
  }
}

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

@keyframes blink-caret {
  from, to {
    border-color: transparent;
  }
  50% {
    border-color: var(--c-primary-500);
  }
}

@keyframes glow-text {
  0%, 100% {
    text-shadow: 0 0 5px rgba(242, 194, 60, 0.5),
                 0 0 10px rgba(242, 194, 60, 0.3);
  }
  50% {
    text-shadow: 0 0 10px rgba(242, 194, 60, 0.8),
                 0 0 20px rgba(242, 194, 60, 0.5),
                 0 0 30px rgba(242, 194, 60, 0.3);
  }
}

/* ========== Notification ========== */

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(100%) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes toast-out {
  from {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateX(100%) scale(0.9);
  }
}

@keyframes toast-progress {
  from {
    width: 100%;
  }
  to {
    width: 0%;
  }
}

@keyframes badge-pop {
  0% {
    transform: scale(0);
  }
  50% {
    transform: scale(1.3);
  }
  100% {
    transform: scale(1);
  }
}

/* ========== Modal ========== */

@keyframes modal-in {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes modal-out {
  from {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
  to {
    opacity: 0;
    transform: scale(0.95) translateY(-10px);
  }
}

@keyframes modal-slide-up {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

/* ========== Dropdown ========== */

@keyframes dropdown-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* ========== Tooltip ========== */

@keyframes tooltip-in {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ========== Floating ========== */

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

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

@keyframes drift {
  0%, 100% {
    transform: translate(0, 0) rotate(0deg);
  }
  33% {
    transform: translate(10px, -10px) rotate(5deg);
  }
  66% {
    transform: translate(-10px, 10px) rotate(-5deg);
  }
}

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

/* ========== Dust Particles ========== */

@keyframes dust-rise {
  0% {
    opacity: 0;
    transform: translateY(0) scale(0.5);
  }
  15% {
    opacity: 0.8;
  }
  100% {
    opacity: 0;
    transform: translateY(-100vh) scale(1);
  }
}

@keyframes dust-twinkle {
  0%, 100% {
    opacity: 0.2;
  }
  50% {
    opacity: 1;
  }
}

/* ========== Ring / Circle ========== */

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

@keyframes ring-pulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

/* ========== Gold Shine ========== */

@keyframes gold-shine {
  0% {
    background-position: -200% center;
  }
  100% {
    background-position: 200% center;
  }
}

@keyframes premium-shine {
  0% {
    transform: translateX(-100%) translateY(-100%) rotate(45deg);
  }
  100% {
    transform: translateX(100%) translateY(100%) rotate(45deg);
  }
}

/* ========== Slide Toggle ========== */

@keyframes slide-toggle-on {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(20px);
  }
}

@keyframes slide-toggle-off {
  from {
    transform: translateX(20px);
  }
  to {
    transform: translateX(0);
  }
}

/* ========== Checkmark ========== */

@keyframes checkmark {
  0% {
    stroke-dashoffset: 24;
  }
  100% {
    stroke-dashoffset: 0;
  }
}

/* ========== Number Count ========== */

@keyframes count-flip {
  0% {
    transform: rotateX(0deg);
  }
  100% {
    transform: rotateX(360deg);
  }
}

/* ========== Gradient Shift ========== */

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

@keyframes gradient-rotate {
  0% {
    filter: hue-rotate(0deg);
  }
  100% {
    filter: hue-rotate(360deg);
  }
}

/* ========== Confetti ========== */

@keyframes confetti-fall {
  0% {
    transform: translateY(-100vh) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

/* ========== Celebration ========== */

@keyframes celebrate {
  0%, 100% {
    transform: scale(1) rotate(0deg);
  }
  25% {
    transform: scale(1.1) rotate(-5deg);
  }
  75% {
    transform: scale(1.1) rotate(5deg);
  }
}

/* ==========================================
   🎯 ANIMATION UTILITY CLASSES
   ========================================== */

/* ========== Fade ========== */

.anim-fade-in {
  animation: fade-in var(--t-base) var(--ease) forwards;
}

.anim-fade-out {
  animation: fade-out var(--t-base) var(--ease) forwards;
}

.anim-fade-in-up {
  animation: fade-in-up var(--t-base) var(--ease) forwards;
}

.anim-fade-in-down {
  animation: fade-in-down var(--t-base) var(--ease) forwards;
}

.anim-fade-in-left {
  animation: fade-in-left var(--t-base) var(--ease) forwards;
}

.anim-fade-in-right {
  animation: fade-in-right var(--t-base) var(--ease) forwards;
}

/* ========== Slide ========== */

.anim-slide-in-up {
  animation: slide-in-up var(--t-slow) var(--ease) forwards;
}

.anim-slide-in-down {
  animation: slide-in-down var(--t-slow) var(--ease) forwards;
}

.anim-slide-in-left {
  animation: slide-in-left var(--t-slow) var(--ease) forwards;
}

.anim-slide-in-right {
  animation: slide-in-right var(--t-slow) var(--ease) forwards;
}

/* ========== Scale ========== */

.anim-scale-in {
  animation: scale-in var(--t-base) var(--ease) forwards;
}

.anim-pop-in {
  animation: pop-in var(--t-slow) var(--ease-bounce) forwards;
}

/* ========== Spin ========== */

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

.anim-spin-slow {
  animation: spin 3s linear infinite;
}

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

/* ========== Bounce ========== */

.anim-bounce {
  animation: bounce 2s ease-in-out infinite;
}

.anim-bounce-sm {
  animation: bounce-sm 1.5s ease-in-out infinite;
}

.anim-bounce-lg {
  animation: bounce-lg 2.5s ease-in-out infinite;
}

/* ========== Pulse ========== */

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

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

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

.anim-heartbeat {
  animation: heartbeat 1.5s ease-in-out infinite;
}

/* ========== Attention ========== */

.anim-shake {
  animation: shake 0.6s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.anim-wobble {
  animation: wobble 1s ease-in-out;
}

.anim-jello {
  animation: jello 1s ease-in-out;
}

.anim-swing {
  animation: swing 1s ease-in-out;
}

.anim-attention {
  animation: shake-attention 1s ease-in-out infinite;
}

/* ========== Floating ========== */

.anim-float {
  animation: float 4s ease-in-out infinite;
}

.anim-float-slow {
  animation: float-slow 6s ease-in-out infinite;
}

.anim-bob {
  animation: bob 2s ease-in-out infinite;
}

/* ========== Loading ========== */

.anim-skeleton {
  animation: skeleton-loading 1.5s ease-in-out infinite;
}

.anim-shimmer {
  animation: shimmer 2s infinite;
}

.anim-shimmer-fast {
  animation: shimmer-fast 1.2s infinite;
}

.anim-dot-pulse {
  animation: dot-pulse 1.4s ease-in-out infinite;
}

/* ========== Text ========== */

.anim-text-shimmer {
  background: linear-gradient(
    90deg,
    var(--c-primary-800),
    var(--c-primary-200),
    var(--c-primary-800)
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: text-shimmer 3s linear infinite;
}

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

.anim-gradient-shift {
  background-size: 200% 200%;
  animation: gradient-shift 4s ease infinite;
}

/* ========== Rings ========== */

.anim-ring-spin {
  animation: ring-spin 9s linear infinite;
}

.anim-ring-pulse {
  animation: ring-pulse 2s ease-out infinite;
}

/* ========== Celebrate ========== */

.anim-celebrate {
  animation: celebrate 1s ease-in-out;
}

/* ==========================================
   🎯 HOVER EFFECTS
   ========================================== */

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

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

.hover-lift-sm:hover {
  transform: translateY(-2px);
  box-shadow: var(--sh-md);
}

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

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

.hover-scale-sm:hover {
  transform: scale(1.02);
}

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

.hover-glow:hover {
  box-shadow: var(--sh-gold-glow);
}

/* Border highlight */
.hover-border {
  transition: border-color var(--t-base) var(--ease);
}

.hover-border:hover {
  border-color: var(--c-primary-500);
}

/* Background change */
.hover-bg {
  transition: background-color var(--t-base) var(--ease);
}

.hover-bg:hover {
  background-color: var(--c-surface-2);
}

/* Icon spin on hover */
.hover-spin:hover .hover-spin-target {
  animation: spin 0.6s var(--ease);
}

/* Slide arrow on hover */
.hover-arrow {
  overflow: hidden;
  position: relative;
}

.hover-arrow::after {
  content: '→';
  position: absolute;
  top: 50%;
  inset-inline-end: -20px;
  transform: translateY(-50%);
  transition: inset-inline-end var(--t-base) var(--ease), opacity var(--t-base);
  opacity: 0;
}

.hover-arrow:hover::after {
  inset-inline-end: var(--s-3);
  opacity: 1;
}

/* ==========================================
   🎯 STAGGER — تحميل متتابع
   ========================================== */

.stagger > * {
  opacity: 0;
  animation: fade-in-up 0.5s var(--ease) forwards;
}

.stagger > *:nth-child(1) { animation-delay: 0.05s; }
.stagger > *:nth-child(2) { animation-delay: 0.1s; }
.stagger > *:nth-child(3) { animation-delay: 0.15s; }
.stagger > *:nth-child(4) { animation-delay: 0.2s; }
.stagger > *:nth-child(5) { animation-delay: 0.25s; }
.stagger > *:nth-child(6) { animation-delay: 0.3s; }
.stagger > *:nth-child(7) { animation-delay: 0.35s; }
.stagger > *:nth-child(8) { animation-delay: 0.4s; }
.stagger > *:nth-child(9) { animation-delay: 0.45s; }
.stagger > *:nth-child(10) { animation-delay: 0.5s; }
.stagger > *:nth-child(n+11) { animation-delay: 0.55s; }

/* ========== Rise (index.html) ========== */

.rise {
  opacity: 0;
  animation: fade-in-up 0.6s var(--ease) forwards;
  animation-delay: calc(var(--i, 0) * 0.08s);
}

/* ==========================================
   🎯 DUST PARTICLES — الجزيئات
   ========================================== */

#dust {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

#dust i {
  position: absolute;
  bottom: -10px;
  border-radius: var(--r-circle);
  background: var(--c-primary-300);
  box-shadow: 0 0 8px var(--c-primary-500);
  opacity: 0;
  animation: dust-rise linear infinite;
  will-change: transform, opacity;
}

/* ==========================================
   🎯 THEME TRANSITIONS — انتقالات الثيم
   ========================================== */

.theme-transition,
.theme-transition *,
.theme-transition *::before,
.theme-transition *::after {
  transition: background-color var(--t-slow) var(--ease),
              border-color var(--t-slow) var(--ease),
              color var(--t-slow) var(--ease),
              fill var(--t-slow) var(--ease),
              stroke var(--t-slow) var(--ease) !important;
}

/* ==========================================
   🎯 PAGE TRANSITIONS — انتقالات الصفحة
   ========================================== */

.page-enter {
  animation: fade-in-up var(--t-slow) var(--ease);
}

.page-exit {
  animation: fade-out var(--t-base) var(--ease) forwards;
}

/* ==========================================
   🎯 GOLD SHINE — تأثير اللمعان الذهبي
   ========================================== */

.gold-shine {
  background: linear-gradient(
    90deg,
    var(--c-primary-600) 0%,
    var(--c-primary-200) 50%,
    var(--c-primary-600) 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: text-shimmer 3s linear infinite;
}

.gold-shine-bg {
  background: linear-gradient(
    90deg,
    var(--c-primary-600) 0%,
    var(--c-primary-200) 50%,
    var(--c-primary-600) 100%
  );
  background-size: 200% auto;
  animation: gradient-shift 4s ease infinite;
}

/* ==========================================
   🎯 PREMIUM SHINE — تأثير Premium
   ========================================== */

.premium-shine {
  position: relative;
  overflow: hidden;
}

.premium-shine::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent 30%,
    rgba(255, 255, 255, 0.2) 50%,
    transparent 70%
  );
  animation: premium-shine 3s linear infinite;
  pointer-events: none;
}

/* ==========================================
   🎯 BUTTON PRESS — ضغط الزر
   ========================================== */

.press-effect {
  transition: transform var(--t-fast) var(--ease);
}

.press-effect:active {
  transform: scale(0.96);
}

/* ==========================================
   🎯 FOCUS RING ANIMATION
   ========================================== */

.focus-pulse:focus-visible {
  animation: pulse-glow 1.5s ease-in-out infinite;
}

/* ==========================================
   🎯 LOADING STATE — حالة التحميل
   ========================================== */

.loading-overlay {
  position: relative;
  pointer-events: none;
}

.loading-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(10, 9, 8, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border-radius: inherit;
  z-index: 10;
  animation: fade-in var(--t-fast) var(--ease);
}

.loading-overlay::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 32px;
  height: 32px;
  margin: -16px 0 0 -16px;
  border: 3px solid var(--c-surface-3);
  border-top-color: var(--c-primary-500);
  border-radius: var(--r-circle);
  animation: spin 0.8s linear infinite;
  z-index: 11;
}

/* ==========================================
   🎯 PROGRESS BAR SHIMMER
   ========================================== */

.progress-bar.shimmer::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  animation: shimmer 2s infinite;
}

/* ==========================================
   🎯 TYPING INDICATOR
   ========================================== */

.typing-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.typing-indicator span {
  width: 6px;
  height: 6px;
  background: currentColor;
  border-radius: var(--r-circle);
  animation: dot-pulse 1.4s ease-in-out infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

/* ==========================================
   🎯 RIPPLE EFFECT
   ========================================== */

.ripple {
  position: relative;
  overflow: hidden;
}

.ripple::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  background: rgba(255, 255, 255, 0.5);
  opacity: 0;
  border-radius: 100%;
  transform: scale(1, 1) translate(-50%, -50%);
  transform-origin: 50% 50%;
}

.ripple:focus:not(:active)::after {
  animation: ripple 0.6s ease-out;
}

@keyframes ripple {
  0% {
    transform: scale(0, 0);
    opacity: 0.5;
  }
  20% {
    transform: scale(25, 25);
    opacity: 0.3;
  }
  100% {
    opacity: 0;
    transform: scale(40, 40);
  }
}

/* ==========================================
   🎯 MORPHING ICON
   ========================================== */

.morph-icon {
  transition: transform var(--t-base) var(--ease-bounce);
}

.morph-icon.active {
  transform: rotate(180deg);
}

/* ==========================================
   🎯 STAGGER LOADING
   ========================================== */

.delayed-1 { animation-delay: 0.1s; }
.delayed-2 { animation-delay: 0.2s; }
.delayed-3 { animation-delay: 0.3s; }
.delayed-4 { animation-delay: 0.4s; }
.delayed-5 { animation-delay: 0.5s; }
.delayed-6 { animation-delay: 0.6s; }
.delayed-7 { animation-delay: 0.7s; }
.delayed-8 { animation-delay: 0.8s; }
.delayed-9 { animation-delay: 0.9s; }
.delayed-10 { animation-delay: 1s; }

/* ==========================================
   🎯 SPEED UTILITIES
   ========================================== */

.speed-fast {
  animation-duration: 0.5s !important;
}

.speed-slower {
  animation-duration: 3s !important;
}

.speed-slowest {
  animation-duration: 5s !important;
}

/* ==========================================
   🎯 DELAY UTILITIES
   ========================================== */

.delay-100 { animation-delay: 100ms !important; }
.delay-200 { animation-delay: 200ms !important; }
.delay-300 { animation-delay: 300ms !important; }
.delay-500 { animation-delay: 500ms !important; }
.delay-700 { animation-delay: 700ms !important; }
.delay-1000 { animation-delay: 1000ms !important; }

/* ==========================================
   🎯 ITERATION UTILITIES
   ========================================== */

.anim-once {
  animation-iteration-count: 1 !important;
}

.anim-infinite {
  animation-iteration-count: infinite !important;
}

/* ==========================================
   🎯 PAUSED STATE
   ========================================== */

.anim-paused,
.anim-paused * {
  animation-play-state: paused !important;
}

/* ==========================================
   🎯 ACCESSIBILITY — تقليل الحركة
   ========================================== */

@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;
  }

  /* استثناء مؤشرات التحميل */
  .spinner,
  .anim-spin,
  .loading-overlay::before,
  .skeleton {
    animation-duration: 1.5s !important;
    animation-iteration-count: infinite !important;
  }

  /* إخفاء dust */
  #dust {
    display: none !important;
  }

  /* تعطيل hover effects */
  .hover-lift:hover,
  .hover-scale:hover,
  .hover-lift-sm:hover,
  .hover-scale-sm:hover {
    transform: none;
  }
}

/* ==========================================
   🎯 DARK MODE ADJUSTMENTS
   ========================================== */

[data-theme="light"] .loading-overlay::after {
  background: rgba(255, 255, 255, 0.7);
}

[data-theme="light"] #dust i {
  background: var(--c-primary-500);
  box-shadow: 0 0 6px var(--c-primary-600);
}

/* ==========================================
   🎯 PRINT — تعطيل الحركات
   ========================================== */

@media print {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  #dust {
    display: none !important;
  }
}

/* ==========================================
   📝 USAGE GUIDE
   ============================================

   Animations:
   ────────────────────────────────
   <div class="anim-fade-in">Fade in</div>
   <div class="anim-fade-in-up delayed-2">With delay</div>
   <div class="anim-bounce">Bouncing</div>
   <div class="anim-pulse">Pulsing</div>
   <div class="anim-shake">Shaking (error)</div>
   <div class="anim-float">Floating</div>

   Hover Effects:
   ────────────────────────────────
   <div class="hover-lift">Lifts on hover</div>
   <div class="hover-scale">Scales on hover</div>
   <div class="hover-glow">Glows on hover</div>

   Stagger (list animation):
   ────────────────────────────────
   <ul class="stagger">
     <li>Item 1</li>
     <li>Item 2</li>
     <li>Item 3</li>
   </ul>

   Loading:
   ────────────────────────────────
   <div class="spinner"></div>
   <div class="loading-overlay">Content while loading</div>
   <div class="typing-indicator">
     <span></span><span></span><span></span>
   </div>

   Special Effects:
   ────────────────────────────────
   <h1 class="gold-shine">Text with gold shimmer</h1>
   <div class="premium-shine">Card with premium effect</div>
   <div class="anim-heartbeat">❤️</div>

   Theme Transitions:
   ────────────────────────────────
   document.body.classList.add('theme-transition');
   document.documentElement.setAttribute('data-theme', 'light');
   setTimeout(() => {
     document.body.classList.remove('theme-transition');
   }, 500);
   ============================================ */