/* components.css — cards, badges, buttons, charts, tables. */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.1rem;
}
.card:last-child { margin-bottom: 0; }

/* ------------------------------------------------------------ controls */

select, input[type="text"] {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: .4rem .6rem;
  font: inherit;
  font-size: .85rem;
}

button.ghost, button.primary {
  border-radius: var(--radius-sm);
  padding: .42rem .8rem;
  font: inherit;
  font-size: .85rem;
  cursor: pointer;
  border: 1px solid var(--line);
}
button.ghost { background: transparent; color: var(--muted); }
button.ghost:hover { color: var(--text); border-color: var(--blue); }
button.ghost.danger:hover { color: var(--red); border-color: var(--red); }
button.primary {
  background: var(--blue); color: var(--bg); border-color: var(--blue); font-weight: 600;
  padding: .55rem 1.1rem;
}
button.primary:hover { filter: brightness(1.1); }

/* -------------------------------------------------------------- badges */

.badge {
  padding: .15rem .55rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 600;
  background: var(--surface-2);
  text-transform: lowercase;
}
.badge-chrome  { background: #2d4f7c; color: #a9c9ff; }
.badge-edge    { background: #1f5c56; color: #8fe3d8; }
.badge-youtube { background: #6b2735; color: #ffb3bf; }

.mode { font-size: .72rem; padding: .1rem .45rem; border-radius: 4px; font-weight: 600; }
.mode-capture  { background: rgba(158,206,106,.15); color: var(--green); }
.mode-free     { background: rgba(42,195,222,.15); color: var(--teal); }
.mode-describe { background: rgba(255,158,100,.15); color: var(--orange); }

/* ------------------------------------------------------------ callouts */

.callout {
  margin: 1rem 0 0;
  padding: .7rem .9rem;
  border-left: 3px solid var(--line);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: .84rem;
}
.callout.warn { border-color: var(--yellow); background: rgba(224,175,104,.08); }
.callout.info { border-color: var(--blue);   background: rgba(122,162,247,.08); }

.banner {
  max-width: 62rem;
  margin: 1rem auto 0;
  padding: .8rem 1rem;
  border: 1px solid var(--red);
  background: rgba(247,118,142,.08);
  border-radius: var(--radius-sm);
  font-size: .82rem;
}
.banner code { display: inline-block; margin-top: .2rem; font-size: .78rem; color: var(--orange); }

/* -------------------------------------------------------- session bar */

.session-bar { display: flex; align-items: center; gap: .8rem; }
.progress {
  flex: 1;
  height: 4px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
}
.progress span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--blue);
  transition: width .25s ease;
}
.streak { font-size: .82rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.streak.hot { color: var(--orange); }

/* --------------------------------------------------------- drill card */

.card-meta { display: flex; align-items: center; gap: .6rem; margin-bottom: 1.4rem; }

.label {
  margin: 0 0 .4rem;
  font-size: .74rem;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
}

.intent { font-size: 1.65rem; margin-bottom: 1.4rem; font-weight: 500; }

.zone {
  padding: 1.2rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  text-align: center;
}
.zone input[type="text"] {
  width: 100%; max-width: 20rem; text-align: center;
  font-family: var(--mono); font-size: 1rem;
}
.captured {
  margin: 0; min-height: 2.1rem;
  font-family: var(--mono); font-size: 1.4rem; color: var(--blue);
}

.actions { display: flex; gap: .5rem; justify-content: center; margin-top: 1rem; }

.answer {
  margin-top: 1.4rem; padding-top: 1.2rem;
  border-top: 1px solid var(--line); text-align: center;
}
.verdict {
  margin: 0 0 .7rem; font-size: .74rem;
  text-transform: uppercase; letter-spacing: .09em; font-weight: 600;
}
.verdict.right { color: var(--green); }
.verdict.wrong { color: var(--red); }
.verdict.neutral { color: var(--muted); }
.answer-command { margin: 0 0 .3rem; font-size: 1rem; }
.answer-keys { margin: 0; font-family: var(--mono); font-size: 1.35rem; color: var(--blue); }

/* ------------------------------------------------------------- grades */

.grades { display: grid; grid-template-columns: repeat(4, 1fr); gap: .55rem; margin-top: 1.4rem; }
.grade {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: .15rem;
  padding: .65rem .4rem;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text);
  font: inherit; font-size: .85rem; cursor: pointer;
}
.grade .interval { font-size: .72rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.grade .g-key {
  position: absolute; top: 3px; right: 5px;
  font-size: .62rem; color: var(--muted); font-family: var(--mono);
}
.grade.again:hover { border-color: var(--red); }
.grade.hard:hover  { border-color: var(--orange); }
.grade.good:hover  { border-color: var(--green); }
.grade.easy:hover  { border-color: var(--blue); }

.done { text-align: center; }
.done h2 { margin-bottom: .5rem; }
.done .primary { margin-top: 1.1rem; }

/* --------------------------------------------------------- dashboard */

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: .8rem;
  margin-bottom: 1.1rem;
}
.stat {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1rem;
  display: flex; flex-direction: column; gap: .2rem;
}
.stat-value { font-size: 1.7rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat-label { font-size: .76rem; color: var(--muted); }

.chart-box { position: relative; height: 13rem; }
.chart-box.wide { height: 11rem; }

/* ------------------------------------------------------------- tables */

table.data { width: 100%; border-collapse: collapse; font-size: .84rem; }
table.data th {
  text-align: left; font-weight: 500; color: var(--muted);
  font-size: .74rem; text-transform: uppercase; letter-spacing: .06em;
  padding: 0 .5rem .5rem; border-bottom: 1px solid var(--line);
}
table.data td { padding: .45rem .5rem; border-bottom: 1px solid rgba(59,66,97,.4); }
table.data tr:last-child td { border-bottom: 0; }

.bar-cell { width: 40%; }
.bar { display: block; height: 5px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--green); }

.table-scroll { overflow-x: auto; }
table.browse kbd {
  font-family: var(--mono); font-size: .78rem;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 4px; padding: .1rem .35rem; white-space: nowrap;
}
.cell-intent { min-width: 14rem; }
.cell-command { min-width: 10rem; }
.browse-head { margin-bottom: 1rem; }

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.dot-mastered   { background: var(--green); }
.dot-learning   { background: var(--blue); }
.dot-struggling { background: var(--red); }
.dot-new        { background: var(--surface-2); border: 1px solid var(--line); }

.leeches { list-style: none; margin: 0; padding: 0; }
.leeches li {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: .4rem 0; border-bottom: 1px solid rgba(59,66,97,.4);
}
.leeches li:last-child { border-bottom: 0; }

@media (max-width: 34rem) {
  .grades { grid-template-columns: repeat(2, 1fr); }
  .intent { font-size: 1.3rem; }
}
