/* Custom CSS pro knihu Matematika pro programátory */

/* Základní typografie */
body {
  font-family: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.7;
}

/* Nadpisy */
h1, h2, h3, h4 {
  font-weight: 600;
  color: #2c3e50;
}

h1 {
  border-bottom: 3px solid #3498db;
  padding-bottom: 0.5rem;
}

/* Callout boxy - Definice */
.callout-note {
  border-left-color: #3498db !important;
  background-color: #ebf5fb !important;
}

.callout-note .callout-title {
  color: #2980b9 !important;
}

/* Callout boxy - Příklad */
.callout-tip {
  border-left-color: #27ae60 !important;
  background-color: #e8f8f5 !important;
}

.callout-tip .callout-title {
  color: #1e8449 !important;
}

/* Callout boxy - Pozor */
.callout-warning {
  border-left-color: #f39c12 !important;
  background-color: #fef9e7 !important;
}

.callout-warning .callout-title {
  color: #d68910 !important;
}

/* Callout boxy - Důležité */
.callout-important {
  border-left-color: #e74c3c !important;
  background-color: #fdedec !important;
}

.callout-important .callout-title {
  color: #c0392b !important;
}

/* Kód */
pre {
  background-color: #f8f9fa !important;
  border: 1px solid #e9ecef;
  border-radius: 6px;
  padding: 1rem;
}

code {
  font-family: 'Fira Code', 'Source Code Pro', Consolas, monospace;
  font-size: 0.9em;
}

/* Inline kód */
p code, li code {
  background-color: #f1f3f5;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  color: #c7254e;
}

/* Matematické vzorce - větší */
.math {
  font-size: 1.1em;
}

/* Obrázky a grafy */
figure {
  margin: 2rem 0;
  text-align: center;
}

figure img {
  max-width: 100%;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

figcaption {
  font-style: italic;
  color: #6c757d;
  margin-top: 0.5rem;
}

/* Tabulky */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
}

th {
  background-color: #3498db;
  color: white;
  padding: 0.75rem;
  text-align: left;
}

td {
  padding: 0.75rem;
  border-bottom: 1px solid #dee2e6;
}

tr:nth-child(even) {
  background-color: #f8f9fa;
}

/* Shrnutí na konci kapitoly */
.summary-box {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 1.5rem;
  border-radius: 8px;
  margin: 2rem 0;
}

.summary-box h3 {
  color: white;
  margin-top: 0;
}

.summary-box ul {
  margin-bottom: 0;
}

/* Cvičení */
.exercise {
  background-color: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 6px;
  padding: 1rem;
  margin: 1rem 0;
}

.exercise-title {
  font-weight: bold;
  color: #856404;
}

/* Řešení (skryté) */
details.solution {
  background-color: #d4edda;
  border: 1px solid #28a745;
  border-radius: 6px;
  padding: 1rem;
  margin: 0.5rem 0;
}

details.solution summary {
  cursor: pointer;
  font-weight: bold;
  color: #155724;
}

/* Responzivní design */
@media (max-width: 768px) {
  body {
    font-size: 16px;
  }

  pre {
    font-size: 0.85em;
    overflow-x: auto;
  }
}

/* Dark mode úpravy */
[data-bs-theme="dark"] {
  --bs-body-bg: #1e1e1e;
  --bs-body-color: #e4e4e4;
}

[data-bs-theme="dark"] h1,
[data-bs-theme="dark"] h2,
[data-bs-theme="dark"] h3 {
  color: #e4e4e4;
}

[data-bs-theme="dark"] pre {
  background-color: #2d2d2d !important;
  border-color: #404040;
}

[data-bs-theme="dark"] p code,
[data-bs-theme="dark"] li code {
  background-color: #2d2d2d;
  color: #ff9999;
}

/* Dark mode pro Python output */
[data-bs-theme="dark"] .python-output {
  background-color: #2d2d2d !important;
  border: 1px solid #404040 !important;
  border-left: 3px solid #4a9eff !important;
  color: #e4e4e4 !important;
}

[data-bs-theme="dark"] .python-output-error {
  background-color: #3a2020 !important;
  border: 1px solid #5a3030 !important;
  border-left-color: #ff6b6b !important;
  color: #ffb3b3 !important;
}
