:root {
    --accent-color: #e74c3c;
    --dark-blue: #243342;
    --mid-blue: #364d63;
    --text-color: #333;
}

/* Reset oraz globalny zakaz zaokraglen */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    border-radius: 0 !important;
}

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

/* === UKLAD Z GORNYM PASKIEM NAWIGACJI (LAB*_90_*.html) === */
body.lecture-layout {
    background-color: #f0f2f5;
    padding: 0;
    overflow-x: hidden;
}

body.lecture-layout * {
    border-radius: 0 !important;
}

.menu-bar {
    background-color: var(--dark-blue);
    padding: 10px 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.menu-bar a {
    color: #ecf0f1;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    font-size: 0.9em;
    line-height: 1.5;
    transition: background-color 0.25s;
}

.menu-bar a:hover,
.menu-bar a.active {
    background-color: var(--accent-color);
    font-weight: bold;
}

.menu-bar .ext-btn {
    background: var(--accent-color);
    color: #fff;
    border: none;
    padding: 6px 16px;
    cursor: pointer;
    font-size: 0.85em;
    line-height: 1.5;
    margin-left: auto;
    font-family: inherit;
    font-weight: 600;
    transition: background-color 0.25s;
}

.menu-bar .ext-btn:hover {
    background: #c0392b;
}

/* === SLAJDY ZADAN === */
.slide {
    max-width: 1100px;
    margin: 30px auto;
    background: #f9f9f9;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: visible;
    position: relative;
}

.header {
    background-color: var(--mid-blue);
    color: #ffffff;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.slide-number {
    background-color: var(--accent-color);
    padding: 4px 14px;
    font-weight: bold;
    font-size: 0.95em;
    white-space: nowrap;
}

.slide-title {
    font-size: 1.15em;
    font-weight: 600;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 4px;
}

.slide-content {
    display: flex;
    flex-wrap: wrap;
    padding: 24px;
    gap: 24px;
}

.text {
    flex: 3;
    min-width: 300px;
    max-width: 100%;
}

.illustration {
    flex: 2;
    min-width: 260px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

/* === TYPOGRAFIA I ELEMENTY TRESCI === */
h3,
.text h2 {
    color: #2c3e50;
    margin-top: 14px;
    margin-bottom: 10px;
    font-size: 1.12em;
}

p {
    margin-bottom: 10px;
    text-align: justify;
}

ul,
ol {
    margin: 10px 0 10px 22px;
}

li {
    margin-bottom: 6px;
}

li strong {
    color: #2c3e50;
}

.subtitle {
    color: #555;
    font-size: 1.05em;
}

/* === BLOKI TEMATYCZNE === */
.definition {
    background-color: #eef5fa;
    border-left: 5px solid #2c3e50;
    padding: 15px;
    margin: 12px 0;
    font-size: 0.98em;
}

.goal {
    background-color: #eaf7ee;
    border-left: 5px solid #27ae60;
    padding: 14px 16px;
    margin: 0 0 14px 0;
    font-size: 0.96em;
}

.example {
    background-color: #fff3cd;
    border-left: 5px solid #ffc107;
    padding: 15px;
    margin: 12px 0;
    font-size: 0.98em;
}

.important-box {
    background-color: #fff3cd;
    border-left: 5px solid #e67e22;
    padding: 14px 18px;
    margin: 12px 0;
    font-size: 0.96em;
    text-align: justify;
}

.important-box strong {
    color: #856404;
}

.srodowisko-box {
    background-color: #f5e4b8;
    border: 1px solid #d9be7e;
    border-left: 6px solid #c9a227;
    padding: 10px 24px;
    margin: 0;
    font-size: 0.92em;
    line-height: 1.55;
}

.wykonanie {
    background: #fffdf7;
    border: 1px solid #e8e0c8;
    padding: 12px 14px;
    margin: 8px 0 12px 0;
}

.wykonanie p {
    margin: 0 0 8px 0;
}

.wykonanie p:last-child {
    margin: 0;
}

.checklist-box {
    background: #fffdf7;
    border: 1px solid #e8e0c8;
    border-left: 5px solid #27ae60;
    padding: 12px 16px;
    margin: 14px 0;
    font-size: 0.95em;
}

.checklist-box ol {
    margin: 6px 0 10px 20px;
}

.questions {
    background-color: #eef5fa;
    border-left: 5px solid #2c3e50;
    padding: 14px 16px;
    margin: 12px 0;
}

.questions ol {
    margin: 6px 0 6px 20px;
}

.questions li {
    margin-bottom: 7px;
}

/* === ODSYLACZE I KOD === */
a.lab-link,
.srodowisko-box a,
.wykonanie a,
.important-box a {
    text-decoration: none;
    color: #0b5394;
}

a.lab-link:hover,
.srodowisko-box a:hover,
.wykonanie a:hover,
.important-box a:hover {
    text-decoration: underline;
}

a.lab-link-strong {
    text-decoration: none;
    color: #0b5394;
    font-weight: 600;
}

pre,
code {
    font-family: Consolas, 'Courier New', Courier, monospace;
    font-size: 0.92em;
}

pre {
    background-color: #1e1e1e;
    color: #d4d4d4;
    padding: 14px 18px;
    overflow-x: auto;
    margin: 12px 0;
    line-height: 1.55;
    border-left: 4px solid var(--accent-color);
}

code {
    background-color: #f0f0f0;
    padding: 2px 6px;
}

pre code {
    background: none;
    padding: 0;
}

code.lab-code {
    background: #f4f1e8;
    border: 1px solid #e0d9c3;
    padding: 1px 5px;
    font-family: Consolas, Menlo, monospace;
    font-size: 0.91em;
    white-space: nowrap;
}

.kroki code.lab-code {
    white-space: normal;
    overflow-wrap: anywhere;
}

/* === DIAGRAM TEKSTOWY === */
.diagram {
    background-color: #ffffff;
    border: 1px solid #d5dce2;
    padding: 14px;
    text-align: left;
    width: 100%;
    font-family: Consolas, 'Courier New', Courier, monospace;
    font-size: 0.84em;
    line-height: 1.45;
    color: #2c3e50;
    white-space: pre;
    overflow-x: auto;
}

/* === HERO I SPIS ZADAN === */
.referat-hero {
    text-align: center;
    font-size: 1.45em;
    font-weight: 800;
    color: var(--dark-blue);
    padding: 24px 12px;
    line-height: 1.35;
    border: 2px solid #d5dce2;
    background: #ffffff;
    width: 100%;
}

.referat-hero span {
    display: block;
    font-size: 0.68em;
    font-weight: 600;
    color: var(--accent-color);
    margin-top: 6px;
}

.spis-lista {
    margin: 10px 0 10px 0;
    list-style: none;
    padding-left: 0;
}

.spis-lista li {
    margin-bottom: 8px;
}

.spis-lista a,
.spis-lista a:hover {
    text-decoration: none;
    color: #2c3e50;
}

.spis-lista a:hover .spis-tytul {
    color: var(--accent-color);
}

.spis-num {
    display: inline-block;
    min-width: 3ch;
    margin-right: 8px;
    color: var(--accent-color);
    font-weight: 700;
}

/* === TABELE === */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 14px 0;
    font-size: 0.94em;
}

th {
    background-color: #2c3e50;
    color: #ffffff;
    padding: 10px 14px;
    text-align: left;
}

td {
    padding: 9px 14px;
    border-bottom: 1px solid #ddd;
}

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

tr:hover {
    background-color: #e8edf2;
}

/* === ROZSZERZENIE SLIDU === */
.slide_ext {
    background-color: #eef5fa;
    padding: 20px 24px;
    border-top: 2px solid #2c3e50;
}

.slide_ext p {
    margin-bottom: 8px;
    font-size: 0.95em;
}

.slide_ext h3 {
    color: #2c3e50;
    font-size: 1.05em;
    margin-top: 0;
}

.slide_ext.hidden {
    display: none;
}

/* === STOPKA === */
.footer {
    max-width: 1100px;
    margin: 0 auto 30px;
    text-align: center;
    padding: 16px;
    color: #666;
    font-size: 0.9em;
}

.footer a {
    color: #0b5394;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* === UKLAD STRONY GLOWNEJ (index.html) === */
.sidebar {
    width: 380px;
    background-color: #1a1a2e;
    color: #ffffff;
    padding: 20px;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    top: 0;
    left: 0;
}

.sidebar h1 {
    font-size: 20px;
    margin-bottom: 10px;
    text-align: center;
    border-bottom: 1px solid #0f3460;
    padding-bottom: 14px;
    color: #e94560;
}

.sidebar .subtitle {
    font-size: 12px;
    text-align: center;
    color: #aaa;
    margin-bottom: 20px;
}

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

.menu li {
    margin-bottom: 6px;
}

.menu a {
    display: block;
    padding: 10px 14px;
    color: #ecf0f1;
    text-decoration: none;
    background-color: #0f3460;
    transition: background-color 0.25s;
    font-size: 0.9em;
}

.menu a:hover,
.menu a.active {
    background-color: #e94560;
    font-weight: bold;
}

.section-title {
    margin-top: 18px;
    margin-bottom: 8px;
    color: #e94560;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid #0f3460;
    padding-bottom: 4px;
}

.lab-menu > summary {
    cursor: pointer;
    list-style: none;
    position: relative;
    padding-right: 24px;
}

.lab-menu > summary::-webkit-details-marker,
.lab-sub > summary::-webkit-details-marker {
    display: none;
}

.lab-menu > summary::after,
.lab-sub > summary::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 8px;
    margin-top: -5px;
    width: 0;
    height: 0;
    border-left: 6px solid currentColor;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    transition: transform 0.2s;
}

.lab-menu[open] > summary::after,
.lab-sub[open] > summary::after {
    transform: rotate(90deg);
}

.lab-sub {
    margin-bottom: 6px;
}

.lab-sub > summary {
    display: block;
    cursor: pointer;
    list-style: none;
    position: relative;
    padding: 10px 30px 10px 14px;
    color: #ecf0f1;
    background-color: #0f3460;
    font-size: 0.88em;
    transition: background-color 0.25s;
}

.lab-sub > summary:hover {
    background-color: #1f618d;
}

.lab-list {
    list-style: none;
    padding: 0 0 0 14px;
    margin: 4px 0 0 0;
}

.lab-list li {
    margin-bottom: 4px;
}

.lab-list a {
    display: block;
    padding: 7px 12px;
    font-size: 0.85em;
    background-color: #16213e;
    border-left: 3px solid #0f3460;
}

.lab-list a:hover {
    border-left-color: #e94560;
}

.sidebar .footer {
    margin-top: auto;
    text-align: center;
    padding-top: 16px;
    font-size: 0.84em;
    color: #95a5a6;
    border-top: 1px solid #0f3460;
    width: 100%;
    margin-bottom: 0;
}

.sidebar + .content {
    padding: 36px;
    margin-left: 380px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.welcome-box {
    background-color: #ffffff;
    padding: 32px 36px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    max-width: 900px;
    width: 100%;
}

.welcome-box h2 {
    color: #1a1a2e;
    margin-bottom: 8px;
}

.welcome-box h3 {
    color: #0f3460;
    margin-top: 0;
    margin-bottom: 16px;
    font-weight: 600;
    border-bottom: 2px solid #e94560;
    padding-bottom: 8px;
}

.welcome-box p {
    font-size: 15px;
    line-height: 1.75;
    color: #444;
    margin-bottom: 12px;
}

.welcome-box ul {
    margin: 10px 0 10px 20px;
}

.welcome-box li {
    margin-bottom: 8px;
}

.welcome-box a {
    color: #0b5394;
    text-decoration: none;
}

.welcome-box a:hover {
    text-decoration: underline;
}

@media (max-width: 960px) {
    .sidebar {
        position: static;
        width: 100%;
        height: auto;
    }

    .sidebar + .content {
        margin-left: 0;
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .slide-content {
        flex-direction: column;
    }

    .illustration {
        order: -1;
    }

    .menu-bar {
        font-size: 0.85em;
    }

    .slide-number {
        font-size: 0.85em;
        padding: 3px 10px;
    }
}
