/* ZÁKLADNÉ PREMENNÉ Z PYDATA DARK THEME */
:root {
    --pst-color-primary: #3fb1bb;
    --pst-color-bg-header: #1e2229;
    --pst-color-bg-body: #14181e;
    --pst-color-bg-sidebar: #14181e;
    --pst-color-border: #3b4554;
    --pst-color-border-soft: #2c333d;
    --pst-color-text-main: #ced6dd;
    --pst-color-text-strong: #f3f4f5;
    --pst-color-text-muted: #9ca4af;
    --pst-color-text-sidebar: #ced6dd;
    --pst-color-search-bg: #29313d;

    --pst-header-height: 64px;
    --pst-toc-width: 300px;
    --pst-left-offset: 5rem;      /* ľavý padding sidebaru */
    --pst-link-padding: 0.75rem;  /* vnútorný padding položky v sidebare */

    --pst-font-family-base: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--pst-font-family-base);
    color: var(--pst-color-text-main);
    background-color: var(--pst-color-bg-body);
    line-height: 1.6;
}

/* ===================== HORNÁ LIŠTA ===================== */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* ľavý okraj zarovnaný s textom v sidebare */
    padding: 0 1.5rem 0 calc(var(--pst-left-offset) + var(--pst-link-padding) - 8px);
    height: var(--pst-header-height);
    background-color: var(--pst-color-bg-header);
    border-bottom: 1px solid var(--pst-color-border);
    font-size: 1rem;
}

.header-left,
.header-right {
    display: flex;
    align-items: center;
    height: 100%;
}

.header-left { gap: 2rem; }
.header-right { gap: 1.2rem; }

/* LOGO */
.logo {
    display: flex;
    align-items: center;
    height: 100%;
}

.logo img {
    height: 48px;
    width: auto;
    display: block;
}

/* NAVIGÁCIA V HLAVIČKE */
.header-nav {
    display: flex;
    gap: 1.5rem;
    height: 100%;
}

.header-nav a {
    color: var(--pst-color-text-muted);
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    border-bottom: 3px solid transparent;
    padding-top: 3px;
    transition: color 0.2s;
}

.header-nav a:hover { color: var(--pst-color-text-main); }

.header-nav a.active {
    color: var(--pst-color-primary);
    border-bottom: 3px solid var(--pst-color-primary);
}

/* VYHĽADÁVANIE */
.search-container {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: transparent;
    border: 1px solid var(--pst-color-border);
    border-radius: 20px;
    padding: 6px 12px 6px 14px;
    color: var(--pst-color-text-muted);
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}

.search-container:hover {
    border-color: #5c6b80;
    background-color: var(--pst-color-search-bg);
}

.search-container svg { width: 16px; height: 16px; fill: currentColor; }

.search-text { font-size: 0.95rem; margin-right: 15px; }

.search-shortcut {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: var(--pst-color-text-muted);
}

.search-shortcut kbd {
    background-color: transparent;
    border: 1px solid var(--pst-color-border);
    border-radius: 4px;
    padding: 2px 5px;
    font-family: inherit;
}

/* VÝBER VERZIE */
.version-dropdown {
    background: transparent;
    color: var(--pst-color-text-main);
    border: 1px solid var(--pst-color-border);
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}

.version-dropdown:hover { border-color: #5c6b80; }

/* IKONY */
.icon-group {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--pst-color-text-muted);
}

.icon-group a,
.icon-group button {
    color: inherit;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
    padding: 0;
}

.icon-group a:hover,
.icon-group button:hover { color: var(--pst-color-text-main); }

.icon-group svg { width: 20px; height: 20px; fill: currentColor; }

/* ===================== ROZLOŽENIE ===================== */
.layout {
    display: flex;
    align-items: flex-start;
}

/* ===================== ĽAVÝ SIDEBAR ===================== */
.sidebar {
    position: sticky;
    top: var(--pst-header-height);
    flex: 0 0 400px;
    height: calc(100vh - var(--pst-header-height));
    overflow-y: auto;
    padding: 2rem 1rem 2rem var(--pst-left-offset);
    background-color: var(--pst-color-bg-sidebar);
}

/* Chrome / Edge / Safari */
.sidebar::-webkit-scrollbar {
    width: 11px;
}

/* Dráha pod posuvníkom */
.sidebar::-webkit-scrollbar-track {
    background: #2c2c2c;
}

/* Posuvník (základný stav) */
.sidebar::-webkit-scrollbar-thumb {
    background: #9f9f9f;
    border-radius: 6px;
    border: 2px solid #2c2c2c;
}

/* Posuvník po prejdení myšou */
.sidebar::-webkit-scrollbar-thumb:hover {
    background: #d1d1d1;
}

/* Firefox – len farby, hover nepodporuje */
@supports (-moz-appearance: none) {
    .sidebar {
        scrollbar-width: thin;
        scrollbar-color: #9f9f9f #2c2c2c;
    }
}

.sidebar-nav {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-nav a {
    display: block;
    padding: 0.3rem var(--pst-link-padding);
    color: #9ca4af;
    text-decoration: none;
    font-size: 0.95rem;
    line-height: 1.5;
    border-left: 3px solid transparent;
    transition: color 0.15s, background-color 0.15s;
}

.sidebar-nav a:hover {
    color: #a970ff; /* rovnaká fialová ako odkazy v obsahu */
    text-decoration: underline 3px;
    text-decoration-skip-ink: none; 
}

.sidebar-nav a.active {
    color: var(--pst-color-primary);
    font-weight: 600;
    border-left-color: var(--pst-color-primary);
}

/* ===================== HLAVNÝ OBSAH ===================== */
.content {
    flex: 1;
    min-width: 0;
    max-width: calc(980px + 4rem);
    padding: 1.5rem 2rem 4rem 4rem;
    font-size: 1.05rem;
    line-height: 1.65;
}

/* Drobčeková navigácia nad nadpisom */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0 0 1.5rem -0.2rem;
    padding: 0;
    list-style: none;
    font-size: 0.9rem;
    color: var(--pst-color-text-muted);
}

.breadcrumbs li { display: flex; align-items: center; gap: 0.6rem; }

.breadcrumbs li + li::before {
    content: "";
    width: 0.45rem;
    height: 0.45rem;
    margin-right: 0.15rem;
    border-top: 2px solid currentColor;
    border-right: 2px solid currentColor;
    transform: rotate(45deg);
}

.content .breadcrumbs a {
    display: flex;
    color: var(--pst-color-text-main);
    text-decoration: none;
    font-weight: 600;
}

.content .breadcrumbs a:hover { color: var(--pst-color-primary); }
.breadcrumbs svg { width: 1.1rem; height: 1.1rem; fill: currentColor; }
.breadcrumbs .current { color: var(--pst-color-text-strong); font-weight: 700; }

.content h1,
.content h2,
.content h3,
.content h4 {
    color: var(--pst-color-text-strong);
    font-weight: 500;
    line-height: 1.2;
    scroll-margin-top: calc(var(--pst-header-height) + 1rem);
}

.content h1 { margin: 0 0 1.5rem; font-size: 2.6rem; }
.content h2 { margin: 3rem 0 1.2rem; font-size: 2.1rem; }
.content h3 { margin: 2.2rem 0 1rem; font-size: 1.6rem; }
.content h4 { margin: 1.8rem 0 0.8rem; font-size: 1.25rem; }

.content p,
.content li,
.content dd { color: var(--pst-color-text-main); }

.content dt { font-weight: 700; color: var(--pst-color-text-strong); }

/* Odkazy v obsahu sekcií */
.content a {
    color: #3FB1BB;
    text-decoration: underline;
    transition: color 0.15s;
}

.content a:hover { color: #a970ff; }

/* Inline kód v texte, napr. <code>Series</code> */
.content :not(pre) > code {
    padding: 0.1em 0.3em;
    border: 1px solid #424a56;
    border-radius: 4px;
    background-color: var(--pst-color-search-bg);
    color: #e3a8f0;
    font-size: 0.875em;
}

/* Kód vnútri odkazu preberá farbu odkazu */
.content a > code { color: inherit; font-weight: 600; }
/* ===================== PRÍKLADY KÓDU ===================== */
/* Jedno okno pre celý príklad (vstupy aj výstupy), ako v IPython konzole */
#content-body { counter-reset: vstup; }

.code-block {
    margin: 1.25rem 0;
    padding: 1rem 1.25rem;
    overflow-x: auto;
    background-color: #29303b;
    border: 1px solid #424a56;
    border-radius: 4px;
}

.code-block pre {
    position: relative;
    margin: 0;
    padding: 0;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #e6edf3;
    background: none;
    border: none;
}

/* Prázdny riadok medzi jednotlivými vstupmi/výstupmi */
.code-block > pre + pre,
.code-block > * + * { margin-top: 1.6em; }

/* Prompt "In [n]:" – generuje CSS, takže sa nekopíruje spolu s kódom.
   Flex drží viacriadkový kód zarovnaný za promptom. */
.code-block .code-in {
    display: flex;
    padding-right: 2.5rem; /* miesto pre tlačidlo */
    counter-increment: vstup;
}

.code-block .code-in::before {
    content: "In [" counter(vstup) "]: ";
    flex: none;
    white-space: pre;
    color: #c9d1d9;
}

/* Výstup – prompt "Out[n]:" na samostatnom riadku, text jemnejší */
.code-block .code-out { color: #c9d1d9; }

.code-block .code-out::before {
    content: "Out[" counter(vstup) "]:\A";
    white-space: pre;
    color: #c9d1d9;
}

/* Tlačidlo Kopírovať */
.copy-btn {
    position: absolute;
    top: -0.3rem;
    right: -0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 1px solid var(--pst-color-border);
    border-radius: 5px;
    background-color: var(--pst-color-bg-header);
    color: var(--pst-color-text-muted);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s, color 0.15s, border-color 0.15s;
}

.copy-btn svg { width: 1rem; height: 1rem; fill: currentColor; }

.code-in:hover .copy-btn,
.copy-btn:focus-visible { opacity: 1; }

.copy-btn:hover {
    color: var(--pst-color-primary);
    border-color: var(--pst-color-primary);
}

.copy-btn.copied {
    opacity: 1;
    color: #4ade80;
    border-color: #4ade80;
}

/* Na dotykových zariadeniach nie je hover – tlačidlo vždy viditeľné */
@media (hover: none) {
    .copy-btn { opacity: 1; }
}

/* ===================== POZNÁMKY (Note) ===================== */
.admonition {
    margin: 1.25rem 0;
    padding: 0.75rem 1rem;
    border-left: 4px solid var(--pst-color-primary);
    border-radius: 6px;
    background-color: rgba(62, 176, 200, 0.08);
}

.admonition-title {
    margin: 0 0 0.4rem;
    font-weight: 700;
    color: var(--pst-color-primary) !important;
}

.admonition p:last-child { margin-bottom: 0; }

/* ===================== PRAVÝ PANEL "ON THIS PAGE" ===================== */
.toc {
    position: sticky;
    top: var(--pst-header-height);
    flex: 0 0 var(--pst-toc-width);
    max-height: calc(100vh - var(--pst-header-height));
    overflow-y: auto;
    padding: 2.5rem 1rem 2rem 0;
}

.toc[hidden] { display: none; }

.toc-title {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0 0 0.4rem;
    padding-left: 1.25rem;
    font-size: 1rem;
    font-weight: 400;
    color: var(--pst-color-text-strong);
}

.toc-title svg { width: 1rem; height: 1rem; fill: currentColor; }

.toc-nav {
    margin: 0;
    padding: 0;
    list-style: none;
    border-left: 1px solid var(--pst-color-border-soft);
}

.toc-nav a {
    display: block;
    margin-left: -1px;
    padding: 0.3rem 0 0.3rem 1.25rem;
    border-left: 2px solid transparent;
    color: var(--pst-color-text-main);
    font-size: 0.95rem;
    line-height: 1.45;
    text-decoration: none;
    transition: color 0.15s;
}

.toc-nav a:hover { color: var(--pst-color-primary); }

.toc-nav a.active {
    color: var(--pst-color-primary);
    border-left-color: var(--pst-color-primary);
}

/* ===================== CVIČENIA (z Jupyter notebookov) ===================== */
/* Ukážka kódu v texte zadania – bez promptu "In [n]:" */
.code-block .code-snippet { color: #e6edf3; }

/* Výpis cez print() – v Jupyteri nemá prompt "Out[n]:" */
.code-block .code-out.stream::before { content: none; }

/* Graf vygenerovaný v notebooku */
.code-block .code-img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    background-color: #fff;
}

.content blockquote {
    margin: 1.25rem 0;
    padding: 0.5rem 1rem;
    border-left: 4px solid var(--pst-color-primary);
    background-color: var(--pst-color-search-bg);
    border-radius: 0 4px 4px 0;
}

.content blockquote > :first-child { margin-top: 0; }
.content blockquote > :last-child { margin-bottom: 0; }

.content hr {
    margin: 2rem 0;
    border: none;
    border-top: 1px solid var(--pst-color-border);
}

.content table {
    margin: 1.25rem 0;
    border-collapse: collapse;
    display: block;
    overflow-x: auto;
}

.content th,
.content td {
    padding: 0.4rem 0.8rem;
    border: 1px solid var(--pst-color-border);
    color: var(--pst-color-text-main);
}

.content th { color: var(--pst-color-text-strong); font-weight: 600; }

.content img { max-width: 100%; height: auto; }

/* Riešenie úlohy – zelený pruh vľavo a štítok "Riešenie" */
.code-block.riesenie {
    position: relative;
    border-left: 4px solid #3fb950;
    padding-top: 2rem;
}

.code-block.riesenie::before {
    content: "Riešenie";
    position: absolute;
    top: 0.4rem;
    left: 1.25rem;
    color: #3fb950;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.riesenie-text {
    margin: 1.25rem 0;
    padding: 0.25rem 1rem;
    border-left: 4px solid #3fb950;
}

/* Odkazy na súbory k cvičeniu */
.content .subory {
    padding: 0.75rem 1rem;
    border: 1px solid var(--pst-color-border);
    border-radius: 4px;
}

/* ===================== RESPONZIVITA ===================== */
@media (max-width: 1300px) {
    .toc { display: none; }
}

@media (max-width: 900px) {
    .header { padding-left: 1.5rem; }
    .sidebar { display: none; }
    .header-nav { display: none; }
    .content { padding: 1.5rem 1rem 3rem; }
}