/**
 * weak-topics.css
 *
 * All styles for the "Focus Here Next / Weak Topics" section.
 *
 * Add to Yii2 in one of two ways:
 *
 * Option A — AppAsset (recommended):
 *   In assets/AppAsset.php add to $css array:
 *   'css/weak-topics.css',
 *   Place this file at: web/css/weak-topics.css
 *
 * Option B — Inline in layout:
 *   In views/layouts/main.php inside <head>:
 *   <?php $this->registerCssFile('@web/css/weak-topics.css') ?>
 *
 * CSS custom properties (tokens) must already be defined in your
 * main stylesheet or layout <head>. Add these if not already present:
 */

/* ── CSS Tokens ─────────────────────────────────────────────────────
   Add to your :root block in main.css if not already there.
   ----------------------------------------------------------------- */
:root {
  --brand-blue:      #2d3fd4;
  --brand-blue-dark: #1a2db0;
  --brand-blue-hero: #1e35c4;
  --brand-orange:    #f47221;
  --brand-orange-dk: #d9610d;
  --brand-yellow:    #f5c400;

  --surface:    #ffffff;
  --surface2:   #eef1f8;
  --border:     #dde3f0;
  --text:       #0d1b3e;
  --text-muted: #5a6a8a;
  --text-light: #8fa0bf;

  --physics:      #0891b2;
  --physics-bg:   #ecfeff;
  --physics-bd:   #a5f3fc;
  --chemistry:    #7c3aed;
  --chemistry-bg: #f5f3ff;
  --chemistry-bd: #ddd6fe;
  --biology:      #059669;
  --biology-bg:   #ecfdf5;
  --biology-bd:   #6ee7b7;

  --red:    #dc2626;
  --red-bg: #fef2f2;
  --red-bd: #fca5a5;

  --radius-sm: 8px;
  --radius-lg: 18px;
}

/* ── Fade-up animation ──────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════════════════════════
   SEC-INTRO  —  lightweight section intro strip
═══════════════════════════════════════════════════════════════════ */
.sec-intro {
  display: flex;
  align-items: flex-start;
  gap: .85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .85rem 1.1rem;
  margin-bottom: .85rem;
  border-left: 3px solid var(--brand-blue);
}
.sec-intro.phys   { border-left-color: var(--physics); }
.sec-intro.chem   { border-left-color: var(--chemistry); }
.sec-intro.bio    { border-left-color: var(--biology); }
.sec-intro.orange { border-left-color: var(--brand-orange); }

.sec-intro__icon { font-size: 1.3rem; flex-shrink: 0; }
.sec-intro__body { flex: 1; }

.sec-intro__title {
  font-size: .82rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: .15rem;
}
.sec-intro__desc {
  font-size: .75rem;
  color: var(--text-muted);
  line-height: 1.55;
}
.sec-intro__desc strong { color: var(--text); font-weight: 700; }

.sec-intro__cta {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .72rem;
  font-weight: 700;
  color: var(--brand-blue);
  margin-top: .25rem;
  text-decoration: none;
  transition: gap .15s;
}
.sec-intro__cta:hover { gap: .5rem; text-decoration: none; }

/* ═══════════════════════════════════════════════════════════════════
   WEAK SECTION  —  outer wrapper
═══════════════════════════════════════════════════════════════════ */
.weak-section {
  animation: fadeUp .4s .04s ease both;
  margin-bottom: 1.75rem;
}

/* ═══════════════════════════════════════════════════════════════════
   FOCUS CARD  —  the containing card
═══════════════════════════════════════════════════════════════════ */
.focus-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 3px 14px rgba(45, 63, 212, .06);
}

/* Card header — blue gradient bar */
.focus-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .9rem 1.5rem;
  background: linear-gradient(90deg, #0c1a6e, var(--brand-blue));
  flex-wrap: wrap;
  gap: .5rem;
}
.focus-card__head-left {
  display: flex;
  align-items: center;
  gap: .6rem;
}
.focus-card__head h2 {
  font-size: .875rem;
  font-weight: 800;
  color: #fff;
  margin: 0;
}
.focus-card__head-sub {
  font-size: .68rem;
  color: rgba(255, 255, 255, .6);
  font-weight: 500;
}
.focus-card__head-link {
  font-size: .72rem;
  font-weight: 700;
  color: rgba(255, 255, 255, .75);
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .2);
  padding: .28rem .75rem;
  border-radius: 20px;
  text-decoration: none;
  transition: all .15s;
  white-space: nowrap;
}
.focus-card__head-link:hover {
  background: rgba(255, 255, 255, .22);
  color: #fff;
  text-decoration: none;
}

/* Card body */
.focus-card__body { padding: 1.1rem 1.5rem; }

/* ═══════════════════════════════════════════════════════════════════
   EMPTY STATE
═══════════════════════════════════════════════════════════════════ */
.focus-empty {
  text-align: center;
  padding: 1.75rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .6rem;
}
.focus-empty__icon  { font-size: 2rem; }
.focus-empty__title {
  font-size: .875rem;
  font-weight: 800;
  color: var(--text);
}
.focus-empty__sub {
  font-size: .78rem;
  color: var(--text-muted);
  line-height: 1.65;
  max-width: 340px;
}
.focus-empty__cta {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: var(--brand-orange);
  color: #fff;
  font-size: .8rem;
  font-weight: 800;
  padding: .55rem 1.25rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  margin-top: .25rem;
  box-shadow: 0 3px 10px rgba(244, 114, 33, .35);
  transition: all .15s;
}
.focus-empty__cta:hover {
  background: var(--brand-orange-dk);
  transform: translateY(-1px);
  text-decoration: none;
  color: #fff;
}

/* ═══════════════════════════════════════════════════════════════════
   WEAK TOPIC ROWS
═══════════════════════════════════════════════════════════════════ */
.weak-topics {
  display: flex;
  flex-direction: column;
  gap: .6rem;
}

.weak-topic-row {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .75rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
}
.weak-topic-row:hover {
  border-color: var(--brand-orange);
  box-shadow: 0 2px 10px rgba(244, 114, 33, .1);
}

/* Rank badge */
.weak-rank {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .72rem;
  font-weight: 900;
  color: #fff;
  background: linear-gradient(135deg, #dc2626, #f87171); /* rank-1 red */
}
.weak-rank.rank-2 { background: linear-gradient(135deg, #f47221, #fb923c); }
.weak-rank.rank-3 { background: linear-gradient(135deg, #f5c400, #fde047); color: #92400e; }

/* Subject colour dot */
.weak-topic-row__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.weak-topic-row__dot.phy  { background: var(--physics); }
.weak-topic-row__dot.chem { background: var(--chemistry); }
.weak-topic-row__dot.bio  { background: var(--biology); }

/* Topic name + meta */
.weak-topic-row__info { flex: 1; min-width: 0; }

.weak-topic-row__name {
  font-size: .85rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.weak-topic-row__meta {
  font-size: .68rem;
  color: var(--text-muted);
  margin-top: .1rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}

/* Accuracy pill */
.acc-pill {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  font-size: .65rem;
  font-weight: 800;
  padding: .12rem .5rem;
  border-radius: 20px;
}
.acc-pill.low  {
  background: var(--red-bg);
  color: var(--red);
  border: 1px solid var(--red-bd);
}
.acc-pill.mid  {
  background: #fff5ee;
  color: var(--brand-orange);
  border: 1px solid #fdd0b0;
}
.acc-pill.high {
  background: var(--biology-bg);
  color: var(--biology);
  border: 1px solid var(--biology-bd);
}

/* Accuracy mini-bar */
.weak-acc-bar { flex: 1; max-width: 120px; }
.weak-acc-bar__track {
  height: 5px;
  background: var(--surface2);
  border-radius: 3px;
  overflow: hidden;
}
.weak-acc-bar__fill {
  height: 100%;
  border-radius: 3px;
  background: var(--red);
  transition: width .6s ease;
}
.weak-acc-bar__fill.mid  { background: var(--brand-orange); }
.weak-acc-bar__fill.high { background: var(--biology); }

/* Practise now button */
.btn-practise-now {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .72rem;
  font-weight: 800;
  white-space: nowrap;
  padding: .38rem .85rem;
  border-radius: 20px;
  background: #fff5ee;
  color: var(--brand-orange);
  border: 1.5px solid #fdd0b0;
  flex-shrink: 0;
  transition: all .15s;
  text-decoration: none;
}
.btn-practise-now:hover {
  background: var(--brand-orange);
  color: #fff;
  border-color: var(--brand-orange);
  text-decoration: none;
}

/* ═══════════════════════════════════════════════════════════════════
   FOCUS STATS  —  summary row at bottom
═══════════════════════════════════════════════════════════════════ */
.focus-stats {
  display: flex;
  gap: .75rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.focus-stat {
  flex: 1;
  min-width: 90px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .6rem .85rem;
  text-align: center;
}
.focus-stat__val {
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--brand-blue);
  letter-spacing: -.03em;
  line-height: 1;
}
.focus-stat__lbl {
  font-size: .6rem;
  font-weight: 700;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-top: .15rem;
}

/* ═══════════════════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════════════════ */
@media (max-width: 680px) {
  .weak-topic-row {
    flex-wrap: wrap;
    gap: .6rem;
  }
  .weak-acc-bar    { display: none; }  /* hide bar on very small screens */
  .btn-practise-now { margin-left: auto; }
  .focus-stats     { grid-template-columns: 1fr 1fr; display: grid; }
  .focus-stat      { min-width: 0; }
}
