/* Prezentacije – Testiranje softvera
   Zajednički stil za sva poglavlja. Slajd je platno 1280 × 720 koje se skalira na veličinu prozora. */

:root {
  --bg: #e9edf2;
  --slide: #ffffff;
  --ink: #1d2733;
  --muted: #5b6878;
  --accent: #1f5f99;
  --accent-soft: #e6f0fa;
  --orange: #e07b00;
  --orange-soft: #fff4e5;
  --green: #2e7d4f;
  --green-soft: #e9f6ee;
  --violet: #6b4fa0;
  --violet-soft: #f1ecfa;
  --line: #d5dce5;
  --code-bg: #f4f6f9;
  --nav-bg: #1d2733;
  --nav-ink: #f2f5f8;
}

:root[data-theme="dark"] {
  --bg: #0f141a;
  --slide: #1a222c;
  --ink: #e6ebf1;
  --muted: #9aa7b6;
  --accent: #6fb1ef;
  --accent-soft: #1d3247;
  --orange: #ffa64d;
  --orange-soft: #3a2a17;
  --green: #6fcf97;
  --green-soft: #183326;
  --violet: #b9a2ea;
  --violet-soft: #2a2340;
  --line: #334150;
  --code-bg: #121920;
  --nav-bg: #0a0e13;
  --nav-ink: #e6ebf1;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  overflow: hidden;
}

/* ---------- pozornica i platno ---------- */

.stage {
  position: fixed;
  inset: 0 0 52px 0;
  overflow: hidden;
}

.deck {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1280px;
  height: 720px;
  transform: translate(-50%, -50%) scale(var(--scale, 1));
  transform-origin: center center;
}

.slide {
  position: absolute;
  inset: 0;
  background: var(--slide);
  border-radius: 6px;
  box-shadow: 0 6px 30px rgba(0, 0, 0, .18);
  padding: 30px 60px 34px;
  display: flex;
  flex-direction: column;
  font-size: 25px;
  line-height: 1.38;
  visibility: hidden;
  opacity: 0;
  transition: opacity .18s ease;
  overflow: hidden;
}

.slide.active { visibility: visible; opacity: 1; }

.slide-head {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  font-size: 15px;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 2px solid var(--accent-soft);
  padding-bottom: 8px;
  margin-bottom: 14px;
  flex: none;
}

.slide-head .sec { color: var(--accent); font-weight: 600; }

.slide-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.slide-body > * { margin: 0; }

.fit {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.fit > * { margin: 0; }

h1, h2, h3 { line-height: 1.2; margin: 0; }

.slide h2 {
  font-size: 38px;
  color: var(--accent);
  font-weight: 700;
}

.slide h3 {
  font-size: 27px;
  color: var(--ink);
  font-weight: 650;
}

p { margin: 0; }
ul, ol { margin: 0; padding-left: 1.3em; }
li { margin: .18em 0; }
li::marker { color: var(--accent); }
strong { color: var(--ink); font-weight: 700; }
em { color: var(--muted); }

a { color: var(--accent); }

.small { font-size: 21px; }
.xsmall { font-size: 18px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.big { font-size: 31px; }

/* ---------- raspored ---------- */

.cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 34px;
  align-items: center;
  min-height: 0;
}

.cols.top { align-items: start; }
.cols.l3 { grid-template-columns: 3fr 2fr; }
.cols.l2 { grid-template-columns: 2fr 3fr; }
.cols.l4 { grid-template-columns: 4fr 3fr; }
.cols > * { min-width: 0; }
.cols > div:not(.box):not(.formula):not(.key) { display: flex; flex-direction: column; gap: 12px; }

.grow { flex: 1; min-height: 0; }

/* ---------- slike ---------- */

figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 0;
}

figure img {
  max-width: 100%;
  max-height: 470px;
  object-fit: contain;
  border-radius: 4px;
  background: #fff;
}

:root[data-theme="dark"] figure img { filter: brightness(.94); }

figure.grow img {
  flex: 1 1 0;
  height: 0;
  width: 100%;
  max-height: none;
  background: none;
}

/* Široka, niska slika: slika i potpis ostaju zajedno, usred slajda. */
figure.band {
  flex: 1;
  justify-content: center;
}

figure.band img {
  width: 100%;
  height: auto;
  max-height: 520px;
}

figure.h560 img { max-height: 560px; }
figure.h520 img { max-height: 520px; }
figure.h400 img { max-height: 400px; }
figure.h340 img { max-height: 340px; }
figure.h280 img { max-height: 280px; }
figure.h220 img { max-height: 220px; }
figure.h160 img { max-height: 160px; }

figcaption {
  font-size: 15px;
  color: var(--muted);
  margin-top: 6px;
  text-align: center;
}

/* ---------- formule ---------- */

.formula {
  font-size: 30px;
  text-align: center;
  padding: 4px 0;
}

.formula.sm { font-size: 24px; }

mjx-container[display="true"] { margin: .35em 0 !important; }

/* ---------- tabele ---------- */

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 19px;
  line-height: 1.3;
}

th, td {
  border-bottom: 1px solid var(--line);
  padding: 6px 10px;
  text-align: left;
  vertical-align: top;
  overflow-wrap: break-word;
}

th {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 650;
}

table.sm { font-size: 17px; }
table.sm th, table.sm td { padding: 4px 8px; }
table.sem { font-size: 16px; }
table.sem th, table.sem td { padding: 3px 8px; }
table.md { font-size: 21px; }
table.lg { font-size: 23px; }
table.c td, table.c th { text-align: center; }

/* ---------- kod ---------- */

pre {
  margin: 0;
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: 6px;
  padding: 12px 16px;
  font-size: 18px;
  line-height: 1.38;
  overflow: auto;
}

pre.sm { font-size: 15.5px; }
pre.xs { font-size: 13.5px; }

code {
  font-family: "Cascadia Code", Consolas, "SF Mono", Menlo, "DejaVu Sans Mono", monospace;
}

:not(pre) > code {
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 .25em;
  font-size: .9em;
}

/* boje sintakse za highlight.js (bez posebnog CSS-a sa CDN-a) */
.hljs-comment, .hljs-quote { color: #6a7f6a; font-style: italic; }
.hljs-keyword, .hljs-selector-tag { color: #a626a4; }
.hljs-string, .hljs-regexp { color: #2f7d32; }
.hljs-number, .hljs-literal { color: #b45309; }
.hljs-built_in, .hljs-title, .hljs-title.function_ { color: #1d5fa8; }
.hljs-type, .hljs-params { color: #8a4b08; }
:root[data-theme="dark"] .hljs-comment { color: #8fa58f; }
:root[data-theme="dark"] .hljs-keyword { color: #d79be0; }
:root[data-theme="dark"] .hljs-string { color: #8fd694; }
:root[data-theme="dark"] .hljs-number { color: #f0b46b; }
:root[data-theme="dark"] .hljs-built_in, :root[data-theme="dark"] .hljs-title { color: #8cc4ff; }

/* ---------- istaknuti okviri ---------- */

.box {
  border-radius: 8px;
  padding: 12px 18px;
  border-left: 7px solid var(--accent);
  background: var(--accent-soft);
}

.box > .label {
  display: block;
  font-weight: 700;
  font-size: .82em;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 4px;
  color: var(--accent);
}

.na-casu { border-left-color: var(--orange); background: var(--orange-soft); }
.na-casu > .label { color: var(--orange); }

.vjezba { border-left-color: var(--violet); background: var(--violet-soft); }
.vjezba > .label { color: var(--violet); }

.rjesenje { border-left-color: var(--green); background: var(--green-soft); }
.rjesenje > .label { color: var(--green); }

.predavac { border-left-color: var(--muted); background: var(--code-bg); }
.predavac > .label { color: var(--muted); }

.key {
  font-size: 29px;
  font-weight: 600;
  text-align: center;
  padding: 14px 20px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--ink);
}

/* sakriveno rješenje: klik otkriva */
.spoiler {
  filter: blur(7px);
  cursor: pointer;
  transition: filter .2s;
  user-select: none;
}
.spoiler.shown { filter: none; user-select: auto; }
.hint { font-size: 15px; color: var(--muted); }

/* ---------- teze sekcije (okvir „Ukratko” iz udžbenika) ---------- */

ul.teze {
  list-style: none;
  padding: 0;
  margin: auto 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
  font-size: 34px;
  line-height: 1.3;
}
ul.teze li {
  position: relative;
  padding-left: 40px;
}
ul.teze li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: .42em;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
}
ul.teze strong { color: var(--accent); }

ol.provjeri {
  font-size: 27px;
  line-height: 1.35;
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin: auto 0;
}
ol.provjeri .odgovor {
  display: block;
  margin-top: 6px;
  padding: 4px 12px;
  border-radius: 6px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 24px;
}

/* ---------- posebni slajdovi ---------- */

.slide.title-slide {
  justify-content: center;
  padding: 60px 90px;
  background:
    linear-gradient(135deg, var(--accent-soft) 0%, var(--slide) 55%);
}

.title-slide .kicker {
  font-size: 22px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--orange);
  font-weight: 700;
}

.title-slide h1 {
  font-size: 54px;
  color: var(--accent);
  margin: 14px 0 22px;
}

.title-slide .sub { font-size: 25px; color: var(--muted); }
.title-slide .sub p { margin: 6px 0; }
.title-slide .by {
  margin-top: 28px;
  font-size: 22px;
  color: var(--ink);
}
.title-slide .contact {
  margin-top: 4px;
  font-size: 18px;
  color: var(--muted);
}

.slide.divider {
  justify-content: center;
  align-items: flex-start;
  padding: 60px 90px;
  background: var(--accent);
  color: #fff;
}

.divider .kicker {
  font-size: 22px;
  letter-spacing: .12em;
  text-transform: uppercase;
  opacity: .8;
}

.divider h2 { color: #fff; font-size: 52px; margin: 10px 0 18px; }
.divider p { font-size: 25px; opacity: .92; max-width: 960px; }
:root[data-theme="dark"] .slide.divider { background: #1d3a57; }

.end-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.end-links a {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}

.end-links a.secondary { background: var(--accent-soft); color: var(--accent); }

/* ---------- navigacija ---------- */

.nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 52px;
  background: var(--nav-bg);
  color: var(--nav-ink);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  font-size: 15px;
  z-index: 10;
}

.nav button, .nav a.btn {
  font: inherit;
  color: var(--nav-ink);
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 6px;
  padding: 7px 14px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.nav button:hover, .nav a.btn:hover { background: rgba(255, 255, 255, .18); }
.nav button:disabled { opacity: .35; cursor: default; }
.nav .primary { background: #2f7fd0; border-color: #2f7fd0; font-weight: 600; }
.nav .primary:hover { background: #3a8fe3; }

.nav .counter { min-width: 76px; text-align: center; font-variant-numeric: tabular-nums; }
.nav .title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: .75; padding: 0 8px; }
.nav .spacer { flex: 1; }

.progress {
  position: fixed;
  left: 0;
  bottom: 52px;
  height: 4px;
  background: var(--orange);
  width: 0;
  transition: width .2s;
  z-index: 11;
}

/* ---------- sadržaj (lista slajdova) ---------- */

.toc {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 52px;
  width: min(460px, 92vw);
  background: var(--slide);
  color: var(--ink);
  box-shadow: 4px 0 24px rgba(0, 0, 0, .25);
  transform: translateX(-105%);
  transition: transform .2s ease;
  overflow-y: auto;
  z-index: 12;
  padding: 14px 0 20px;
  font-size: 15px;
}

.toc.open { transform: none; }
.toc h3 { font-size: 17px; padding: 6px 18px 10px; color: var(--accent); }
.toc ol { list-style: none; padding: 0; margin: 0; }
.toc li { margin: 0; }
.toc li.cas { padding: 12px 18px 4px; font-weight: 700; color: var(--orange); text-transform: uppercase; font-size: 13px; letter-spacing: .05em; }
.toc a { display: flex; gap: 10px; padding: 5px 18px; color: inherit; text-decoration: none; }
.toc a:hover { background: var(--accent-soft); }
.toc a.current { background: var(--accent-soft); color: var(--accent); font-weight: 650; }
.toc a .n { color: var(--muted); min-width: 26px; text-align: right; font-variant-numeric: tabular-nums; }

.help {
  position: fixed;
  right: 14px;
  bottom: 64px;
  background: var(--slide);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 14px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .2);
  display: none;
  z-index: 12;
}

.help.open { display: block; }
.help table { font-size: 14px; }
.help td { padding: 3px 8px; border: none; }
.help kbd {
  font-family: inherit;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 0 6px;
  background: var(--code-bg);
}

@media (max-width: 720px) {
  .nav .title, .nav .hide-sm { display: none; }
  .nav button, .nav a.btn { padding: 7px 10px; }
}

/* ---------- početna stranica (index.html) ---------- */

body.home { overflow: auto; }

.home-wrap {
  max-width: 980px;
  margin: 0 auto;
  padding: 40px 16px 60px;
}

.home-wrap h1 { color: var(--accent); font-size: 36px; }
.home-wrap > p { color: var(--muted); font-size: 18px; line-height: 1.5; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
  margin-top: 26px;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--slide);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px 20px;
  text-decoration: none;
  color: inherit;
  transition: transform .15s, box-shadow .15s;
}

.card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0, 0, 0, .12); }
.card .k { color: var(--orange); font-weight: 700; font-size: 14px; letter-spacing: .08em; text-transform: uppercase; }
.card .t { color: var(--accent); font-weight: 700; font-size: 20px; line-height: 1.25; }
.card .d { color: var(--muted); font-size: 15px; line-height: 1.45; }

.keys-note { margin-top: 30px; font-size: 15px; color: var(--muted); line-height: 1.6; }

/* ---------- štampa: svaki slajd na svoju stranicu ---------- */

@media print {
  @page { size: 1280px 720px; margin: 0; }
  html, body { overflow: visible; height: auto; background: #fff; }
  .nav, .progress, .toc, .help { display: none !important; }
  .stage { position: static; overflow: visible; }
  .deck { position: static; transform: none; width: 1280px; height: auto; }
  .slide {
    position: relative;
    visibility: visible;
    opacity: 1;
    width: 1280px;
    height: 720px;
    box-shadow: none;
    border-radius: 0;
    page-break-after: always;
    break-after: page;
  }
  .spoiler { filter: none; }
}

ol.literatura {
  font-size: 25px;
  line-height: 1.4;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: auto 0;
}
ol.literatura em { color: var(--accent); font-style: normal; font-weight: 600; }
