/* ============================================================
   Theme Overrides — Embedded AI Systems Lecture
   Base: Reveal.js "black" theme
   Custom: dark slate #1a1f2e, accent #4fd1c5
   ============================================================ */

:root {
  --r-background-color: #1a1f2e;
  --r-main-color: #c9d1d9;
  --r-heading-color: #e2e8f0;
  --r-link-color: #4fd1c5;
  --r-link-color-hover: #38b2ac;
  --r-selection-background-color: #4fd1c533;
  --r-selection-color: #ffffff;
  --accent: #4fd1c5;
  --accent-dim: #4fd1c544;
  --accent-dark: #2c7a7b;
  --surface: #212738;
  --surface-light: #2a3042;
  --danger: #fc8181;
  --warning: #f6ad55;
  --success: #68d391;
  --text-dim: #8892a4;
}

/* ---- Global ---- */
.reveal {
  font-family: 'Inter', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  font-size: 30px;
  color: var(--r-main-color);
}

.reveal-viewport {
  background-color: #1a1f2e;
}

.reveal .slides {
  text-align: left;
}

.reveal .slides section {
  padding: 40px 60px;
}

/* ---- Headings ---- */
.reveal h1,
.reveal h2,
.reveal h3,
.reveal h4 {
  color: var(--r-heading-color);
  text-transform: none;
  letter-spacing: 0.02em;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.4em;
}

.reveal h1 { font-size: 2.2em; }
.reveal h2 { font-size: 1.6em; border-bottom: 2px solid var(--accent); padding-bottom: 0.15em; display: block; }
.reveal h3 { font-size: 1.2em; color: var(--accent); }
.reveal h4 { font-size: 1.0em; color: var(--text-dim); }

/* ---- Lists ---- */
.reveal ul, .reveal ol {
  display: block;
  margin-left: 0.6em;
  line-height: 1.6;
  text-align: left;
}

.reveal li {
  margin-bottom: 0.3em;
}

.reveal li::marker {
  color: var(--accent);
}

/* ---- Links ---- */
.reveal a {
  color: var(--r-link-color);
  text-decoration: none;
  transition: color 0.2s;
}
.reveal a:hover {
  color: var(--r-link-color-hover);
  text-decoration: underline;
}

/* ---- Code ---- */
.reveal code {
  font-family: 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
  background: var(--surface);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.85em;
  color: var(--accent);
}

.reveal pre {
  width: 95%;
  margin: 0.8em auto;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  border-radius: 8px;
  border-left: 3px solid var(--accent);
}

.reveal pre code {
  background: var(--surface);
  padding: 16px 20px;
  font-size: 0.62em;
  line-height: 1.5;
  max-height: 500px;
  overflow: auto;
  color: var(--r-main-color);
}

/* ---- Tables ---- */
.reveal table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.8em 0;
  font-size: 0.9em;
  background: var(--surface);
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

.reveal table th {
  background: var(--accent-dark);
  color: #ffffff;
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid var(--accent);
}

.reveal table td {
  padding: 8px 14px;
  border-bottom: 1px solid #ffffff10;
}

.reveal table tr:last-child td {
  border-bottom: none;
}

.reveal table tr:hover td {
  background: var(--accent-dim);
}

/* ---- Blockquotes / callouts ---- */
.reveal blockquote {
  background: var(--surface);
  border-left: 4px solid var(--accent);
  padding: 16px 20px;
  margin: 0.6em 0;
  border-radius: 0 8px 8px 0;
  font-style: italic;
  width: 95%;
}

/* ---- Title slide ---- */
.reveal .slides section.title-slide {
  text-align: center;
}
.reveal .slides section.title-slide h1 {
  font-size: 2.4em;
  background: linear-gradient(135deg, var(--accent), #63b3ed);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.2em;
}
.reveal .slides section.title-slide .subtitle {
  font-size: 1.1em;
  color: var(--text-dim);
  margin-top: 0;
}
.reveal .slides section.title-slide .meta {
  font-size: 0.7em;
  color: var(--text-dim);
  margin-top: 1.5em;
}

/* ---- Agenda slide ---- */
.reveal .slides section.agenda-slide h2 {
  border-bottom: none;
  display: block;
  text-align: center;
}
.reveal .agenda-list {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  max-width: 800px;
  margin: 1em auto;
  text-align: left;
}
.reveal .agenda-list li {
  background: var(--surface);
  border: 1px solid #ffffff10;
  border-radius: 10px;
  padding: 16px 20px;
  transition: transform 0.2s, border-color 0.2s;
}
.reveal .agenda-list li:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}
.reveal .agenda-list .section-num {
  font-size: 1.4em;
  font-weight: 700;
  color: var(--accent);
}
.reveal .agenda-list .section-title {
  font-size: 0.85em;
  color: var(--r-heading-color);
  display: block;
  margin-top: 4px;
}
.reveal .agenda-list .section-time {
  font-size: 0.7em;
  color: var(--text-dim);
}

/* ---- Section recap slide ---- */
.reveal .slides section.recap-slide h2 {
  text-align: center;
  border-bottom: none;
}
.reveal .recap-slide .recap-box {
  background: var(--surface);
  border: 1px solid var(--accent-dark);
  border-radius: 10px;
  padding: 20px 28px;
  margin-top: 0.6em;
}
.reveal .recap-slide .recap-box ul {
  margin: 0;
  display: block;
  text-align: left;
}

/* ---- Case study layout ---- */
.reveal .slides section.case-study {
  padding: 30px 50px;
}
.case-study .cs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 14px;
  margin-top: 0.4em;
}
.case-study .cs-card {
  background: var(--surface);
  border-radius: 10px;
  padding: 14px 18px;
  border-left: 4px solid var(--accent-dark);
}
.case-study .cs-card.root-cause {
  border-left-color: var(--danger);
}
.case-study .cs-card.lesson {
  border-left-color: var(--success);
}
.case-study .cs-card.wrong {
  border-left-color: var(--warning);
}
.case-study .cs-card h4 {
  margin: 0 0 6px 0;
  font-size: 0.8em;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.case-study .cs-card.context h4 { color: var(--accent); }
.case-study .cs-card.wrong h4 { color: var(--warning); }
.case-study .cs-card.root-cause h4 { color: var(--danger); }
.case-study .cs-card.lesson h4 { color: var(--success); }
.case-study .cs-card p,
.case-study .cs-card ul {
  font-size: 0.72em;
  margin: 0;
  line-height: 1.5;
}

/* ---- Diagram containers ---- */
.diagram-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0.6em 0;
}
.diagram-wrap svg {
  max-width: 100%;
  height: auto;
}

/* ---- Layered architecture diagram ---- */
.arch-layer {
  background: var(--surface);
  border: 1px solid var(--accent-dark);
  border-radius: 8px;
  padding: 10px 18px;
  text-align: center;
  font-size: 0.8em;
  position: relative;
  transition: border-color 0.2s;
}
.arch-layer:hover {
  border-color: var(--accent);
}
.arch-layer .layer-label {
  font-weight: 700;
  color: var(--accent);
}
.arch-layer .layer-detail {
  font-size: 0.85em;
  color: var(--text-dim);
  margin-top: 2px;
}
.arch-stack {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 600px;
  margin: 0.8em auto;
}
.arch-arrow {
  text-align: center;
  color: var(--accent);
  font-size: 1.2em;
  line-height: 1;
  padding: 2px 0;
}

/* ---- V-Model diagram ---- */
.vmodel-svg text {
  font-family: 'Inter', sans-serif;
}

/* ---- MLOps loop ---- */
.mlops-loop-svg text {
  font-family: 'Inter', sans-serif;
}

/* ---- Testing pyramid ---- */
.pyramid-wrap {
  display: flex;
  justify-content: center;
  margin: 0.8em 0;
}
.pyramid-level {
  text-align: center;
  color: #fff;
  font-weight: 600;
  font-size: 0.7em;
  padding: 8px;
  border-radius: 4px;
  margin-bottom: 2px;
}

/* ---- Progress / misc ---- */
.reveal .progress {
  color: var(--accent);
  height: 4px;
}
.reveal .slide-number {
  color: var(--text-dim);
  font-size: 14px;
  right: 12px;
  bottom: 8px;
}

/* ---- Fragment visibility and animation ---- */
/* Removed custom fragment overrides to restore native Reveal.js animation behavior. */

/* ---- Print / PDF ---- */
@media print {
  .reveal .progress,
  .reveal .slide-number,
  .reveal .controls,
  .reveal .menu {
    display: none !important;
  }
  .reveal .slides section {
    page-break-inside: avoid;
  }
  :root {
    --r-background-color: #1a1f2e !important;
  }
}

/* ---- Responsive adjustments ---- */
@media (max-width: 1400px) {
  .reveal { font-size: 28px; }
}

@media (max-width: 1200px) {
  .reveal { font-size: 26px; }
}

@media (max-width: 900px) {
  .reveal { font-size: 24px; }
  .reveal .agenda-list { grid-template-columns: 1fr; }
  .case-study .cs-grid { grid-template-columns: 1fr; }
  .reveal .slides section { padding: 20px 30px; }
  .reveal h1 { font-size: 1.8em; }
  .reveal h2 { font-size: 1.4em; }
  .reveal h3 { font-size: 1.1em; }
}

@media (max-width: 600px) {
  .reveal { font-size: 22px; }
  .reveal .slides section { padding: 16px 20px; }
  .reveal h1 { font-size: 1.6em; }
  .reveal h2 { font-size: 1.3em; }
  .reveal h3 { font-size: 1.05em; }
  .reveal pre code { font-size: 0.55em; }
  .reveal table { font-size: 0.8em; }
  .reveal .diagram-wrap svg { font-size: 0.9em; }
}

/* ---- Comparison table variants ---- */
.compare-table-good td:first-child { color: var(--success); font-weight: 600; }
.compare-table-good td:last-child { color: var(--danger); }

/* ---- Requirement tag pills ---- */
.req-tag {
  display: inline-block;
  font-size: 0.65em;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  margin-right: 6px;
  vertical-align: middle;
}
.req-tag.fr { background: #2b6cb0; color: #fff; }
.req-tag.nfr { background: #6b46c1; color: #fff; }
.req-tag.dr { background: #c05621; color: #fff; }
.req-tag.mr { background: #2f855a; color: #fff; }
.req-tag.sr { background: #c53030; color: #fff; }

/* ---- Implementation checklist ---- */
.reveal .checklist {
  display: block;
  text-align: left;
}
.reveal .checklist li {
  list-style: none;
  position: relative;
  padding-left: 1.6em;
}
.reveal .checklist li::before {
  content: "\2610";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 1.1em;
}

/* ---- End-of-lecture summary ---- */
.summary-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 0.4em;
}
.summary-item {
  background: var(--surface);
  border-radius: 10px;
  padding: 14px 20px;
  border-left: 4px solid var(--accent);
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.summary-num {
  font-size: 1.5em;
  font-weight: 800;
  color: var(--accent);
  min-width: 1.5em;
}
.summary-text h4 {
  margin: 0 0 4px 0;
  color: var(--r-heading-color);
  font-size: 0.9em;
}
.summary-text p {
  margin: 0;
  font-size: 0.75em;
  color: var(--text-dim);
}
