/* ============================================
   GITBOOK-STYLE WIKI DOKUMENTACE
   - Dark mode only
   - Fixní sidebar s navigací
   - Moderní typografie a čitelnost
   - Rozbalovací accordion menu
   - Responsivní design
   ============================================ */

/* === CSS PROMĚNNÉ === */
:root {
    /* Pozadí */
    --bg-page: #020202;
    --bg-sidebar: #050505;
    --bg-content: #020202;
    --bg-hover: rgba(124, 58, 237, 0.08);
    --bg-code: #0a0a0a;
    
    /* Text */
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    
    /* Accent */
    --accent-purple: #7c3aed;
    --accent-purple-dark: #6d28d9;
    --accent-purple-light: #a78bfa;
    
    /* Bordery */
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-emphasis: rgba(124, 58, 237, 0.4);
    
    /* Speciální */
    --shadow-subtle: 0 1px 3px rgba(0, 0, 0, 0.5);
    --shadow-medium: 0 4px 12px rgba(0, 0, 0, 0.8);
    
    /* Layout */
    --sidebar-width: 280px;
    --content-max-width: 900px;
    --header-height: 64px;
}

/* === RESET & BASE === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif;
    background: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 16px;
    overflow-x: hidden;
}

/* === TYPOGRAPHY === */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.25;
    margin-top: 24px;
    margin-bottom: 16px;
    color: var(--text-primary);
}

h1 {
    font-size: 2rem;
    padding-bottom: 0.3em;
    border-bottom: 1px solid var(--border-subtle);
}

h2 {
    font-size: 1.5rem;
    padding-bottom: 0.3em;
    border-bottom: 1px solid var(--border-subtle);
}

h3 {
    font-size: 1.25rem;
}

h4 {
    font-size: 1rem;
}

p {
    margin-bottom: 16px;
    color: var(--text-secondary);
}

a {
    color: var(--accent-purple-light);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--accent-purple);
    text-decoration: underline;
}

/* === KÓDOVÉ BLOKY === */
code {
    padding: 0.2em 0.4em;
    margin: 0;
    font-size: 85%;
    background: var(--bg-code);
    border-radius: 6px;
    font-family: 'Courier New', Courier, monospace;
}

pre {
    padding: 16px;
    overflow: auto;
    font-size: 85%;
    line-height: 1.45;
    background: var(--bg-code);
    border-radius: 6px;
    margin-bottom: 16px;
}

pre code {
    padding: 0;
    margin: 0;
    background: transparent;
}

/* === SEZNAMY === */
ul, ol {
    padding-left: 2em;
    margin-bottom: 16px;
}

li {
    margin-top: 0.25em;
}

/* === TABULKY === */
table {
    border-spacing: 0;
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 16px;
}

table th,
table td {
    padding: 6px 13px;
    border: 1px solid var(--border-subtle);
}

table th {
    font-weight: 600;
    background: var(--bg-sidebar);
}

/* === CITACE === */
blockquote {
    padding: 0 1em;
    color: var(--text-secondary);
    border-left: 4px solid var(--accent-purple);
    margin-bottom: 16px;
}

/* === HLAVNÍ LAYOUT === */
.wiki-layout {
    display: flex;
    min-height: 100vh;
}

/* === SIDEBAR === */
.wiki-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, rgba(10, 10, 15, 0.98) 0%, rgba(5, 5, 8, 0.95) 100%);
    backdrop-filter: blur(20px) saturate(180%);
    border-right: 1px solid rgba(124, 58, 237, 0.15);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    z-index: 100;
}

/* Logo / Brand */
.sidebar-brand {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.sidebar-brand-icon {
    font-size: 28px;
    line-height: 1;
}

.sidebar-brand-text {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

/* Vyhledávání */
.sidebar-search {
    padding: 16px 16px 12px;
    border-bottom: 1px solid rgba(124, 58, 237, 0.1);
    background: linear-gradient(180deg, rgba(124, 58, 237, 0.03) 0%, transparent 100%);
}

.search-input-wrapper {
    position: relative;
}

.search-input {
    width: 100%;
    padding: 10px 14px 10px 40px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(124, 58, 237, 0.2);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.search-input:focus {
    outline: none;
    background: rgba(124, 58, 237, 0.08);
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2), inset 0 2px 4px rgba(0, 0, 0, 0.3);
    transform: translateY(-1px);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 16px;
    transition: all 0.3s;
}

.search-input:focus + .search-icon {
    color: var(--accent-purple-light);
}

/* Navigace */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 16px 0;
    position: relative;
}

.sidebar-nav::before {
    content: '';
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    height: 20px;
    background: linear-gradient(180deg, rgba(10, 10, 15, 0.95) 0%, transparent 100%);
    pointer-events: none;
    z-index: 10;
}

.sidebar-nav::-webkit-scrollbar {
    width: 8px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    margin: 8px 0;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--accent-purple) 0%, var(--accent-purple-dark) 100%);
    border-radius: 4px;
    border: 2px solid rgba(0, 0, 0, 0.2);
    box-shadow: 0 0 6px rgba(124, 58, 237, 0.4);
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: var(--accent-purple);
    box-shadow: 0 0 10px rgba(124, 58, 237, 0.6);
}

.nav-section {
    margin-bottom: 24px;
}

.nav-section-title {
    padding: 12px 20px 8px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent-purple);
    text-shadow: 0 0 10px rgba(124, 58, 237, 0.3);
}

.nav-group {
    margin-bottom: 4px;
}

/* Accordion item */
.nav-group-header {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    margin: 4px 12px;
    cursor: pointer;
    user-select: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 10px;
    border-left: 3px solid transparent;
    position: relative;
}

.nav-group-header::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0) 0%, rgba(124, 58, 237, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s;
}

.nav-group-header:hover {
    background: rgba(124, 58, 237, 0.1);
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.15);
}

.nav-group-header:hover::before {
    opacity: 1;
}

.nav-group-header.active {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.15) 0%, rgba(124, 58, 237, 0.08) 100%);
    border-left-color: var(--accent-purple);
    box-shadow: 0 4px 16px rgba(124, 58, 237, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.nav-group-toggle {
    width: 16px;
    height: 16px;
    margin-right: 10px;
    color: var(--accent-purple-light);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    filter: drop-shadow(0 0 4px rgba(124, 58, 237, 0.4));
}

.nav-group-header.expanded .nav-group-toggle {
    transform: rotate(90deg);
    color: var(--accent-purple);
}

.nav-group-header:hover .nav-group-toggle {
    color: var(--accent-purple);
}

.nav-group-icon {
    font-size: 20px;
    margin-right: 12px;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.nav-group-title {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.2px;
}

/* Accordion obsah */
.nav-group-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.nav-group-header.expanded + .nav-group-content {
    max-height: none;
    overflow-y: visible;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 8px 16px 8px 52px;
    margin: 2px 12px;
    font-size: 13px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    border-left: 2px solid transparent;
    position: relative;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    background: var(--accent-purple);
    border-radius: 0 2px 2px 0;
    transition: all 0.3s ease;
}

.nav-item:hover {
    background: rgba(124, 58, 237, 0.08);
    color: var(--text-primary);
    transform: translateX(4px);
    padding-left: 56px;
}

.nav-item:hover::before {
    width: 3px;
    height: 60%;
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(124, 58, 237, 0.15) 0%, rgba(124, 58, 237, 0.05) 100%);
    color: var(--accent-purple-light);
    border-left-color: var(--accent-purple);
    font-weight: 600;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.nav-item.active::before {
    width: 3px;
    height: 100%;
}

/* === HLAVNÍ OBSAH === */
.wiki-main {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    min-height: 100vh;
}

/* Horní lišta */
.wiki-header {
    height: var(--header-height);
    background: var(--bg-sidebar);
    border-bottom: 1px solid var(--border-subtle);
    padding: 0 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 90;
}

.header-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-muted);
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.breadcrumb-separator {
    color: var(--text-muted);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-btn {
    padding: 6px 12px;
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.header-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-emphasis);
}

.header-btn-primary {
    background: var(--accent-purple);
    border-color: var(--accent-purple);
    color: white;
}

.header-btn-primary:hover {
    background: var(--accent-purple-dark);
    border-color: var(--accent-purple-dark);
}

/* Obsah stránky */
.wiki-content {
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 48px 40px 80px;
}

/* Hero sekce */
.content-hero {
    margin-bottom: 48px;
}

.hero-tag {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(124, 58, 237, 0.15);
    border: 1px solid var(--accent-purple);
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-purple-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 16px;
    margin-top: 0;
    border-bottom: none;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 0;
}

/* Kategorie grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 48px;
}

.category-card {
    background: var(--bg-sidebar);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 24px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-purple);
    transform: scaleX(0);
    transition: transform 0.3s;
}

.category-card:hover {
    border-color: var(--accent-purple);
    box-shadow: var(--shadow-medium);
    transform: translateY(-4px);
}

.category-card:hover::before {
    transform: scaleX(1);
}

.category-icon {
    font-size: 40px;
    margin-bottom: 16px;
    display: block;
}

.category-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.category-description {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.5;
}

.category-topics {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-topics li {
    padding: 6px 0;
    font-size: 14px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-subtle);
    transition: all 0.2s;
}

.category-topics li:last-child {
    border-bottom: none;
}

.category-topics li:hover {
    color: var(--accent-purple-light);
    padding-left: 8px;
}

/* FAQ Sekce */
.faq-section {
    margin-top: 64px;
}

.faq-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 40px;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.faq-item {
    background: var(--bg-sidebar);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.faq-item:hover {
    border-color: var(--border-emphasis);
}

.faq-question {
    padding: 16px 20px;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.faq-toggle {
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    transition: transform 0.2s;
    flex-shrink: 0;
}

.faq-item.expanded .faq-toggle {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-item.expanded .faq-answer {
    max-height: 1000px;
}

.faq-answer-content {
    padding: 0 20px 16px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Quick Links */
.quick-links-section {
    background: var(--bg-sidebar);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 32px;
    margin-bottom: 48px;
}

.quick-links-title {
    font-size: 1.25rem;
    margin-bottom: 20px;
    margin-top: 0;
    border-bottom: none;
}

.quick-links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.quick-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-page);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s;
}

.quick-link:hover {
    background: var(--bg-hover);
    border-color: var(--accent-purple);
    transform: translateX(4px);
}

.quick-link-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.quick-link-text {
    flex: 1;
}

.quick-link-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.quick-link-desc {
    font-size: 12px;
    color: var(--text-muted);
}

/* === MOBILNÍ HAMBURGER MENU === */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 200;
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.15) 0%, rgba(10, 10, 15, 0.95) 100%);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(124, 58, 237, 0.3);
    border-radius: 10px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    font-size: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5), 0 0 20px rgba(124, 58, 237, 0.2);
}

.mobile-menu-toggle:hover {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.25) 0%, rgba(10, 10, 15, 0.95) 100%);
    border-color: var(--accent-purple);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.6), 0 0 30px rgba(124, 58, 237, 0.4);
}

.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 99;
    transition: all 0.3s ease;
}

.mobile-overlay.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* === RESPONSIVITA === */
@media (max-width: 1024px) {
    .wiki-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .wiki-sidebar.mobile-open {
        transform: translateX(0);
    }
    
    .wiki-main {
        margin-left: 0;
        width: 100%;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .wiki-header {
        padding: 0 20px 0 70px;
    }
    
    .wiki-content {
        padding: 32px 20px 60px;
    }
}

@media (max-width: 768px) {
    :root {
        --sidebar-width: 280px;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .categories-grid {
        grid-template-columns: 1fr;
    }
    
    .quick-links-grid {
        grid-template-columns: 1fr;
    }
    
    h1 {
        font-size: 1.75rem;
    }
    
    h2 {
        font-size: 1.25rem;
    }
}

/* === UTILITY CLASSES === */
.hidden {
    display: none !important;
}

.text-muted {
    color: var(--text-muted);
}

.text-accent {
    color: var(--accent-purple-light);
}

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

/* === DETAIL TÉMATU === */
.topic-detail {
    max-width: 100%;
}

.breadcrumb-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    font-size: 14px;
}

.breadcrumb-link {
    color: var(--accent-purple-light);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb-link:hover {
    color: var(--accent-purple);
}

.breadcrumb-separator {
    color: var(--text-muted);
    margin: 0 8px;
}

.breadcrumb-icon {
    font-size: 18px;
}

.breadcrumb-text {
    color: var(--text-secondary);
}

.topic-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-top: 24px;
    margin-bottom: 24px;
    color: var(--text-primary);
    border-bottom: none;
}

.topic-content {
    margin-top: 32px;
    line-height: 1.8;
}

.topic-content h1:first-child,
.topic-content h2:first-child,
.topic-content h3:first-child {
    margin-top: 0;
}

.empty-content {
    text-align: center;
    padding: 60px 20px;
    background: var(--bg-sidebar);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
}

.empty-content p:first-child {
    font-size: 18px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.topic-footer {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--border-subtle);
}

/* Klikací kategorie témata */
.category-topics li a {
    color: inherit;
    text-decoration: none;
    display: block;
    transition: all 0.2s;
}

.category-topics li a:hover {
    color: var(--accent-purple-light);
}

.category-topics li::before {
    content: '→';
    margin-right: 10px;
    color: var(--accent-purple);
    opacity: 0.5;
    transition: opacity 0.2s;
}

.category-topics li:hover::before {
    opacity: 1;
}

/* Vylepšený obsah tématu */
.topic-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 16px 0;
}

.topic-content code {
    font-size: 14px;
}

.topic-content pre {
    background: var(--bg-code);
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 16px 0;
}

.topic-content ul,
.topic-content ol {
    margin: 16px 0;
    padding-left: 28px;
}

.topic-content li {
    margin: 8px 0;
}

.topic-content table {
    width: 100%;
    margin: 16px 0;
}

.topic-content blockquote {
    border-left: 3px solid var(--accent-purple);
    padding-left: 16px;
    margin: 16px 0;
    font-style: italic;
}

/* Animace pro otevření tématu */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.topic-detail {
    animation: fadeInUp 0.4s ease;
}
