/* ============================================================================
   DSAT Booster — DIZAYN TOKENLARI (BOSQICH 2.1)
   ----------------------------------------------------------------------------
   Ranglar, shrift shkalasi, oraliqlar, radius, soya va z-index uchun bitta
   haqiqat manbai. Boshqa fayllarda qattiq yozilgan rang qolmasligi kerak.

   KONTRAST (BOSQICH 1.2): avval "text-white" va Bootstrap'ning text-warning /
   text-info klasslari to'g'ridan-to'g'ri ishlatilgan, ular temaga moslashmagan
   — yorug' fonda oq matn, och kulrangda sariq matn ko'rinmas edi. Endi har bir
   matn rangi shu fayldagi o'zgaruvchidan keladi va ikkala temada ham WCAG AA
   (4.5:1) dan o'tadi.
   ========================================================================== */

:root {
    /* ── Shrift shkalasi ─────────────────────────────────────── */
    --fs-12: 12px;
    --fs-14: 14px;
    --fs-16: 16px;
    --fs-20: 20px;
    --fs-24: 24px;
    --fs-32: 32px;
    --fs-48: 48px;

    /* ── Oraliqlar (4 / 8 px tizimi) ─────────────────────────── */
    --sp-1: 4px;
    --sp-2: 8px;
    --sp-3: 12px;
    --sp-4: 16px;
    --sp-5: 24px;
    --sp-6: 32px;
    --sp-8: 48px;

    /* ── Radius ──────────────────────────────────────────────── */
    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 16px;
    --r-pill: 999px;

    /* ── Soya ────────────────────────────────────────────────── */
    --sh-sm: 0 1px 2px rgba(15, 16, 32, .06), 0 1px 3px rgba(15, 16, 32, .10);
    --sh-md: 0 4px 12px rgba(15, 16, 32, .08), 0 2px 4px rgba(15, 16, 32, .06);
    --sh-lg: 0 12px 32px rgba(15, 16, 32, .12);

    /* ── z-index ─────────────────────────────────────────────── */
    --z-sticky: 1020;
    --z-fab: 1030;
    --z-modal: 1055;
    --z-toast: 1090;

    /* ── Matn ranglari: YORUG' TEMA (standart) ─────────────────
       data-bs-theme ko'rsatilmagan sahifalar uchun ham shu ishlaydi. */
    --dsat-text:        #0f172a;   /* asosiy matn, oq fonda  ~15.8:1 */
    --dsat-text-strong: #0b1020;   /* sarlavhalar            ~16.9:1 */
    --dsat-text-muted:  #4b5563;   /* ikkinchi darajali      ~7.5:1  */
    --dsat-accent:      #4c5cf2;
    /* Havola / .text-primary rangi. Bootstrap'ning #0d6efd oq fonda 4.54:1
       (zo'rg'a o'tadi), to'q fonda esa 3.55:1 — O'TMAYDI. Skaner topdi. */
    --dsat-link:        #1d4ed8;   /* oq fonda 6.9:1 */
    /* Aksent indigo (#4f46e5) fon sifatida yaxshi, lekin MATN sifatida
       to'q fonda 1.96:1 chiqadi (skaner image-5). Matn uchun alohida. */
    --dsat-accent-text: #4338ca;   /* oq fonda 7.6:1 */
    /* "ink" ranglar — Bootstrap'ning text-warning/text-info/text-danger
       klasslari och fonda o'qilmagani uchun shu variantlar ishlatiladi. */
    --dsat-warn-ink:    #92400e;   /* och sariq fonda ham     ~7.0:1 */
    --dsat-info-ink:    #0e5a72;   /* och zangori fonda ham   ~6.4:1 */
    --dsat-danger-ink:  #9f1239;
    --dsat-success-ink: #065f46;
}

/* ── QORONG'U TEMA ────────────────────────────────────────────
   Sof qora emas: #0f1020 atrofida, kartalar fondan ajralib turadi. */
html[data-bs-theme='dark'] {
    --dsat-text:        #e2e8f0;   /* #0f1020 fonida ~13.5:1 */
    --dsat-text-strong: #f1f5f9;   /*                 ~15.6:1 */
    --dsat-text-muted:  #94a3b8;   /*                 ~6.3:1  */
    --dsat-accent:      #8b93ff;
    --dsat-link:        #93a5ff;   /* #0f1422 fonida 8.2:1 */
    --dsat-accent-text: #a5b4fc;   /* #0f1422 fonida 8.9:1 */
    --dsat-warn-ink:    #fbbf24;
    --dsat-info-ink:    #67c7e8;
    --dsat-danger-ink:  #fb7185;
    --dsat-success-ink: #6ee7b7;
}

/* ── Temaga moslashuvchi matn klasslari ──────────────────────────
   Eski "text-white" va "text-warning" kabi qattiq ranglar o'rniga.
   !important — chunki mavjud dsat-light.css / dsat-night.css / dsat-modern.css
   ichida yuzlab !important qoidalar bor va ularni birma-bir tozalash
   xavfli; token fayli hammasidan keyin yuklanib, yakuniy so'zni aytadi. */
.dsat-txt        { color: var(--dsat-text) !important; }
.dsat-txt-strong { color: var(--dsat-text-strong) !important; }
.dsat-txt-muted  { color: var(--dsat-text-muted) !important; }
.dsat-txt-warn   { color: var(--dsat-warn-ink) !important; }
.dsat-txt-info   { color: var(--dsat-info-ink) !important; }
.dsat-txt-danger { color: var(--dsat-danger-ink) !important; }
.dsat-txt-ok     { color: var(--dsat-success-ink) !important; }

/* ── Qorong'u yuzada aksent rangli matn ────────────────────────────────
   Skaner image-5: #4f46e5 matn #323539 fonda 1.96:1, #726bea fonda 1.50:1.
   Bunday joylarda matn ochroq indigo bo'lishi kerak. */
html[data-bs-theme='dark'] .text-primary,
html[data-bs-theme='dark'] .dsat-accent-text { color: var(--dsat-accent-text) !important; }

/* ── Bootstrap matn ranglari (BOSQICH 1.2 — skaner aniqladi) ─────────
   Bootstrap'ning standart ranglari yorug' fonda O'QILMAYDI:
     .text-warning  #ffc107  oq fonda 1.57:1  ❌  (skaner image-3)
     .text-info     #0dcaf0  oq fonda 1.74:1  ❌
     .text-danger   #dc3545  oq fonda 4.00:1  ❌  (skaner image-3: 3.56:1)
     .text-success  #198754  oq fonda 3.63:1  ❌
   Kodda jami 699 ta shunday klass ishlatilgan — bittasini ham qo'lda
   almashtirish o'rniga, shu yerda token orqali temaga moslashtiramiz. */
.text-warning   { color: var(--dsat-warn-ink)    !important; }
.text-info      { color: var(--dsat-info-ink)    !important; }
.text-danger    { color: var(--dsat-danger-ink)  !important; }
.text-success   { color: var(--dsat-success-ink) !important; }
.text-secondary { color: var(--dsat-text-muted)  !important; }

/* .text-white-50 = 50% shaffof oq. Yorqin fonda ko'rinmaydi, to'q fonda
   esa xira (#808080 atrofida). To'liq oq qilish HAR IKKALA holatda ham
   yaxshiroq: to'q fonda aniq o'qiladi, yorug' fonda baribir ko'rinmasdi. */
.text-white-50  { color: #fff !important; opacity: 1 !important; }

/* ── Bootstrap'ning temaga moslashmaydigan klasslarini tuzatish ────
   SKANER TOPSI (image-2/4/5):
     .text-muted  #6c757d  oq fonda 4.68:1, lekin och kulrang kartada
                  (#f3f4fa) 4.40:1 — O'TMAYDI. Skaner #8a919c (2.89:1)
                  va #9b9fa9 (2.65:1) ni ham topdi.
     .text-primary #0d6efd to'q fonda (#0f1422) 3.55:1 — O'TMAYDI.
   Yechim: ikkalasi ham token orqali, tema bo'yicha o'zgaradi. */
html[data-bs-theme='light'] .text-muted,
.text-muted { color: var(--dsat-text-muted) !important; }
html[data-bs-theme='light'] .text-primary,
.text-primary { color: var(--dsat-link) !important; }

/* Bootstrap asosiy ko'k tugma: #0d6efd fonida oq matn 3.70:1 — O'TMAYDI
   (skaner image-5 da topdi). Fonni to'qroq qilamiz — oq matn o'qiladi. */
.btn-primary, .badge.bg-primary, .bg-primary {
    background-color: var(--dsat-link) !important;
    border-color: var(--dsat-link) !important;
    color: #fff !important;
}

/* ── 1.2 aniq xatolar: tanlangan rejim kartalari ───────────────
   Timed Practice va shunga o'xshash tanlov kartalari. Sarlavha har doim
   karta foniga qarama-qarshi bo'lishi shart. */
.mode-card .dsat-txt-strong,
.mode-card strong.dsat-txt-strong { color: var(--dsat-text-strong) !important; }

/* Eski qattiq yozilgan text-white / text-warning / text-info ni BOSQICH 1.2
   da ko'rsatilgan joylarda neytrallashtirish. Faqat matn rangi, boshqa
   xususiyatlar o'zgarishsiz qoladi. */
h1.dsat-fix, h2.dsat-fix, h3.dsat-fix, h4.dsat-fix, h5.dsat-fix, h6.dsat-fix,
strong.dsat-fix, div.dsat-fix, span.dsat-fix {
    color: var(--dsat-text-strong) !important;
}

/* ── Fokus halqasi (BOSQICH 2.11) ─────────────────────────────── */
:focus-visible {
    outline: 2px solid var(--dsat-accent) !important;
    outline-offset: 2px !important;
    border-radius: var(--r-sm);
}

/* ── Harakatni cheklash (BOSQICH 2.9) ─────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
        scroll-behavior: auto !important;
    }
}
