/* Reset a základní styly */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #385e7a;
    --secondary-color: #64748b;
    --success-color: #059669;
    --warning-color: #d97706;
    --danger-color: #dc2626;
    --info-color: #0ea5e9;
    --background-color: #ffffff;
    --surface-color: #f8fafc;
    --sidebar-color: #0a2540;
    --border-color: #e2e8f0;
    --headline-color: #0a2540;
    --text-primary: #4c4c55;
    --text-secondary: #64748b;
    --button-color: #00d4ff;
    --button-hover-color: #385e7a;
    --sidebar-width: 280px;
    --toc-width: 320px;
    --header-height: 64px;
    --border-radius: 8px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--background-color);
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--background-color);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

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

/* Horizontální menu */
.horizontal-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
    margin-bottom: 0;
}

.horizontal-menu li {
    position: relative;
    margin: 0;
}

.horizontal-menu a {
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.horizontal-menu a:hover {
    background-color: var(--surface-color);
    color: var(--primary-color);
    text-decoration: none;
}

.horizontal-menu a.active {
    background-color: var(--button-color);
    color: white;
}

.horizontal-menu a.active:hover {
    background-color: var(--button-hover-color);
    color: white;
}

.horizontal-menu .menu-button {
    background: var(--button-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.horizontal-menu .menu-button:hover {
    color: white;
    background: var(--button-hover-color);
}

/* Dropdown menu */
.dropdown {
    position: relative;
}

.dropdown-title {
    cursor: pointer;
    padding: 0.5rem 1rem;
    color: var(--text-primary);
    font-weight: 500;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.dropdown-title:hover {
    background-color: var(--surface-color);
    color: var(--primary-color);
}

.dropdown-content {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
    z-index: 1001;
    list-style: none;
}

.dropdown:hover .dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-content li {
    border-bottom: 1px solid var(--border-color);
    list-style: none;
}

.dropdown-content li:last-child {
    border-bottom: none;
}

.dropdown-content a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    background: none;
    text-decoration: none;
    transition: var(--transition);
}

.dropdown-content a:hover {
    color: var(--primary-color);
    background: none;
    text-decoration: underline !important;
}

.dropdown-content a.active,
.dropdown-content a.active:hover {
    color: var(--primary-color);
    background: none;
}

/* Layout */
.main-container {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    min-height: 100vh;
    padding-top: var(--header-height);
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-color);
    border-right: 1px solid #111a28;
    padding: 1rem 0;
    height: 100%;
}

.sidebar-nav {
    position: sticky;
    top: calc(var(--header-height) + 1rem);
    padding: 0 1.5rem;
}

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

.sidebar-menu li {
    margin-bottom: 0.5rem;
}

.sidebar-menu a {
    display: block;
    padding: 0.75rem 1rem;
    color: white;
    text-decoration: none;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.sidebar-menu a:hover {
    background-color: var(--button-hover-color);
    color: white;
    text-decoration: none;
}

.sidebar-menu a.active {
    background-color: var(--button-color);
    color: white;
    font-weight: 600;
}

.sidebar-menu a.active:hover {
    background-color: var(--button-hover-color);
    color: white;
}

.sidebar-menu .menu-button {
    width: 100%;
    background: var(--button-color);
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    margin: 0.5rem 0;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.sidebar-menu .menu-button:hover {
    background: var(--button-hover-color);
}

/* Dropdown v sidebaru */
.sidebar-menu .dropdown-content {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    border-radius: 0;
    background: transparent;
    margin-left: 0;
    margin-top: 0.5rem;
}

.sidebar-menu .dropdown-content a.active {
    background-color: var(--primary-color);
    color: white;
}

/* Nový styl pro subpages v sidebaru */
.sidebar-subpages {
    margin-left: 1rem;
    margin-top: 0.5rem;
    border-left: 2px solid #606a7a;
    padding-left: 1rem;
}

.sidebar-subpages li {
    margin-bottom: 0.25rem;
    list-style: none;
}

.sidebar-subpages a {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.sidebar-subpages a:hover {
    background: none;
    text-decoration: underline !important;
}

.sidebar-subpages a.active {
    color: var(--button-color);
    font-weight: 700;
    background: none;
}

.sidebar-subpages a.active:hover {
    color: white;
    font-weight: 700;
    background: none;
    text-decoration: underline;
}

/* Content - flexbox layout pro sticky TOC */
.content {
    display: grid;
    grid-template-columns: 1fr var(--toc-width);
    padding: 2rem;
    gap: 2rem;
    align-items: flex-start;
}

.content-wrapper {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.content-wrapper a {
    text-decoration: underline;
}

/* Content TOC - normální flow pro sticky chování */
.content-toc {
    width: var(--toc-width);
    height: 100%;
}

/* Table of Contents - skutečně sticky vůči hlavnímu scroll */
.table-of-contents {
    position: sticky;
    top: calc(var(--header-height) + 1rem);
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.table-of-contents h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 1rem;
    color: var(--text-primary);
}

.table-of-contents ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.table-of-contents li {
    margin-bottom: 0.25rem;
}

.table-of-contents a {
    display: block;
    padding: 0.25rem 0.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
    line-height: 1.4;
}

.table-of-contents a:hover {
    color: var(--primary-color);
    background-color: var(--background-color);
    text-decoration: none;
}

/* Odsazení podle úrovní nadpisů */
.table-of-contents a.toc-level-1 { 
    padding-left: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.table-of-contents a.toc-level-2 { 
    padding-left: 1.5rem;
    font-weight: 500;
    font-size: 0.875rem;
}

.table-of-contents a.toc-level-3 { 
    padding-left: 2.5rem;
    font-weight: 400;
    font-size: 0.85rem;
    color: var(--text-primary);
}

/* Typography */
h1, h2, h3, h4, h5 {
    color: var(--headline-color);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    scroll-margin-top: calc(var(--header-height) + 2rem);
}

h1 {
    font-size: 2.5rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 1rem;
    margin-bottom: 2rem;
}

h2 {
    color: var(--button-color);
    font-size: 2rem;
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 0.5rem;
}

h3 {
    font-size: 1.5rem;
    margin-top: 2rem;
}

h4 {
    font-size: 1.25rem;
    margin-top: 1.5rem;
}

h5 {
    font-size: 1.1rem;
    margin-top: 1rem;
}

p {
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    line-height: 1.7;
}

/* Seznamy */
ul, ol {
    margin-bottom: 1.5rem;
    padding-left: 0;
    margin-left: 1.5rem;
}

ul li, ol li {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    line-height: 1.6;
}

ul {
    list-style-type: disc;
}

ol {
    list-style-type: decimal;
}

/* Vnořené seznamy */
ul ul, ol ol, ul ol, ol ul {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

/* Odkazy */
a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    text-decoration: underline;
}

/* Ale ne u menu odkazů */
.horizontal-menu a:hover,
.sidebar-menu a:hover,
.table-of-contents a:hover {
    text-decoration: none;
}

/* Obrázky */
.doc-image {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    margin: 1.5rem 0;
    display: block;
}

/* Tabulky */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    background: var(--background-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

thead {
    background: var(--surface-color);
}

thead th {
    background: #f8f9fa;
    color: var(--button-color);
    font-weight: 700;
    text-align: left;
    padding: 1rem;
    font-size: 1rem;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #e0e0e0;
}

tbody tr {
    transition: var(--transition);
    border-bottom: 1px solid var(--border-color);
}

tbody tr:last-child {
    border-bottom: none;
}

tbody tr:hover {
    background: var(--surface-color);
}

tbody tr:nth-child(even) {
    background: rgba(248, 250, 252, 0.5);
}

tbody tr:nth-child(even):hover {
    background: var(--surface-color);
}

td, th {
    padding: 0.875rem 1rem;
    text-align: left;
    vertical-align: top;
}

td {
    color: var(--text-primary);
    line-height: 1.5;
}

/* Speciální styly pro kód v tabulkách */
td code, th code {
    background: rgba(99, 179, 237, 0.1);
    color: var(--primary-color);
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-family: 'Fira Code', 'Monaco', 'Consolas', 'Courier New', monospace;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
}

/* Responzivní tabulky */
.table-responsive {
    overflow-x: auto;
    margin: 1.5rem 0;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.table-responsive table {
    margin: 0;
    border: none;
    box-shadow: none;
    border-radius: 0;
    min-width: 600px;
}

/* Pro mobilní zařízení */
@media (max-width: 768px) {
    table {
        font-size: 0.875rem;
    }
    
    td, th {
        padding: 0.5rem 0.75rem;
    }
    
    thead th {
        font-size: 0.8rem;
        padding: 0.75rem;
    }
}

/* Kód - upraveno pro Prism.js */
.code-block {
    margin: 1.5rem 0;
    border-radius: var(--border-radius);
    background: #2d3748;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    position: relative;
}

.code-block pre {
    margin: 0;
    padding: 1.5rem;
    font-family: 'Fira Code', 'Monaco', 'Consolas', 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    overflow-x: auto;
    background: #2d3748 !important; /* Override Prism theme */
}

.code-block code {
    font-family: 'Fira Code', 'Monaco', 'Consolas', 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
}

/* Přepsat Prism barvy pro sladění s designem */
.code-block pre[class*="language-"] {
    background: #2d3748 !important;
    color: #e2e8f0 !important;
}

.code-block code[class*="language-"] {
    background: transparent !important;
    color: #e2e8f0 !important;
}

/* Prism token colors */
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
    color: #7c8b9a !important;
}

.token.punctuation {
    color: #e2e8f0 !important;
}

.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
    color: #68d391 !important;
}

.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
    color: #63b3ed !important;
}

.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
    color: #fc8181 !important;
}

.token.atrule,
.token.attr-value,
.token.keyword {
    color: #f687b3 !important;
}

.token.function,
.token.class-name {
    color: #fbb6ce !important;
}

.token.regex,
.token.important,
.token.variable {
    color: #f6ad55 !important;
}

.inline-code {
    background: var(--surface-color);
    color: var(--primary-color);
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-family: 'Fira Code', 'Monaco', 'Consolas', 'Courier New', monospace;
    font-size: 0.875rem;
    border: 1px solid var(--border-color);
    font-weight: 500;
}

/* Info a warning boxy */
.info-box, .warning-box {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-radius: var(--border-radius);
    border-left: 4px solid;
}

.info-box {
    background: #eff6ff;
    border-left-color: var(--info-color);
    color: #1e40af;
}

.warning-box {
    background: #fffbeb;
    border-left-color: var(--warning-color);
    color: #92400e;
}

.box-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.box-content {
    flex: 1;
}

.box-content p {
    margin-bottom: 0;
    color: inherit;
}

/* Responsivní design */
@media (max-width: 1400px) {
    .content-toc {
        display: none;
    }
    
    .content {
        display: block;
        overflow: hidden;
    }
    
    .content-wrapper {
        width: 100%;
        max-width: none;
    }
}

@media (max-width: 1024px) {
    :root {
        --sidebar-width: 240px;
    }
    
    .content {
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    .header .container {
        padding: 0 1rem;
    }
    
    .horizontal-menu {
        display: none;
    }
    
    .sidebar {
        position: fixed;
        width: 100vw;
        max-width: 300px;
        z-index: 100;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-container {
        display: block;
    }

    .content {
        padding: 1rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    h3 {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .logo {
        span {
            display: none;
        }
    }
}

/* Animace */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.content-wrapper > * {
    animation: fadeIn 0.5s ease-out;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--surface-color);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
} 