/* ============================================================
   DASTURLASH LMS — Premium UI
   Palitra: chuqur ko'k-binafsha gradient + glassmorphism
   ============================================================ */
:root {
  --grad-a: #4338ca;
  --grad-b: #7c3aed;
  --grad-c: #0ea5e9;
  --accent: #7c3aed;
  --glass: rgba(255,255,255,.72);
  --glass-border: rgba(255,255,255,.55);
  --surface: #f4f5fb;
  --ink: #1e1b3a;
  --radius: 1.1rem;
  --shadow-soft: 0 10px 30px rgba(67,56,202,.10);
}
[data-bs-theme="dark"] {
  --glass: rgba(23,23,42,.72);
  --glass-border: rgba(255,255,255,.08);
  --surface: #0d0d1c;
  --ink: #e7e7f5;
  --shadow-soft: 0 10px 30px rgba(0,0,0,.45);
}
* { transition: background-color .25s, border-color .25s; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--surface);
  color: var(--ink);
  min-height: 100vh;
}
h1,h2,h3,h4,h5,.navbar-brand,.stat-value { font-family: 'Sora', 'Inter', sans-serif; }

/* Fon orblari (gradient background) */
.bg-orbs { position: fixed; inset: 0; z-index: -1; overflow: hidden; }
.bg-orbs span { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .35; }
.bg-orbs span:nth-child(1){ width:420px;height:420px;background:var(--grad-a); top:-120px; left:-80px; }
.bg-orbs span:nth-child(2){ width:380px;height:380px;background:var(--grad-b); bottom:-120px; right:-60px; }
.bg-orbs span:nth-child(3){ width:300px;height:300px;background:var(--grad-c); top:40%; left:55%; opacity:.22; }

/* Navbar */
.app-navbar {
  background: var(--glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--glass-border);
}
.brand-badge {
  width: 38px; height: 38px; display:inline-flex; align-items:center; justify-content:center;
  background: linear-gradient(135deg, var(--grad-a), var(--grad-b));
  color:#fff; border-radius: .8rem; font-size: 1.1rem;
  box-shadow: 0 6px 16px rgba(124,58,237,.35);
}
.btn-icon { border-radius: .8rem; border: 1px solid var(--glass-border); background: transparent; color: inherit; }
.btn-icon:hover { background: rgba(124,58,237,.12); }
.user-chip { border-radius: 2rem; border: 1px solid var(--glass-border); color: inherit; }
.avatar-circle {
  width: 32px; height: 32px; border-radius: 50%; display:inline-flex; align-items:center; justify-content:center;
  background: linear-gradient(135deg, var(--grad-b), var(--grad-c)); color:#fff; font-weight: 700; font-size: .85rem;
}
.search-pill { border: 1px solid var(--glass-border); border-radius: 2rem; overflow: hidden; background: var(--glass); width: 240px; }
.notif-dot {
  position:absolute; top:2px; right:2px; background:#ef4444; color:#fff; font-size:.62rem;
  min-width: 16px; height:16px; border-radius: 8px; display:flex; align-items:center; justify-content:center; padding: 0 4px;
}
.notif-menu { width: 300px; border-radius: 1rem; }

/* Layout */
.app-layout { display: flex; min-height: calc(100vh - 64px); }
.app-sidebar {
  width: 250px; flex-shrink: 0; padding: 1.1rem .8rem;
  background: var(--glass); backdrop-filter: blur(14px);
  border-right: 1px solid var(--glass-border);
  position: sticky; top: 64px; height: calc(100vh - 64px); overflow-y: auto;
}
.side-section { font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; color: #8b8ba7; padding: .4rem .8rem; }
.side-link {
  display:flex; align-items:center; gap:.75rem; padding:.6rem .9rem; margin:.15rem 0;
  border-radius:.85rem; color: inherit; text-decoration:none; font-weight:500; font-size:.92rem;
}
.side-link i { font-size: 1.05rem; opacity:.85; }
.side-link:hover { background: rgba(124,58,237,.10); }
.side-link.active {
  background: linear-gradient(135deg, var(--grad-a), var(--grad-b)); color:#fff;
  box-shadow: 0 6px 16px rgba(124,58,237,.35);
}
.app-main { flex: 1; padding: 1.4rem 1.4rem 2rem; min-width: 0; }

@media (max-width: 991.98px) {
  .app-sidebar { position: fixed; left: -270px; top: 64px; z-index: 1040; transition: left .3s; }
  .app-sidebar.show { left: 0; }
  .sidebar-backdrop { display:none; position:fixed; inset:0; background:rgba(0,0,0,.4); z-index:1035; }
  .sidebar-backdrop.show { display:block; }
}

/* Kartalar */
.glass-card {
  background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--glass-border); border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}
.glass-card, .stat-card, .module-card { transition: transform .22s, box-shadow .22s; }
.hover-lift:hover { transform: translateY(-4px); box-shadow: 0 16px 36px rgba(67,56,202,.18); }

.stat-card { padding: 1.1rem 1.25rem; display:flex; align-items:center; gap: 1rem; }
.stat-icon {
  width: 52px; height: 52px; border-radius: 1rem; flex-shrink:0;
  display:flex; align-items:center; justify-content:center; font-size: 1.4rem; color:#fff;
}
.stat-value { font-size: 1.5rem; font-weight: 800; line-height: 1.1; }
.stat-label { font-size: .8rem; color: #8b8ba7; }
.grad-1 { background: linear-gradient(135deg,#4338ca,#7c3aed); }
.grad-2 { background: linear-gradient(135deg,#0ea5e9,#22d3ee); }
.grad-3 { background: linear-gradient(135deg,#f59e0b,#f97316); }
.grad-4 { background: linear-gradient(135deg,#10b981,#22c55e); }
.grad-5 { background: linear-gradient(135deg,#ef4444,#f97316); }

/* Modul kartasi */
.module-card { position: relative; overflow: hidden; }
.module-card.locked { filter: grayscale(.5); opacity: .75; }
.module-num {
  width: 46px; height: 46px; border-radius: .9rem; font-family:'Sora'; font-weight:800; font-size:1.1rem;
  display:flex; align-items:center; justify-content:center; color:#fff;
  background: linear-gradient(135deg, var(--grad-a), var(--grad-b));
}
.chapter-eyebrow { font-size:.72rem; letter-spacing:.1em; text-transform:uppercase; color: var(--accent); font-weight:700; }

/* Circular progress */
.circ-wrap { position: relative; width: 130px; height: 130px; }
.circ-wrap svg { transform: rotate(-90deg); }
.circ-bg { fill:none; stroke: rgba(124,58,237,.15); stroke-width: 10; }
.circ-fg { fill:none; stroke: url(#circGrad); stroke-width: 10; stroke-linecap: round; transition: stroke-dashoffset 1s ease; }
.circ-label { position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; }

/* Progress bar */
.progress { height: 8px; border-radius: 6px; background: rgba(124,58,237,.12); }
.progress-bar { background: linear-gradient(90deg, var(--grad-a), var(--grad-b)); border-radius: 6px; }

/* Jadval */
.table { --bs-table-bg: transparent; }
.glass-card .table th { font-size:.78rem; text-transform:uppercase; letter-spacing:.05em; color:#8b8ba7; border-bottom-color: var(--glass-border); }
.glass-card .table td { border-bottom-color: var(--glass-border); vertical-align: middle; }

/* Tugmalar */
.btn-grad {
  background: linear-gradient(135deg, var(--grad-a), var(--grad-b)); color: #fff; border: 0;
  border-radius: .8rem; font-weight: 600;
  box-shadow: 0 6px 16px rgba(124,58,237,.35);
}
.btn-grad:hover { color:#fff; filter: brightness(1.08); transform: translateY(-1px); }
.form-control, .form-select { border-radius: .7rem; }
.form-control:focus, .form-select:focus { border-color: var(--accent); box-shadow: 0 0 0 .2rem rgba(124,58,237,.15); }

/* Login */
.login-hero {
  min-height: 100vh; display:flex; align-items:center; justify-content:center; padding: 1rem;
  background: linear-gradient(135deg, #1e1b4b 0%, #4338ca 45%, #7c3aed 100%);
}
.login-card { max-width: 420px; width: 100%; border-radius: 1.4rem; background: rgba(255,255,255,.12);
  backdrop-filter: blur(18px); border: 1px solid rgba(255,255,255,.25); color: #fff; }
.login-card .form-control { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.3); color: #fff; }
.login-card .form-control::placeholder { color: rgba(255,255,255,.6); }
.login-card label { color: rgba(255,255,255,.85); }

/* Video */
.video-frame { border-radius: var(--radius); overflow: hidden; background: #000; box-shadow: var(--shadow-soft); }
.video-frame video, .video-frame iframe { width: 100%; aspect-ratio: 16/9; display: block; border: 0; }

/* Badge holatlar */
.badge-soft { border-radius: 2rem; font-weight: 600; padding: .4em .8em; }
.bs-green { background: rgba(34,197,94,.15); color: #16a34a; }
.bs-red { background: rgba(239,68,68,.15); color: #dc2626; }
.bs-amber { background: rgba(245,158,11,.18); color: #d97706; }
.bs-blue { background: rgba(14,165,233,.15); color: #0284c7; }
.bs-violet { background: rgba(124,58,237,.15); color: #7c3aed; }

/* Yuklanish animatsiyasi */
.page-loader { position: fixed; inset: 0; background: var(--surface); z-index: 2000;
  display:flex; align-items:center; justify-content:center; }
.loader-ring { width: 52px; height: 52px; border: 5px solid rgba(124,58,237,.2); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.fade-up { animation: fadeUp .5s ease both; }
@keyframes fadeUp { from { opacity:0; transform: translateY(14px);} to { opacity:1; transform:none; } }

/* Sertifikat */
.certificate {
  background: #fff; color: #1e1b3a; border: 10px double #4338ca; border-radius: 1rem;
  padding: 3rem 2.5rem; text-align: center; max-width: 860px; margin: 0 auto; position: relative;
}
.certificate .cert-title { font-family:'Sora'; font-size: 2.2rem; font-weight: 800; letter-spacing:.06em; color:#4338ca; }
@media print {
  .app-navbar, .app-sidebar, .app-footer, .no-print, .bg-orbs, .sidebar-backdrop { display: none !important; }
  .app-main { padding: 0; }
  body { background: #fff; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
