/* ==========================================================================
   PREMIUM kartochkalar — gradient, glow, hover, sidebar.
   Saidmurod talabi: admin panelidagi kartochkalar va sidebar
   "premium" ko'rinishda bo'lishi kerak.
   Yangi kompilyatsiya talab qilmaydi — alohida fayl, base.html'da ulanadi.
   ========================================================================== */

:root {
    --premium-red: #e4002b;
    --premium-red-dark: #b00020;
    --premium-slate: #0f172a;
    --premium-slate-light: #1e293b;
    --premium-gold: #f59e0b;
}

/* ── 1. Premium kartochka (asosiy klass) ─────────────────────────────── */

.premium-card {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(255,255,255,0.97) 0%, rgba(248,250,252,0.97) 100%);
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.03);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.25s ease;
}

.premium-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, var(--premium-red), var(--premium-red-dark));
    transition: width 0.25s ease;
    z-index: 1;
}

.premium-card:hover {
    box-shadow: 0 10px 30px -5px rgba(15, 23, 42, 0.08),
                0 8px 15px -6px rgba(15, 23, 42, 0.04);
    transform: translateY(-2px);
    border-color: rgba(15, 23, 42, 0.10);
}

.premium-card:hover::before {
    width: 6px;
    box-shadow: 0 0 12px rgba(228, 0, 43, 0.35);
}

/* ── 2. Kartochka ichida chap yuqorida ikon ───────────────────────────── */

.premium-card-icon {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 15px;
    color: var(--premium-red);
    background: linear-gradient(135deg, rgba(228, 0, 43, 0.10), rgba(228, 0, 43, 0.04));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
    z-index: 0;
}

.premium-card-icon.blue   { color: #2563eb; background: linear-gradient(135deg, rgba(59,130,246,0.10), rgba(59,130,246,0.04)); }
.premium-card-icon.amber  { color: #d97706; background: linear-gradient(135deg, rgba(245,158,11,0.10), rgba(245,158,11,0.04)); }
.premium-card-icon.green  { color: #059669; background: linear-gradient(135deg, rgba(16,185,129,0.10), rgba(16,185,129,0.04)); }
.premium-card-icon.slate  { color: #475569; background: linear-gradient(135deg, rgba(100,116,139,0.10), rgba(100,116,139,0.04)); }
.premium-card-icon.violet { color: #7c3aed; background: linear-gradient(135deg, rgba(139,92,246,0.10), rgba(139,92,246,0.04)); }

/* ── 3. Chap chegara rangi (alert/muhim) ─────────────────────────────── */

.premium-card-alert-red::before   { background: linear-gradient(180deg, #e4002b, #b00020); }
.premium-card-alert-red:hover::before   { box-shadow: 0 0 14px rgba(228, 0, 43, 0.4); }

.premium-card-alert-amber::before { background: linear-gradient(180deg, #f59e0b, #d97706); }
.premium-card-alert-amber:hover::before { box-shadow: 0 0 14px rgba(245, 158, 11, 0.4); }

.premium-card-alert-blue::before  { background: linear-gradient(180deg, #3b82f6, #2563eb); }
.premium-card-alert-blue:hover::before  { box-shadow: 0 0 14px rgba(59, 130, 246, 0.4); }

/* ── 4. Sidebar gradient ─────────────────────────────────────────────── */

.dashboard-sidebar {
    background: linear-gradient(180deg, #0f172a 0%, #131c2e 60%, #1e293b 100%) !important;
}

.dashboard-sidebar .sidebar-header {
    background: linear-gradient(135deg, rgba(228, 0, 43, 0.12) 0%, rgba(228, 0, 43, 0.02) 50%, transparent 100%);
    border-radius: 18px;
    padding: 18px 22px;
    margin: 16px 16px 24px;
    border: 1px solid rgba(228, 0, 43, 0.08);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    position: relative;
    overflow: hidden;
}

.dashboard-sidebar .sidebar-header::before {
    content: '';
    position: absolute;
    top: -40px;
    right: -40px;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(228,0,43,0.18) 0%, transparent 70%);
    pointer-events: none;
}

.dashboard-sidebar .profile-card {
    background: linear-gradient(135deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.02) 100%) !important;
    border: 1px solid rgba(255,255,255,0.10) !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25) !important;
    /* 2026-09-22: pastdagi alohida override bilan birlashtirildi (bitta selektor, kamroq !important) */
    border-radius: 10px !important;
    padding: 6px 8px !important;
}

/* ── 5. Premium progress bar (skill uchun) ──────────────────────────── */

.premium-bar {
    height: 6px;
    background: rgba(15, 23, 42, 0.06);
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}

.premium-bar > div {
    height: 100%;
    background: linear-gradient(90deg, var(--premium-red), var(--premium-gold));
    border-radius: 999px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.premium-bar > div::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: premium-shimmer 2.5s infinite;
}

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

/* ── 6. Premium matn ──────────────────────────────────────────────────── */

.premium-stat {
    font-size: 32px;
    font-weight: 900;
    letter-spacing: -0.025em;
    line-height: 1;
    color: var(--premium-slate);
}

.premium-stat-sm {
    font-size: 22px;
    font-weight: 900;
    letter-spacing: -0.025em;
    line-height: 1;
}

/* ⚠️ 2026-09-22: 10px edi -> 11px. Butun platformada eng kichik matn 11px
   (`text-micro`), aks holda `wb_deep_audit.py` nuqson deb belgilaydi. */
.premium-label {
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #64748b;
}

.premium-sub {
    font-size: 11px;
    color: #64748b;
    margin-top: 4px;
}

/* ── 7. Premium badge ────────────────────────────────────────────────── */

.premium-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 6px;
    /* ⚠️ 2026-09-22: 9px edi — eng ko'p uchraydigan mayda matn manbasi edi
       (bitta sahifada 160 ta element). Endi 11px. */
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* ⚠️ WCAG 4.5:1 kontrast. Avval #b91c1c/047857/b45309 edi — 4.03-4.47 (yetsmasm).
  Yangi: #991b1b/065f46/92400e — 5.69-5.99 ✓ (CSS hisoblangan). */
.premium-badge.red   { background: linear-gradient(135deg, #fee2e2, #fecaca); color: #991b1b; }
.premium-badge.blue  { background: linear-gradient(135deg, #dbeafe, #bfdbfe); color: #1d4ed8; }
.premium-badge.green { background: linear-gradient(135deg, #d1fae5, #a7f3d0); color: #065f46; }
.premium-badge.amber { background: linear-gradient(135deg, #fef3c7, #fde68a); color: #92400e; }
.premium-badge.slate { background: linear-gradient(135deg, #f1f5f9, #e2e8f0); color: #475569; }

/* ── 8. Premium jadval ────────────────────────────────────────────────── */

.premium-table {
    width: 100%;
    text-align: left;
}

.premium-table thead tr {
    background: linear-gradient(180deg, rgba(15,23,42,0.02), rgba(15,23,42,0.04));
    border-top: 1px solid rgba(15,23,42,0.06);
    border-bottom: 1px solid rgba(15,23,42,0.06);
}

.premium-table th {
    padding: 10px 12px;
    /* ⚠️ 2026-09-22: 10px edi -> 11px (platforma pol o'lchami). */
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #475569;
}

.premium-table tbody tr {
    border-bottom: 1px solid rgba(15,23,42,0.04);
    transition: background 0.15s ease;
}

.premium-table tbody tr:hover {
    background: linear-gradient(90deg, rgba(228,0,43,0.04), transparent);
}

.premium-table tbody tr:last-child { border-bottom: 0; }

.premium-table td {
    padding: 12px;
    font-size: 13px;
}

/* ── 9. Premium CTA (tugma) ──────────────────────────────────────────── */

.premium-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 14px;
    border-radius: 12px;
    background: linear-gradient(135deg, #1f2937, #0f172a);
    color: white;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    box-shadow: 0 4px 12px rgba(15,23,42,0.25);
    transition: all 0.25s ease;
    border: 1px solid rgba(255,255,255,0.05);
}

.premium-cta:hover {
    background: linear-gradient(135deg, #374151, #1f2937);
    box-shadow: 0 6px 18px rgba(15,23,42,0.35);
    transform: translateY(-1px);
}

.premium-cta.red {
    background: linear-gradient(135deg, var(--premium-red), var(--premium-red-dark));
    box-shadow: 0 4px 12px rgba(228, 0, 43, 0.30);
}

.premium-cta.red:hover {
    background: linear-gradient(135deg, #ff1f4d, #d4002e);
    box-shadow: 0 6px 18px rgba(228, 0, 43, 0.45);
}

/* ── 10. Skeleton / loading ──────────────────────────────────────────── */

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

.premium-pulse {
    animation: premium-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ── 11. Animatsiya (slide-in) ───────────────────────────────────────── */

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

.premium-card {
    animation: premium-fade-up 0.4s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}

.premium-card:nth-child(1) { animation-delay: 0.00s; }
.premium-card:nth-child(2) { animation-delay: 0.05s; }
.premium-card:nth-child(3) { animation-delay: 0.10s; }
.premium-card:nth-child(4) { animation-delay: 0.15s; }
.premium-card:nth-child(5) { animation-delay: 0.20s; }
.premium-card:nth-child(6) { animation-delay: 0.25s; }

/* ── 12. Accessibility — kamaytirilgan harakat ──────────────────────── */

@media (prefers-reduced-motion: reduce) {
    .premium-card,
    .premium-card:hover,
    .premium-cta:hover,
    .premium-bar > div {
        transition: none !important;
        animation: none !important;
        transform: none !important;
    }
}
/* ── 13. Premium statlar grid — 1440+ da 6 bir qator ─────────────── */
/* ⚠️ Tailwind'da `xl:grid-cols-5` klassi yo'q (faqat xl:grid-cols-3 bor) — bu
   holatda `xl:grid-cols-6` 1440 viewportda SIG'MAYDI (sidebar 256 + main 1133 da
   6 × 190 = 1140 + gap 60 = 1200 > 1133). YECHIM: statik klasslar:
   · < 640 px: 2 (telefon)
   · 640-1024: 3 (planshet)
   · 1024-1280: 5 (kichik desktop) — sidebar 256 + main ~768 da 5 sig'adi
   · 1280-1440: 5 (1440) — sig'adi
   · ≥ 1440: 6 (to'liq qator, bo'sh joy yo'q)
*/
/* Responsive auto-fit: viewport kengligiga qarab 2-7 kartochka.
   ⚠️ 2026-09-21: 1440 sidebar 256 + main 1133 da 7 × 150 + 6 × 12 = 1122 ≤ 1133 ✓.
   Eng kichik ekranda (320) 2 ta kartochka (1 qator), planshet (768) 5, desktop (1024+) 7.
   2026-09-22: umumiy grid xossalari birlashtirildi (takror 6 qator → 3 qator). */
.premium-stats, .premium-stats-5 {
    display: grid;
    gap: 12px;
    margin-bottom: 16px;
}
.premium-stats {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

/* ── 14. Premium hisobot grid — responsive auto-fit ─────────────── */
/* Hisobot sahifasida 5 ta premium-card. 1440+ da bir qator.
   minmax(180px, 1fr) — 1440 da 5 × 220 + 4 × 12 = 1148 → sig'adi. */
.premium-stats-5 {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

/* ── 15. Premium FILTR — bir qator, ixcham (hisobot sahifasi) ───────── */
/* 2026-09-21: 6 ta maydon + 2 ta tugma + sanog'ich → BIR qator.
   Kichik ekranda (1024-) 3-4 ustun, telefon (640-) 2 ustun. */
.premium-filter {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    align-items: end;
}
@media (min-width: 640px) {
    .premium-filter { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
    .premium-filter { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1366px) {
    /* 6 ta maydon + tugmalar + sanog'ich: to'liq bir qator */
    .premium-filter {
        grid-template-columns: 1fr 1.4fr 1fr 1fr 0.8fr 0.8fr auto auto;
    }
}

/* Kichik va ixcham input/select */
.premium-input {
    width: 100%;
    margin-top: 4px;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.10);
    border-radius: 10px;
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 600;
    color: #0f172a;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.premium-input::placeholder { color: #64748b; font-weight: 500; }
.premium-input:focus {
    outline: none;
    border-color: #004b87;
    box-shadow: 0 0 0 3px rgba(0, 75, 135, 0.08);
}
/* ⚠️ WCAG 2.4.7: klaviatura fokusi uchun `outline: none` xavfsiz emas —
   :focus-visible alternativ ko'rsatilishi kerak. */
.premium-input:focus-visible {
    outline: 2px solid #004b87 !important;
    outline-offset: 1px;
}

/* Tugmalar (filtrlash / tozalash) — kvadrat, ikonkali */
.premium-filter-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}
.premium-filter-actions .premium-cta {
    padding: 8px 11px;
    min-width: 38px;
    justify-content: center;
}

/* "Tozalash" — shaffofroq (ghost) */
.premium-cta-ghost {
    background: rgba(15, 23, 42, 0.04) !important;
    color: #475569 !important;
    box-shadow: none !important;
    border: 1px solid rgba(15, 23, 42, 0.10) !important;
}
.premium-cta-ghost:hover {
    background: rgba(15, 23, 42, 0.09) !important;
    color: #0f172a !important;
}

/* Sanog'ich ("158 ta natija") */
.premium-filter-count {
    font-size: 11px;
    font-weight: 800;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    white-space: nowrap;
    align-self: center;
    padding-bottom: 2px;
}

/* ── 16. Sidebar — premium va optimal (2026-09-21) ───────────────────── */
/* Mavjud `style.css` stillarini USTIGA yozmaymiz — faqat premium qatlam:
   ixchamroq padding, hover'da siljish (translateX), ikonka animatsiyasi. */

/* Havolalar — ixchamroq va yumshoqroq */
.dashboard-sidebar .nav-item {
    padding: 10px 14px !important;
    border-radius: 12px !important;
    font-size: 12.5px !important;
    transition: color 0.2s, background-color 0.2s, box-shadow 0.2s,
                transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hover: o'ngga kichik siljish + glow (premium harakat) */
.dashboard-sidebar .nav-item:hover {
    background: rgba(255, 255, 255, 0.09) !important;
    color: #fff !important;
    transform: translateX(3px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18),
                inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

/* Ikonka: hover'da kattalashadi va rangga kiradi */
.dashboard-sidebar .nav-item:hover i {
    transform: scale(1.18) rotate(6deg);
    color: #e4002b;
}

/* Faol havola — brend gradient + yorqin soyali */
.dashboard-sidebar .nav-item-active {
    background: linear-gradient(135deg, #e4002b 0%, #b00020 100%) !important;
    box-shadow: 0 8px 22px rgba(228, 0, 43, 0.35) !important;
    transform: translateX(3px);
}

/* Bo'lim sarlavhalari (Mock Library / Faoliyat / Ma'lumotlar)
   ⚠️ 2026-09-22: 9px edi — o'lchandi (`wb_deep_audit.py`) va 11px dan kichik
   matn butun platformada nuqson deb belgilandi. Eng kichik ruxsat etilgan
   o'lcham — 11px (`text-micro`). */
.dashboard-sidebar nav > div > p {
    font-size: 11px !important;
    letter-spacing: 0.22em;
    opacity: 0.85;
}

/* Track toggle (Mock / CEFR) — yumshoqroq */
.admin-track-toggle {
    border-radius: 14px !important;
    padding: 5px !important;
    margin: 0 14px 18px 14px !important;
}
.admin-track-btn {
    border-radius: 11px !important;
    padding: 8px !important;
}

/* Profil kartasi — ixcham va premium (asosiy qoida yuqorida, :119 bilan birlashgan) */
.dashboard-sidebar .profile-card:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(228, 0, 43, 0.4) !important;
}

/* Sidebar scrollbar — ingichka va yumshoq */
.dashboard-sidebar .custom-scrollbar::-webkit-scrollbar { width: 5px; }
.dashboard-sidebar .custom-scrollbar::-webkit-scrollbar-track { background: transparent; }
.dashboard-sidebar .custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.14);
    border-radius: 3px;
}
.dashboard-sidebar .custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.24);
}
