/* ==========================================================================
   Interaktívny report — moderný čistý dizajn s light/dark témou
   ========================================================================== */

:root {
  --bg: #ffffff;
  --bg-soft: #f7f8fa;
  --bg-card: #ffffff;
  --text: #1f2933;
  --text-muted: #5e6b7a;
  --primary: #1a3a5c;
  --primary-light: #2e5e8a;
  --accent: #1a9850;
  --accent-warn: #d73027;
  --accent-export: #f0b132;
  --border: #e3e6eb;
  --border-strong: #c8cdd4;
  --highlight: #fff8d6;
  --table-stripe: #f5f7fa;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.08);
  --radius: 6px;
  --max-width: 1200px;
}

@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --bg: #0f141a;
    --bg-soft: #1a1f27;
    --bg-card: #1a1f27;
    --text: #e4e8ec;
    --text-muted: #98a2b3;
    --primary: #6fa8dc;
    --primary-light: #93c2ee;
    --border: #2a3038;
    --border-strong: #3a414b;
    --highlight: #4a3f1a;
    --table-stripe: #161b22;
    --shadow: 0 1px 3px rgba(0,0,0,0.4);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.5);
  }
}

:root[data-theme="dark"] {
  --bg: #0f141a;
  --bg-soft: #1a1f27;
  --bg-card: #1a1f27;
  --text: #e4e8ec;
  --text-muted: #98a2b3;
  --primary: #6fa8dc;
  --primary-light: #93c2ee;
  --border: #2a3038;
  --border-strong: #3a414b;
  --highlight: #4a3f1a;
  --table-stripe: #161b22;
  --shadow: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.5);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 70px; }

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== Top bar ============================================================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}
.topbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  gap: 16px;
}
.brand { display: flex; flex-direction: column; gap: 2px; }
.brand strong { color: var(--primary); font-size: 15px; }
.brand .meta { font-size: 12px; color: var(--text-muted); }
.actions { display: flex; align-items: center; gap: 8px; }

#theme-toggle, .btn-pdf {
  background: var(--bg-soft);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 7px 12px;
  border-radius: var(--radius);
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
}
#theme-toggle:hover, .btn-pdf:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* ===== Layout ============================================================= */
.layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 36px;
  padding: 24px;
  align-items: start;
}

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; padding: 16px; }
  .toc { display: none; }
}

/* ===== TOC ================================================================ */
.toc {
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}
.toc-inner {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.toc-title {
  margin: 0 0 8px 0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  font-weight: 600;
}
#toc-nav ul { list-style: none; padding-left: 0; margin: 0; }
#toc-nav ul ul { padding-left: 12px; margin-top: 2px; }
#toc-nav li { margin: 3px 0; }
#toc-nav a {
  display: block;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 13px;
  padding: 3px 6px;
  border-radius: 3px;
  border-left: 2px solid transparent;
}
#toc-nav a:hover {
  color: var(--primary);
  background: var(--bg-soft);
}
#toc-nav a.active {
  color: var(--primary);
  border-left-color: var(--primary);
  font-weight: 500;
}

/* ===== Content ============================================================ */
.content { min-width: 0; max-width: 100%; }
.content h1 {
  font-size: 32px;
  color: var(--primary);
  margin: 0 0 8px 0;
  line-height: 1.2;
}
.content h2 {
  font-size: 24px;
  color: var(--primary);
  margin: 36px 0 12px 0;
  padding-top: 12px;
  border-top: 2px solid var(--border);
}
.content h2:first-of-type { border-top: none; padding-top: 0; }
.content h3 {
  font-size: 19px;
  color: var(--primary-light);
  margin: 24px 0 8px 0;
}
.content h4 { font-size: 16px; margin: 18px 0 6px 0; }

.content p { margin: 8px 0 12px 0; }
.content strong { color: var(--text); font-weight: 600; }
.content em { color: var(--text-muted); }

.content ul, .content ol { padding-left: 24px; margin: 8px 0 14px 0; }
.content li { margin: 4px 0; }

.content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 36px 0;
}

.content code {
  font-family: "JetBrains Mono", Consolas, monospace;
  background: var(--bg-soft);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.9em;
  color: var(--primary-light);
}

.content pre {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  overflow-x: auto;
  font-size: 13px;
}

.content pre code { background: transparent; padding: 0; }

.content blockquote {
  border-left: 4px solid var(--primary);
  background: var(--bg-soft);
  padding: 8px 14px;
  margin: 12px 0;
  color: var(--text);
}

.content a { color: var(--primary-light); }
.content a:hover { text-decoration: none; }

/* ===== Tables ============================================================= */
.content table {
  border-collapse: collapse;
  width: 100%;
  margin: 14px 0;
  background: var(--bg-card);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 14px;
}

.content th, .content td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.content th {
  background: var(--bg-soft);
  color: var(--primary);
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border-bottom: 2px solid var(--border-strong);
}

.content tr:nth-child(even) td { background: var(--table-stripe); }
.content tr:hover td { background: var(--highlight); transition: background 0.15s; }

.content tr:last-child td {
  border-bottom: none;
  font-weight: 600;
  background: var(--bg-soft) !important;
}

.content td[align="right"], .content th[align="right"] { text-align: right; }
.content td[align="center"], .content th[align="center"] { text-align: center; }

/* ===== Images ============================================================= */
.content img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 16px auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ===== Plotly chart containers =========================================== */
.chart {
  width: 100%;
  min-height: 460px;
  margin: 20px 0;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 8px;
}

/* ===== Footer ============================================================= */
.footer {
  margin-top: 60px;
  padding: 24px 0;
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
}
.footer p {
  margin: 4px 0;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
}

/* ===== Print -- otvorene v prehliadaci a Ctrl+P ========================== */
@media print {
  .topbar, .toc, .footer, #theme-toggle, .btn-pdf { display: none !important; }
  .layout { grid-template-columns: 1fr; padding: 0; }
  body { font-size: 11pt; }
  .content h2 { page-break-after: avoid; }
  .content table, .content img, .chart { page-break-inside: avoid; }
}

/* ===== Drobne ============================================================ */
.cover { display: none; } /* cover pouzivame len v PDF */
