/* ══════════════════════════════════════════════════════════
   DIGITAL ACADEMY — zamonaviy qatlam
   base.css ustiga qo'shiladi: animatsiyalar, anti-cheat UI
   ══════════════════════════════════════════════════════════ */

/* ── Umumiy animatsiyalar ──────────────────────────────── */

@keyframes ac-fade-up {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
@keyframes ac-pop {
  0%   { opacity: 0; transform: scale(.9); }
  60%  { transform: scale(1.02); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes ac-slide-down {
  from { opacity: 0; transform: translate(-50%, -22px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}
@keyframes ac-shimmer {
  0%   { background-position: -420px 0; }
  100% { background-position: 420px 0; }
}
@keyframes ac-pulse-ring {
  0%   { box-shadow: 0 0 0 0 rgba(176, 44, 44, .45); }
  70%  { box-shadow: 0 0 0 16px rgba(176, 44, 44, 0); }
  100% { box-shadow: 0 0 0 0 rgba(176, 44, 44, 0); }
}
@keyframes ac-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-7px); }
}
@keyframes ac-spin {
  to { transform: rotate(360deg); }
}

/* Sahifa elementlari ketma-ket paydo bo'ladi */
.stagger > * {
  animation: ac-fade-up .42s cubic-bezier(.22, .8, .3, 1) backwards;
}
.stagger > *:nth-child(1) { animation-delay: .02s; }
.stagger > *:nth-child(2) { animation-delay: .07s; }
.stagger > *:nth-child(3) { animation-delay: .12s; }
.stagger > *:nth-child(4) { animation-delay: .17s; }
.stagger > *:nth-child(5) { animation-delay: .22s; }
.stagger > *:nth-child(6) { animation-delay: .27s; }
.stagger > *:nth-child(7) { animation-delay: .32s; }
.stagger > *:nth-child(8) { animation-delay: .37s; }

/* ── Kartochkalarni jonlantirish ───────────────────────── */

.card, .cat, .stat {
  transition: transform .22s cubic-bezier(.22, .8, .3, 1),
              box-shadow .22s ease,
              border-color .22s ease;
}
.cat:hover, .stat:hover {
  transform: translateY(-3px);
}

/* Tugmalarda bosish effekti */
.btn {
  position: relative;
  overflow: hidden;
  transition: transform .12s cubic-bezier(.22, .8, .3, 1),
              box-shadow .18s ease, background .18s ease;
}
.btn:active:not(:disabled) { transform: scale(.975); }
.btn--primary:hover:not(:disabled) {
  box-shadow: 0 5px 18px rgba(16, 96, 184, .3);
}

/* Yuklanish skeleton */
.skeleton {
  background: linear-gradient(90deg,
    var(--surface-2) 25%, var(--rule-soft) 50%, var(--surface-2) 75%);
  background-size: 840px 100%;
  animation: ac-shimmer 1.5s linear infinite;
  border-radius: var(--radius);
}

/* ── ANTI-CHEAT: nazorat yoqilganda ────────────────────── */

body.ac-on {
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
body.ac-on input,
body.ac-on textarea {
  -webkit-user-select: text;
  -moz-user-select: text;
  user-select: text;
}

/* Ekran qisqa qizaradi — sezilarli, lekin bezovta qilmaydi */
body.ac-flash::after {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(176, 44, 44, .12);
  pointer-events: none;
  z-index: 9998;
  animation: ac-fade-out .42s ease forwards;
}
@keyframes ac-fade-out {
  from { opacity: 1; }
  to   { opacity: 0; }
}

/* Chop etishda mazmun yashiriladi */
@media print {
  body.ac-on * { visibility: hidden !important; }
  body.ac-on::before {
    content: "Test mazmunini chop etish taqiqlangan.";
    visibility: visible;
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 22px;
    font-family: system-ui, sans-serif;
  }
}

/* ── Ogohlantirish oynasi ──────────────────────────────── */

.ac-warn {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translate(-50%, -22px);
  opacity: 0;
  z-index: 9999;
  width: min(94vw, 460px);
  transition: opacity .3s ease, transform .3s cubic-bezier(.22, .8, .3, 1);
  pointer-events: none;
}
.ac-warn--show {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}

.ac-warn__card {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 15px 17px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #ecd6a6;
  border-left: 4px solid #b26a00;
  box-shadow: 0 12px 34px rgba(2, 22, 49, .17);
}
.ac-warn--critical .ac-warn__card {
  border-color: #eec4c4;
  border-left-color: #b02c2c;
  animation: ac-pulse-ring 1.4s ease-out 2;
}

.ac-warn__icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 18px;
  background: #fdf3e2;
  color: #b26a00;
}
.ac-warn--critical .ac-warn__icon {
  background: #fbeaea;
  color: #b02c2c;
}

.ac-warn__body { flex: 1; min-width: 0; }
.ac-warn__title {
  font-size: 13.5px;
  font-weight: 650;
  margin-bottom: 3px;
  color: #021631;
}
.ac-warn__text {
  font-size: 13px;
  line-height: 1.5;
  color: #4a5a72;
}

.ac-warn__dots {
  display: flex;
  gap: 5px;
  margin-top: 9px;
}
.ac-dot {
  width: 22px;
  height: 4px;
  border-radius: 3px;
  background: #dde3ec;
  transition: background .3s ease;
}
.ac-dot--on { background: #b26a00; }
.ac-warn--critical .ac-dot--on { background: #b02c2c; }

.ac-warn__close {
  flex-shrink: 0;
  border: none;
  background: none;
  font-size: 21px;
  line-height: 1;
  color: #8794a8;
  cursor: pointer;
  padding: 0 2px;
}
.ac-warn__close:hover { color: #021631; }

/* ── Ban ekrani ────────────────────────────────────────── */

.ac-ban {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(2, 22, 49, .72);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  opacity: 0;
  transition: opacity .35s ease;
}
.ac-ban--show { opacity: 1; }

.ac-ban__card {
  background: #fff;
  border-radius: 20px;
  padding: 34px 30px;
  width: 100%;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(2, 22, 49, .3);
  animation: ac-pop .42s cubic-bezier(.22, .8, .3, 1);
}
.ac-ban__card h2 {
  margin: 20px 0 8px;
  font-size: 21px;
  color: #021631;
}
.ac-ban__card p {
  font-size: 14px;
  line-height: 1.55;
  color: #4a5a72;
  margin-bottom: 16px;
}

.ac-ban__ring {
  position: relative;
  width: 128px;
  height: 128px;
  margin: 0 auto;
}
.ac-ban__svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.ac-ban__track {
  fill: none;
  stroke: #eaeef4;
  stroke-width: 7;
}
.ac-ban__fill {
  fill: none;
  stroke: #b02c2c;
  stroke-width: 7;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s linear;
}
.ac-ban__time {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 26px;
  font-weight: 600;
  color: #b02c2c;
}

.ac-ban__note {
  background: #f4f6fa;
  border-radius: 11px;
  padding: 13px 15px;
  font-size: 12.5px;
  line-height: 1.55;
  color: #4a5a72;
  margin-bottom: 18px;
  text-align: left;
}

/* ── Nazorat holati paneli (test ekranida) ─────────────── */

.ac-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 999px;
  background: #e2f5ee;
  border: 1px solid #b9e0d1;
  font-size: 12px;
  font-weight: 550;
  color: #0d7355;
}
.ac-status__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #0d7355;
  animation: ac-blink 2.1s ease-in-out infinite;
}
@keyframes ac-blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: .32; }
}
.ac-status--warn {
  background: #fdf3e2;
  border-color: #ecd6a6;
  color: #b26a00;
}
.ac-status--warn .ac-status__dot { background: #b26a00; }
.ac-status--danger {
  background: #fbeaea;
  border-color: #eec4c4;
  color: #b02c2c;
}
.ac-status--danger .ac-status__dot { background: #b02c2c; }

/* ── Test boshlashdan oldingi qoidalar oynasi ──────────── */

.ac-rules {
  list-style: none;
  padding: 0;
  margin: 0 0 18px;
}
.ac-rules li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: #4a5a72;
  border-bottom: 1px solid #f1f4f9;
  animation: ac-fade-up .35s ease backwards;
}
.ac-rules li:last-child { border-bottom: none; }
.ac-rules li:nth-child(1) { animation-delay: .04s; }
.ac-rules li:nth-child(2) { animation-delay: .09s; }
.ac-rules li:nth-child(3) { animation-delay: .14s; }
.ac-rules li:nth-child(4) { animation-delay: .19s; }
.ac-rules li:nth-child(5) { animation-delay: .24s; }
.ac-rules li:nth-child(6) { animation-delay: .29s; }

.ac-rules__mark {
  flex-shrink: 0;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  background: #fbeaea;
  color: #b02c2c;
  margin-top: 1px;
}
.ac-rules__mark--ok {
  background: #e2f5ee;
  color: #0d7355;
}

/* ── Ogohlantirishlar (admin panel) ────────────────────── */

.alert-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  border-radius: 11px;
  background: #fff;
  border: 1px solid #eaeef4;
  margin-bottom: 8px;
  animation: ac-fade-up .32s ease backwards;
  transition: border-color .18s ease, transform .18s ease;
}
.alert-row:hover { border-color: #c3daf2; transform: translateX(2px); }
.alert-row--unread { border-left: 3.5px solid #1060b8; background: #f8fafd; }
.alert-row--banned { border-left: 3.5px solid #b02c2c; background: #fdf7f7; }

.alert-row__badge {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 700;
}
.alert-row__badge--high { background: #fbeaea; color: #b02c2c; }
.alert-row__badge--medium { background: #fdf3e2; color: #b26a00; }
.alert-row__badge--low { background: #eef5fc; color: #1060b8; }

.alert-row__main { flex: 1; min-width: 0; }
.alert-row__name { font-size: 14px; font-weight: 600; color: #021631; }
.alert-row__desc { font-size: 12.5px; color: #4a5a72; margin-top: 2px; }
.alert-row__time {
  flex-shrink: 0;
  font-size: 11.5px;
  color: #8794a8;
  font-family: ui-monospace, Menlo, monospace;
}

/* Ogohlantirishlar soni (tab yonida) */
.tab-badge {
  display: inline-grid;
  place-items: center;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  margin-left: 6px;
  border-radius: 999px;
  background: #b02c2c;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  animation: ac-pop .3s ease;
}

/* ── Kirish sahifasi jonlanishi ────────────────────────── */

.auth-head img {
  animation: ac-float 4.5s ease-in-out infinite;
}

/* ── Harakatni kamaytirish sozlamasiga hurmat ──────────── */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
