/* ═══════════════════════════════════════════════════════════
   manaAI — umumiy dizayn tizimi (yangi sahifalar uchun)
   Mavjud index.html/course.html bilan bir xil qorong'u tema.
   ═══════════════════════════════════════════════════════════ */

:root {
  --bg: #09090b;
  --surface: #18181b;
  --surface-2: #1f1f23;
  --border: #27272a;
  --border-2: #3f3f46;
  --text: #fafafa;
  --text-2: #d4d4d8;
  --muted: #a1a1aa;
  --muted-2: #71717a;
  --faint: #52525b;
  --green: #4ade80;
  --amber: #fbbf24;
  --orange: #fb923c;
  --radius: 12px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }

main {
  max-width: 800px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
}

/* ── Top bar ── */
.top-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; gap: 0.75rem; }
.back-btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.4rem 0.75rem; font-size: 0.82rem; color: var(--muted-2);
  border: 1px dashed var(--border-2); border-radius: 8px; cursor: pointer;
  background: none; transition: all 0.15s;
}
.back-btn:hover { border-color: var(--text); color: var(--text); }
.back-btn svg { width: 14px; height: 14px; }

/* ── Headings ── */
.top-label { font-size: 0.78rem; color: var(--muted-2); margin-bottom: 0.25rem; }
.page-title { font-size: 1.6rem; font-weight: 800; color: #fff; margin-bottom: 0.5rem; letter-spacing: -0.3px; }
.page-desc { font-size: 0.9rem; color: var(--muted-2); margin-bottom: 2rem; }
.section-label {
  font-size: 0.72rem; font-weight: 600; color: var(--faint);
  text-transform: uppercase; letter-spacing: 0.8px; margin: 2rem 0 0.75rem;
}
.section-label:first-of-type { margin-top: 0; }

/* ── Cards ── */
.card {
  display: block;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem 1.15rem;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
a.card, .card.clickable { cursor: pointer; }
a.card:hover, .card.clickable:hover { background: var(--surface-2); border-color: var(--border-2); }
.card-stack { display: flex; flex-direction: column; gap: 0.5rem; }

/* ── Badges ── */
.badge {
  font-size: 0.7rem; padding: 2px 8px; border-radius: 20px; font-weight: 500;
  flex-shrink: 0; white-space: nowrap;
}
.badge-free { background: rgba(74,222,128,0.1); color: var(--green); border: 1px solid rgba(74,222,128,0.2); }
.badge-soon { background: rgba(113,113,122,0.1); color: var(--muted-2); border: 1px solid var(--border); }
.badge-new  { background: rgba(251,191,36,0.12); color: var(--amber); border: 1px solid rgba(251,191,36,0.25); }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  padding: 0.7rem 1rem; border-radius: 10px; font-size: 0.88rem; font-weight: 600;
  cursor: pointer; border: 1px solid var(--border-2); background: none; color: var(--text);
  transition: all 0.15s; -webkit-tap-highlight-color: transparent;
}
.btn:hover { border-color: var(--text); }
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn-primary:hover { opacity: 0.9; }
.btn-block { width: 100%; }

/* ── Section quick-link grid (Bosh sahifa) ── */
.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.quick-tile {
  display: flex; flex-direction: column; gap: 0.5rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem; transition: all 0.15s;
}
.quick-tile:hover { background: var(--surface-2); border-color: var(--border-2); transform: translateY(-2px); }
.quick-tile .qi { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  border-radius: 9px; background: rgba(255,255,255,0.05); }
.quick-tile .qi svg { width: 18px; height: 18px; color: var(--text); }
.quick-tile .qt { font-size: 0.92rem; font-weight: 600; color: #fff; }
.quick-tile .qs { font-size: 0.76rem; color: var(--muted-2); }

/* ── Geymifikatsiya widget ── */
.gami-bar {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0.9rem 1rem;
}
.gami-row { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.7rem; }
.gami-lvl {
  width: 40px; height: 40px; flex-shrink: 0; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(251,191,36,0.2), rgba(251,146,60,0.15));
  border: 1px solid rgba(251,191,36,0.3);
}
.gami-lvl-num { font-size: 1.1rem; font-weight: 800; color: var(--amber); }
.gami-lvl-info { flex: 1; min-width: 0; }
.gami-lvl-name { font-size: 0.95rem; font-weight: 700; color: #fff; }
.gami-lvl-sub { font-size: 0.76rem; color: var(--muted-2); }
.gami-streak {
  font-size: 0.85rem; color: var(--orange); font-weight: 500;
  background: rgba(251,146,60,0.1); border: 1px solid rgba(251,146,60,0.2);
  padding: 4px 10px; border-radius: 20px; white-space: nowrap;
}
.gami-streak b { color: #fff; }
.gami-track { height: 7px; border-radius: 20px; background: rgba(255,255,255,0.06); overflow: hidden; }
.gami-fill {
  height: 100%; border-radius: 20px;
  background: linear-gradient(90deg, var(--amber), var(--orange));
  transition: width 0.6s cubic-bezier(0.25,0.46,0.45,0.94);
}

/* ── Profil statistika ── */
.prof-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; margin-top: 0.6rem; }
.prof-stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 0.75rem 0.4rem; text-align: center;
}
.ps-num { font-size: 1.1rem; font-weight: 800; color: #fff; }
.ps-lbl { font-size: 0.66rem; color: var(--muted-2); text-transform: uppercase; letter-spacing: 0.4px; margin-top: 2px; }
.prof-prog-top { display: flex; justify-content: space-between; font-size: 0.85rem; color: var(--text-2); margin-bottom: 0.6rem; }
.prof-prog-top span:last-child { color: var(--green); font-weight: 600; }

/* ── Badge grid ── */
.badge-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
.badge-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0.9rem 0.5rem; text-align: center;
  opacity: 0.4; filter: grayscale(1); transition: all 0.2s;
}
.badge-card.earned { opacity: 1; filter: none; border-color: var(--border-2); }
.badge-ic { font-size: 1.6rem; line-height: 1; margin-bottom: 0.4rem; }
.badge-tt { font-size: 0.78rem; font-weight: 600; color: #fff; }
.badge-ds { font-size: 0.68rem; color: var(--muted-2); margin-top: 2px; line-height: 1.3; }

@media (max-width: 600px) {
  .page-title { font-size: 1.35rem; }
}
