/* ══════════════════════════════════════════════════════════════
   WEAKNESS SCREEN — نقاط ضعفي
   ══════════════════════════════════════════════════════════════ */

#screen-weakness {
  background: var(--bg);
  padding-top: 62px;
}

.wk-screen {
  max-width: 640px;
  margin: 0 auto;
  padding-bottom: 100px;
}

/* ── Header ─────────────────────────────────────────── */
.wk-header {
  position: relative;
  padding: 36px 22px 28px;
  overflow: hidden;
}
.wk-header-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 120% 80% at 50% 0%, rgba(99,102,241,.22) 0%, transparent 65%),
    radial-gradient(ellipse 60% 60% at 10% 50%, rgba(139,92,246,.1) 0%, transparent 55%),
    linear-gradient(180deg, rgba(10,5,21,.6) 0%, transparent 100%);
}
.wk-header-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 16px;
}
.wk-header-icon {
  font-size: 48px;
  line-height: 1;
  filter: drop-shadow(0 0 20px rgba(99,102,241,.6));
  animation: wk-float 3s ease-in-out infinite;
}
@keyframes wk-float {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}
.wk-header-title {
  font-size: 24px;
  font-weight: 900;
  background: linear-gradient(135deg, #a5b4fc, #818cf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 4px;
}
.wk-header-sub {
  font-size: 12px;
  color: rgba(255,255,255,.45);
  font-weight: 600;
}

/* ── Body ─────────────────────────────────────────── */
.wk-body {
  padding: 0 18px;
}
@media(min-width:600px){
  .wk-header { padding: 40px 28px 32px; }
  .wk-body   { padding: 0 28px; }
}

/* ── Empty / Pending state ─────────────────────────── */
.wk-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 20px 16px 30px;
  gap: 14px;
}
.wk-empty-icon {
  font-size: 64px;
  line-height: 1;
  filter: drop-shadow(0 0 24px rgba(99,102,241,.5));
  animation: wk-float 3s ease-in-out infinite;
}
.wk-empty-title {
  font-size: 22px;
  font-weight: 900;
  color: var(--text);
}
.wk-empty-desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
  max-width: 280px;
}
.wk-empty-hint {
  font-size: 12px;
  color: rgba(255,255,255,.4);
}
.wk-empty-hint b { color: #a5b4fc; }
.wk-go-btn {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  font-size: 15px;
  font-weight: 900;
  padding: 14px 36px;
  border-radius: 16px;
  border: none;
  box-shadow: 0 8px 24px rgba(99,102,241,.4);
  cursor: pointer;
  margin-top: 6px;
}

/* ── Pending banner (shown when < MIN questions) ──── */
.wk-pending-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(99,102,241,.08);
  border: 1.5px solid rgba(99,102,241,.2);
  border-radius: 18px;
  padding: 18px 16px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}
.wk-pending-text { flex: 1; }
.wk-pending-title {
  font-size: 13px;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 4px;
}
.wk-pending-sub {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 10px;
}
.wk-go-sm {
  font-size: 12px !important;
  padding: 9px 18px !important;
  border-radius: 12px !important;
  margin-top: 0 !important;
}
/* Locked category card */
.wk-cat-locked { opacity: 0.6; }
.wk-cat-locked-badge {
  font-size: 16px;
  opacity: .5;
}

/* ── SVG Ring ────────────────────────────────────── */
.wk-ring-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.wk-svg-ring { display: block; }
.wk-ring-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.wk-ring-num {
  font-size: 22px;
  font-weight: 900;
  color: var(--text);
  line-height: 1;
}
.wk-ring-lbl {
  font-size: 10px;
  color: var(--muted);
  margin-top: 2px;
}

/* ── Stats row ───────────────────────────────────── */
.wk-stats-row {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
}
.wk-stat-card {
  flex: 1;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  padding: 16px 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.wk-acc-card { background: rgba(99,102,241,.06); border-color: rgba(99,102,241,.2); }
.wk-stat-val {
  font-size: 26px;
  font-weight: 900;
  color: var(--text);
  line-height: 1;
}
.wk-stat-lbl {
  font-size: 10px;
  color: var(--muted);
  font-weight: 700;
}
.wk-ring-sm { margin: 0; }

/* ── Section headers ─────────────────────────────── */
.wk-section-hdr {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 900;
  color: rgba(255,255,255,.7);
  margin-bottom: 12px;
  letter-spacing: .3px;
}
.wk-section-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 8px currentColor;
}

/* ── Category cards ──────────────────────────────── */
.wk-cats-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 26px;
}
.wk-cat-card {
  background: rgba(255,255,255,.03);
  border: 1.5px solid rgba(255,255,255,.08);
  border-radius: 16px;
  padding: 14px 16px;
  border-right: 3px solid var(--cc, #888);
  transition: background .2s;
}
.wk-cat-card:active { background: rgba(255,255,255,.06); }
.wk-cat-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.wk-cat-emoji {
  font-size: 26px;
  flex-shrink: 0;
  line-height: 1;
}
.wk-cat-card-info { flex: 1; min-width: 0; }
.wk-cat-card-name {
  font-size: 14px;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 2px;
}
.wk-cat-card-nums {
  font-size: 10px;
  color: var(--muted);
}
.wk-cat-pct-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1.5px solid;
  white-space: nowrap;
  background: transparent;
}
.wk-cat-bar-wrap { }
.wk-cat-bar-bg {
  height: 7px;
  background: rgba(255,255,255,.06);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 5px;
}
.wk-cat-bar-err {
  height: 100%;
  border-radius: 8px;
  box-shadow: 0 0 8px currentColor;
  transition: width .8s cubic-bezier(.4,0,.2,1);
}
.wk-cat-bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: 9.5px;
  font-weight: 700;
  opacity: .8;
}

/* ── Wrong questions list ────────────────────────── */
.wk-wrong-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 26px;
}
.wk-wrong-item {
  display: flex;
  align-items: center;
  gap: 0;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 14px;
  overflow: hidden;
}
.wk-wrong-bar {
  width: 4px;
  align-self: stretch;
  flex-shrink: 0;
}
.wk-wrong-body {
  flex: 1;
  padding: 12px 12px;
  min-width: 0;
}
.wk-wrong-q {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wk-wrong-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}
.wk-wrong-count {
  font-size: 10px;
  color: var(--muted);
  font-weight: 700;
}
.wk-wrong-cat {
  font-size: 10px;
  font-weight: 800;
}
.wk-wrong-x {
  padding: 0 14px;
  font-size: 14px;
  color: #EF4444;
  opacity: .6;
  font-weight: 900;
}

/* ── Train button ────────────────────────────────── */
.wk-train-btn {
  width: 100%;
  background: linear-gradient(135deg, #EF4444 0%, #DC2626 50%, #b91c1c 100%);
  color: #fff;
  font-size: 16px;
  font-weight: 900;
  padding: 16px;
  border-radius: 18px;
  border: none;
  box-shadow:
    0 8px 28px rgba(239,68,68,.4),
    0 0 0 1px rgba(255,255,255,.1) inset;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
  margin-bottom: 10px;
  letter-spacing: .3px;
}
.wk-train-btn:active {
  transform: translateY(3px);
  box-shadow: 0 4px 12px rgba(239,68,68,.3);
}
.wk-cta-hint {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 0;
}

/* ── Accuracy diff badge ─────────────────────────── */
.wk-acc-diff {
  display: inline-block;
  font-size: 10px;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: 20px;
  margin-right: 4px;
  vertical-align: middle;
}
.wk-acc-up   { background: rgba(16,185,129,.15); color: #4ade80; }
.wk-acc-down { background: rgba(239,68,68,.15);  color: #f87171; }

/* ── Extra stats row ─────────────────────────────── */
.wk-extra-stats {
  display: flex;
  gap: 8px;
  margin-bottom: 22px;
  overflow-x: auto;
  padding-bottom: 2px;
}
.wk-extra-stat {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 90px;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 14px;
  padding: 10px 12px;
}
.wk-extra-icon { font-size: 20px; flex-shrink: 0; }
.wk-extra-val  { font-size: 13px; font-weight: 900; color: var(--text); line-height: 1.2; }
.wk-extra-lbl  { font-size: 9.5px; color: var(--muted); font-weight: 700; margin-top: 2px; }
.wk-best-val   { color: #4ade80; }
.wk-worst-val  { color: #f87171; }

/* ── Per-category train button ───────────────────── */
.wk-cat-train-btn {
  width: 100%;
  margin-top: 12px;
  padding: 9px;
  border-radius: 12px;
  border: 1.5px solid;
  background: transparent;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: background .15s, transform .12s;
}
.wk-cat-train-btn:active { transform: scale(.97); }

/* ── Wrong questions expand ──────────────────────── */
.wk-wrong-item { cursor: pointer; }
.wk-wrong-q    { white-space: normal; }
.wk-wrong-answer {
  display: none;
  margin-top: 8px;
  padding: 8px 10px;
  background: rgba(16,185,129,.08);
  border: 1px solid rgba(16,185,129,.2);
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.5;
}
.wk-wrong-item.wk-wrong-open .wk-wrong-answer { display: block; }
.wk-wrong-item.wk-wrong-open .wk-wrong-chevron { transform: rotate(90deg); }
.wk-correct-label { color: #4ade80; font-weight: 800; margin-left: 4px; }
.wk-correct-text  { color: var(--text); font-weight: 700; }
.wk-wrong-chevron {
  padding: 0 14px;
  font-size: 20px;
  color: var(--muted);
  font-weight: 300;
  transition: transform .2s;
  flex-shrink: 0;
}

/* ── Train modal ─────────────────────────────────── */
@keyframes wk-slide-up {
  from { transform: translateY(60px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
@keyframes wk-slide-down {
  from { transform: translateY(0);    opacity: 1; }
  to   { transform: translateY(80px); opacity: 0; }
}
@keyframes fadeOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}
.wk-modal-box {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 26px;
  padding: 20px 20px 16px;
  width: 100%;
  max-width: 420px;
}
.wk-modal-handle {
  width: 40px; height: 4px;
  background: rgba(255,255,255,.15);
  border-radius: 2px;
  margin: 0 auto 20px;
}
.wk-modal-counts {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
.wk-count-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18px 8px;
  border-radius: 18px;
  border: 2px solid rgba(from var(--mc) r g b / .25);
  background: rgba(from var(--mc) r g b / .08);
  color: var(--text);
  font-family: var(--font);
  cursor: pointer;
  transition: transform .12s, background .12s, border-color .12s;
}
.wk-count-btn:active {
  transform: scale(.93);
  background: rgba(from var(--mc) r g b / .22);
}
.wk-count-num { font-size: 22px; font-weight: 900; line-height: 1; color: var(--mc, #6366f1); }
.wk-count-lbl { font-size: 10px; font-weight: 700; color: var(--muted); margin-top: 4px; }
.wk-modal-cancel {
  width: 100%;
  padding: 13px;
  border-radius: 14px;
  border: 1.5px solid var(--border2);
  background: transparent;
  color: var(--muted);
  font-family: var(--font);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: transform .12s, background .12s, color .12s;
}
.wk-modal-cancel:active {
  transform: scale(.95);
  background: rgba(255,255,255,.08);
  color: var(--text);
}

/* ── Nav button highlight — same indigo as other active tabs ── */
.mnav-weakness.active { color: #93C5FD !important; }

/* ── Light mode ──────────────────────────────────── */
body.light #screen-weakness { background: #f0f4f8; padding-top: 62px; }
body.light .wk-header-bg {
  background:
    radial-gradient(ellipse 120% 80% at 50% 0%, rgba(99,102,241,.1) 0%, transparent 65%),
    linear-gradient(180deg, #e8eef8 0%, #f0f4f8 100%);
}
body.light .wk-stat-card  { background: #fff; border-color: rgba(0,0,0,.08); box-shadow: 0 2px 8px rgba(0,0,0,.05); }
body.light .wk-acc-card   { background: rgba(99,102,241,.05); border-color: rgba(99,102,241,.18); }
body.light .wk-cat-card   { background: #fff; border-color: rgba(0,0,0,.08); box-shadow: 0 2px 8px rgba(0,0,0,.04); }
body.light .wk-cat-bar-bg { background: rgba(0,0,0,.08); }
body.light .wk-wrong-item { background: #fff; border-color: rgba(0,0,0,.07); box-shadow: 0 1px 6px rgba(0,0,0,.04); }
body.light .wk-header-title { background: linear-gradient(135deg, #6366f1, #8b5cf6); -webkit-background-clip: text; background-clip: text; }
body.light .wk-svg-ring circle:first-child { stroke: rgba(0,0,0,.07); }
body.light .wk-pending-banner { background: rgba(99,102,241,.06); }
body.light .wk-section-hdr { color: rgba(15,23,42,.6); }
