/* L15-specific styles on top of shared/custom.css, L10/custom.css, L12/custom.css, L13/custom.css. */

/* RL agent-environment loop (slide 3). */
.reveal .rl-loop { display: block; margin: 0.3em auto; max-height: 260px; }
.reveal .rl-loop .agent-box rect,
.reveal .rl-loop .env-box rect {
  fill: #fff;
  stroke: #1f2937;
  stroke-width: 2;
  rx: 6;
}
.reveal .rl-loop .agent-box rect { fill: #dbeafe; stroke: #1d4ed8; }
.reveal .rl-loop .env-box rect   { fill: #dcfce7; stroke: #166534; }
.reveal .rl-loop .role-label {
  font-size: 14px;
  font-weight: 700;
  text-anchor: middle;
  dominant-baseline: middle;
}
.reveal .rl-loop .role-label.agent { fill: #1d4ed8; }
.reveal .rl-loop .role-label.env   { fill: #166534; }
.reveal .rl-loop .edge-label {
  font-size: 12px;
  font-weight: 600;
  fill: #6b7280;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.reveal .rl-loop .edge {
  stroke: #6b7280;
  stroke-width: 2;
  fill: none;
}

/* 3-up cards for exploration strategies (slide 8). */
.reveal .exploration-cards {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.6em;
  margin: 0.4em 0;
}
.reveal .exploration-cards .ecard {
  padding: 0.7em 0.8em;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-top: 4px solid #1d4ed8;
  border-radius: 6px;
  text-align: left;
  font-size: 0.82em;
}
.reveal .exploration-cards .ecard h3 {
  font-size: 0.95em;
  color: #1d4ed8;
  margin: 0 0 0.3em 0;
}
.reveal .exploration-cards .ecard p { font-size: 0.92em; margin: 0.2em 0; }
.reveal .exploration-cards .ecard-svg {
  display: block;
  margin: 0.3em auto 0.2em;
  width: 100%;
  max-width: 180px;
  height: auto;
  max-height: 64px;
}
.reveal .exploration-cards .ecard code {
  font-size: 0.92em;
  background: #fff;
  border: 1px solid #e5e7eb;
  padding: 0 0.3em;
  border-radius: 2px;
}

/* TD-error gap number line (slide 11). */
.reveal .td-gap {
  display: block;
  margin: 0.3em auto 0.2em;
  width: 100%;
  max-width: 640px;
  height: auto;
  max-height: 88px;
}

/* Q-table for RL worked examples (slides 13, 15). */
.reveal table.q-table {
  width: auto;
  margin: 0.3em auto;
  border-collapse: collapse;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.7em;
}
.reveal table.q-table th,
.reveal table.q-table td {
  padding: 0.2em 0.45em;
  border: 1px solid #d1d5db;
  text-align: center;
}
.reveal table.q-table thead th {
  background: #eff6ff;
  color: #1e3a8a;
  font-weight: 700;
}
.reveal table.q-table tbody th {
  background: #f9fafb;
  text-align: right;
  color: #4b5563;
}
.reveal table.q-table .cell-update {
  background: #fef3c7;
  color: #92400e;
  font-weight: 700;
}
.reveal table.q-table .cell-max {
  background: #dcfce7;
  color: #166534;
  font-weight: 700;
}

/* 2-up side-by-side cards for SARSA vs Q-learning compare. */
.reveal .compare-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6em;
  margin: 0.4em 0;
}
.reveal .compare-row .ccard {
  padding: 0.7em 0.9em;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-top: 4px solid #1d4ed8;
  border-radius: 6px;
  text-align: left;
  font-size: 0.82em;
}
.reveal .compare-row .ccard.sarsa { border-top-color: #d97706; }
.reveal .compare-row .ccard.qlearn { border-top-color: #16a34a; }
.reveal .compare-row .ccard h3 {
  font-size: 0.95em;
  margin: 0 0 0.3em 0;
}
.reveal .compare-row .ccard.sarsa h3 { color: #92400e; }
.reveal .compare-row .ccard.qlearn h3 { color: #166534; }
.reveal .compare-row .ccard .result {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.95em;
  font-weight: 700;
  text-align: center;
  margin-top: 0.4em;
}

/* Update-derivation: monospace math step list. */
.reveal .update-derivation {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.78em;
  line-height: 1.5;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-left: 4px solid #1d4ed8;
  border-radius: 4px;
  padding: 0.5em 0.8em;
  margin: 0.3em auto;
  max-width: 90%;
}
.reveal .update-derivation .step { display: block; }
.reveal .update-derivation .final {
  color: #166534;
  font-weight: 700;
  margin-top: 0.3em;
  background: #ecfdf5;
  padding: 0.2em 0.4em;
  border-radius: 3px;
}
