/* zakladni nastaveni */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f9f9f9;
    color: #333;
    line-height: 1.6;
    
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* navigace */
nav {
    background-color: #fff;
    padding: 1rem 2rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    display: flex;
    justify-content: flex-end;
    gap: 20px;
}

nav a {
    text-decoration: none;
    color: #555;
    font-weight: 600;
    transition: color 0.3s;
}

nav a:hover {
    color: #000;
}

nav a.active {
    color: #000;
    border-bottom: 2px solid #222;
    padding-bottom: 3px;
}

/* hlavni kontejner */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 20px;
    text-align: center;
}

/* nadpisy a texty */
h1 {
    font-size: 2.5rem;
    margin-top: 0;
    margin-bottom: 20px;
    color: #222;
}

.content h1 {
    margin-bottom: 10px;
    border-bottom: 2px solid #eaeaea;
    padding-bottom: 10px;
}

h2 {
    font-size: 1.5rem;
    margin-top: 30px;
    margin-bottom: 15px;
    color: #222;
}

h3 {
    font-size: 1.25rem;
    margin-top: 25px;
    margin-bottom: 15px;
    color: #222;
}

h4 {
    font-size: 1.1rem;
    margin-top: 20px;
    margin-bottom: 10px;
    color: #222;
}

.description {
    font-size: 1.1rem;
    color: #666;
    max-width: 700px;
    margin: 0 auto 50px auto;
}

p {
    font-size: 1.1rem;
    color: #555;
    line-height: 1.8;
    margin-bottom: 20px;
}

/* seznamy */
ul, ol {
    margin-bottom: 20px; 
    padding-left: 60px;
}

li {
    font-size: 1.1rem;
    color: #555;
    line-height: 1.6;
    margin-bottom: 4px;
}

strong {
    color: #333;
}

/* mrizka pro tydny */
.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

/* karty */
.card {
    background-color: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 30px 20px;
    text-decoration: none;
    color: #333;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    border-color: #ddd;
}

.card.disabled {
    background-color: #e5e5e5;
    border-color: #d5d5d5;
    pointer-events: none;
    box-shadow: none;
}

.card.disabled .week-title,
.card.disabled .week-number {
    color: #999;
}

.week-number {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #888;
    margin-bottom: 10px;
}

.week-title {
    font-size: 1.2rem;
    font-weight: bold;
}

/* tlacitko projektu */
.final-project {
    display: block;
    background-color: #222;
    color: #fff;
    text-decoration: none;
    padding: 20px;
    border-radius: 8px;
    font-size: 1.3rem;
    font-weight: bold;
    margin-top: 20px;
    transition: background-color 0.3s;
}

.final-project:hover {
    background-color: #444;
}

/* rozlozeni sloupcu */
.main-wrapper {
    display: flex;
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    gap: 30px;
    align-items: flex-start;

    width: 100%;
    box-sizing: border-box;
}

/* postranni panel */
.sidebar {
    width: 200px;
    flex-shrink: 0;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    border: 1px solid #eee;
}

.sidebar a {
    display: block;
    padding: 12px 20px;
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s, color 0.2s;
}

.sidebar a:last-child {
    border-bottom: none;
}

.sidebar a:hover:not(.disabled) {
    background-color: #f0f0f0;
}

.sidebar a.active {
    font-weight: bold;
    background-color: #f9f9f9;
    border-left: 4px solid #222;
}

.sidebar a.disabled {
    color: #aaa;
    pointer-events: none;
    cursor: default;
}

/* obsah stranky */
.content {
    flex-grow: 1;
    background-color: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    border: 1px solid #eee;
    box-sizing: border-box;

    min-width: 0;
    overflow-x: hidden;
    width: 100%;
}

/* obrazek projektu */
.project-image {
    display: block;
    margin-left: auto;
    margin-right: auto;
    max-width: 100%;
    height: auto;
    margin-top: 15px;
    margin-bottom: 15px;
    border-radius: 8px; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.project-video-ikfinal {
    display: block;
    margin-left: auto;
    margin-right: auto;
    max-width: 100%;
    height: auto;
    margin-top: 15px;
    margin-bottom: 15px;
    border-radius: 8px; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.1); 
    

    aspect-ratio: 45 / 71;
    object-fit: cover;
    object-position: center;
}

.project-video-ik {
    display: block;
    margin-left: auto;
    margin-right: auto;
    max-width: 100%;
    height: auto;
    margin-top: 15px;
    margin-bottom: 15px;
    border-radius: 8px; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.1); 
    

    aspect-ratio: 1.14 / 1;
    object-fit: cover;
    object-position: center;
}



.project-image-noborder {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    padding: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
}

/* YouTube video */
.video-container {
    position: relative;
    width: 100%;
    margin: 30px auto;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    background-color: #000;
    
    aspect-ratio: 16 / 9;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* blok kodu */
.code-container {
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 20px;
    background-color: #f4f4f4;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
    
    max-width: 100%;
    width: 100%;
    overflow: auto;
    display: block;
}

/* lista kodu */
.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #eaeaea;
    padding: 8px 15px;
    border-bottom: 1px solid #ddd;
}

.code-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.lang-badge {
    background-color: #222;
    color: #fff;
    font-size: 0.8rem;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}

.language-label {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 0.9rem;
    color: #555;
    font-weight: 600;
}

/* tlacitka */
.toggle-btn, .copy-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #555;
    font-size: 0.9rem;
    font-family: inherit;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background-color 0.2s, color 0.2s;
    font-weight: 600;
}

.toggle-btn:hover, .copy-btn:hover {
    background-color: #d5d5d5;
    color: #000;
}

/* reset pre - PŘIZPŮSOBENO PRO PRISM.JS */
.code-container pre,
.code-container pre[class*="language-"] {
    margin: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 15px !important;
    max-height: 700px;
    
    /* --- ZMĚNA ZDE --- */
    overflow-x: auto !important;     /* Vynutí horizontální posuvník */
    overflow-y: auto !important;     /* Vynutí vertikální posuvník */
    -webkit-overflow-scrolling: touch !important;
    
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    display: block !important;
    
    /* DŮLEŽITÉ: Fixní šířka pro rodiče, aby se pre neroztahoval */
    word-break: normal !important;
    word-wrap: normal !important;
    white-space: pre !important;
}

.code-container code[class*="language-"] {
    display: block !important;
    width: fit-content !important;   /* Šířka podle délky kódu */
    min-width: 100%;                /* Aby pozadí bylo minimálně přes celou šířku */
    padding: 0 !important;           /* Padding dáváme na PRE, ne na CODE */
    white-space: pre !important;     /* Zachová mezery a nezlomí řádek */
}

/* animace sbaleni */
.code-content {
    transition: max-height 0.3s ease-in-out;
    max-height: 5000px;
    overflow: hidden;
    width: 100%;
}

.code-content.collapsed {
    max-height: 0;
}

code {
    font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
}

/* responzivita */
@media (max-width: 768px) {
    .grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .main-wrapper {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
    }
    .content {
        padding: 20px;
    }
}

@media (max-width: 500px) {
    .grid {
        grid-template-columns: 1fr;
    }
    h1 {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    body {
        min-width: 600px;
        overflow-x: auto;
    }
    
    .main-wrapper {
        min-width: 600px;
        width: 600px;
        margin-left: auto;
        margin-right: auto;
        padding: 0 10px;
        overflow-x: hidden
    }
    
    .container {
        min-width: 600px;
        width: 600px;
        padding: 30px 10px;
    }
    
    .content {
        min-width: 0;
        width: 100%;
    }
    
    nav {
        min-width: 600px;
        padding: 1rem 10px;
    }
    
    .grid {
        min-width: 580px;
    }
} /* ZDE KONČÍ @MEDIA BLOK - DALŠÍ KÓD UŽ PLATÍ PRO VŠECHNA ZAŘÍZENÍ */

/* Rozcestník (Table of Contents) - přesunuto mimo @media */
.toc {
    background-color: #f4f4f4;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px 30px;
    margin-bottom: 40px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

.toc h2 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.3rem;
    border-bottom: 1px solid #eaeaea;
    padding-bottom: 10px;
}

.toc li {
    margin-bottom: 8px;
}

/* 1. úroveň: nezanořená odrážka - plné kolečko */
.toc ul {
    list-style-type: disc; /* disc = plné kolečko */
    padding-left: 50px;    /* Musí tu být odsazení, jinak bude odrážka mimo div */
    margin-bottom: 0;
}

/* 2. úroveň: zanořená odrážka - prázdné kolečko */
.toc ul ul {
    list-style-type: circle; /* circle = prázdné kolečko */
    padding-left: 50px;
    margin-top: 8px;
    margin-bottom: 15px;
}

/* 3. úroveň: dvakrát zanořená odrážka - zase plné kolečko */
.toc ul ul ul {
    list-style-type: disc; /* disc = plné kolečko */
    margin-bottom: 0;      /* Volitelné: zrušení spodního odsazení pro nejhlubší úroveň */
}

/* 4. úroveň: dvakrát zanořená odrážka - zase plné kolečko */
.toc ul ul ul ul {
    list-style-type: circle; /* circle = prázdné kolečko */
    padding-left: 50px;
    margin-top: 8px;
    margin-bottom: 15px;
}

.toc a {
    text-decoration: none;
    color: #555;
    font-weight: 600;
    transition: color 0.2s;
}

.toc a:hover {
    color: #000;
    text-decoration: underline;
}

/* Jemná úprava pro plynulé scrollování po kliknutí na odkaz */
html {
    scroll-behavior: smooth;
}

/* --- SOUBORY KE STAŽENÍ --- */
.file-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f4f4f4;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 12px 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

.file-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.file-badge {
    background-color: #222;
    color: #fff;
    font-size: 0.8rem;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}

.file-badge.fusion {
    background-color: #f26522; /* Oranžová barva Fusionu */
}

.file-name {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: #333;
}

.file-size {
    font-size: 0.9rem;
    color: #888;
}

.download-btn {
    display: inline-block;
    background-color: #222;
    color: #fff;
    text-decoration: none;
    font-size: 0.9rem;
    font-family: inherit;
    font-weight: 600;
    padding: 6px 15px;
    border-radius: 4px;
    transition: background-color 0.2s, transform 0.1s;
}

.download-btn:hover {
    background-color: #444;
}

.download-btn:active {
    transform: scale(0.98);
}

/* Responzivita pro soubory */
@media (max-width: 500px) {
    .file-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .download-btn {
        width: 100%;
        text-align: center;
        box-sizing: border-box;
    }
}

/* Přilepení postranního panelu na počítači */
@media (min-width: 769px) {
    .sidebar {
        position: sticky;
        top: 40px;
    
        max-height: calc(100vh - 80px); 
        overflow-y: auto;
    }
}