/* Animatsiyalar (do'kon va admin uchun umumiy). prefers-reduced-motion'da hammasi o'chadi. */
:root { --ease: cubic-bezier(.2,.8,.2,1); --ease-spring: cubic-bezier(.34,1.56,.64,1); --dur: .22s; }

/* Sahifa almashinuvi */
.page-enter { animation: pageIn .32s var(--ease) both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* Ro'yxat elementlari ketma-ket chiqishi: .stagger > * */
.stagger > * { animation: rise .38s var(--ease) both; }
.stagger > *:nth-child(1) { animation-delay: .02s } .stagger > *:nth-child(2) { animation-delay: .05s }
.stagger > *:nth-child(3) { animation-delay: .08s } .stagger > *:nth-child(4) { animation-delay: .11s }
.stagger > *:nth-child(5) { animation-delay: .14s } .stagger > *:nth-child(6) { animation-delay: .17s }
.stagger > *:nth-child(7) { animation-delay: .2s } .stagger > *:nth-child(n+8) { animation-delay: .23s }
@keyframes rise { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: none; } }

/* Karta: ustiga kelganda ko'tariladi, bosilganda siqiladi */
.lift { transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur); will-change: transform; }
@media (hover: hover) { .lift:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(15,23,41,.14); } }
.lift:active, .press:active { transform: scale(.97); transition-duration: .08s; }
.btn { transition: transform .08s, background .15s, box-shadow .2s, filter .15s; }
.btn.primary:hover, .btn.accent:hover { filter: brightness(1.06); box-shadow: 0 4px 14px rgba(29,78,216,.25); }

/* Savatga "uchib" borish */
.fly-dot { position: fixed; z-index: 90; width: 16px; height: 16px; border-radius: 50%; background: var(--accent); pointer-events: none;
  box-shadow: 0 0 0 4px rgba(249,115,22,.25); transition: transform .62s cubic-bezier(.5,-.3,.7,1.3), opacity .62s; }
.bump { animation: bump .45s var(--ease-spring); }
@keyframes bump { 30% { transform: scale(1.35); } 60% { transform: scale(.92); } }

/* Grafik chizilishi */
.draw-line { stroke-dasharray: var(--len, 2000); stroke-dashoffset: var(--len, 2000); animation: draw 1.1s var(--ease) .1s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.grow-bar { transform-origin: bottom; animation: growY .6s var(--ease) both; }
@keyframes growY { from { transform: scaleY(0); } }
.donut-seg { animation: donutIn .9s var(--ease) both; }
@keyframes donutIn { from { stroke-dasharray: 0 999; } }

/* Skelet (yuklanish) */
.skel { position: relative; overflow: hidden; background: var(--surface-2); border-radius: var(--r-sm); }
.skel::after { content: ''; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent); animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }

/* Xabarcha (toast) */
.toast { animation: toastIn .35s var(--ease-spring) both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(.96); } }

/* Pastdan chiquvchi oyna */
.sheet { animation: sheetUp .3s var(--ease) both; }
@keyframes sheetUp { from { transform: translateY(40px); opacity: .3; } }

/* Muvaffaqiyat belgisi */
.pop { animation: pop .5s var(--ease-spring) both; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }
.flash-ok { animation: flashOk .9s var(--ease); }
@keyframes flashOk { 0% { box-shadow: 0 0 0 0 rgba(21,128,61,.5); } 100% { box-shadow: 0 0 0 14px rgba(21,128,61,0); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; transition-duration: .001ms !important; }
  .draw-line { stroke-dashoffset: 0; }
}
