* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    color: #333;
}

body:has(.menu-bar) {
    background-color: #f0f2f5;
    line-height: 1.7;
}

html {
    scroll-behavior: smooth;
}

.menu-bar {
    background-color: #243342;
    padding: 10px 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.menu-bar a {
    color: #ecf0f1;
    text-decoration: none;
    padding: 6px 14px;
    font-size: 0.9em;
    transition: background-color 0.3s;
}

.menu-bar a:hover {
    background-color: #e74c3c;
}

.menu-bar a.active {
    background-color: #e74c3c;
    font-weight: bold;
}

.slide {
    max-width: 1200px;
    margin: 30px auto;
    background: #f9f9f9;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.header {
    background-color: #364d63;
    color: white;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.slide-number {
    background-color: #e74c3c;
    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 #e74c3c;
    padding-bottom: 4px;
}

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

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

.text .intro {
    font-size: 1.05em;
    font-style: italic;
    color: #34495e;
    background: #f7f9fb;
    border-left: 4px solid #3498db;
    padding: 10px 14px;
    margin: 0 0 14px 0;
    line-height: 1.5;
    text-align: justify;
}

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

.illustration img {
    max-width: 100%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    max-width: 400px;
}

h3 {
    color: #2c3e50;
    margin-bottom: 12px;
    font-size: 1.15em;
}

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

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

li {
    margin-bottom: 6px;
}

pre.cli {
    background-color: #1e1e1e;
    color: #d4d4d4;
    padding: 16px;
    overflow-x: auto;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.92em;
    line-height: 1.6;
    margin: 12px 0;
    border-left: 5px solid #e74c3c;
}

.cmd {
    color: #569cd6;
}

.def {
    color: #dcdcaa;
}

.str {
    color: #ce9178;
}

.comment {
    color: #6a9955;
    font-style: italic;
}

.num {
    color: #b5cea8;
}

.attr {
    color: #9cdcfe;
}

.note {
    background-color: #fff3cd;
    border-left: 5px solid #ffc107;
    padding: 15px;
    margin: 12px 0;
}

.important-box {
    background-color: #fff3cd;
    border-left: 5px solid #ffc107;
    padding: 15px;
    margin: 12px 0;
}

code {
    color: #ee0000;
    font-weight: normal;
    background-color: #fce4e4;
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 0.9em;
}

pre code {
    background: transparent;
    padding: 0;
    border-radius: 0;
    font-size: inherit;
    color: inherit;
    font-weight: inherit;
}

strong, b {
    color: #2c3e50;
}

.slides {
    overflow: hidden;
}

.cli-section {
    margin: 0;
    background-color: #1e1e1e;
    padding: 10px;
    width: 100%;
    box-sizing: border-box;
    border-top: 2px solid #111;
}

.cli-section .cli-label {
    display: block;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.8em;
    color: #9cdcfe;
    margin-bottom: 8px;
    font-weight: bold;
}

.cli-section .cli-block {
    background-color: #0d0d0d;
    color: #d4d4d4;
    padding: 12px 14px;
    overflow-x: auto;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.9em;
    line-height: 1.55;
    border-left: 5px solid #e74c3c;
    white-space: pre;
}

@media (max-width: 768px) {
    .cli-section {
        padding: 10px 8px;
    }
}

.extended {
    background-color: #eef5fa;
    padding: 24px;
    padding-right: 20%;
    border-top: 2px solid #2c3e50;
    display: none;
}

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

.ext-btn {
    margin-left: auto;
    background: #e74c3c;
    color: #fff;
    border: none;
    padding: 6px 14px;
    cursor: pointer;
    font-size: 0.9em;
}

.illustration-placeholder {
    /*background: #e8eef3;
    border: 2px dashed #2c3e50;
    padding: 40px 20px;*/
    text-align: center;
    color: #7f8c8d;
    font-style: italic;
    font-size: 0.95em;
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.illustration-placeholder img {
    max-width: 100%;
    max-height: 320px;
    border: 1px solid #b8c4cf;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
}

table th {
    background-color: #2c3e50;
    color: white;
    padding: 8px;
    border: 1px solid #ddd;
    font-size: 0.9em;
}

table td {
    padding: 8px;
    border: 1px solid #ddd;
    font-size: 0.88em;
}

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

pre {
    background-color: #1e1e1e;
    color: #d4d4d4;
    padding: 16px;
    overflow-x: auto;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.92em;
    line-height: 1.6;
    margin: 12px 0;
    border-left: 5px solid #e74c3c;
}

pre code {
    background: transparent;
    padding: 0;
    border-radius: 0;
    font-size: inherit;
    color: inherit;
    font-weight: inherit;
}

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

/* ===== SIDEBAR LAYOUT (index) ===== */

body.sidebar-layout {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f7f6;
    color: #333;
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 400px;
    background-color: #1a1a2e;
    color: white;
    padding: 20px;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    top: 0;
    left: 0;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
}

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

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

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

.sidebar .menu li {
    margin-bottom: 8px;
}

.sidebar .menu a {
    display: block;
    padding: 12px 15px;
    color: #ecf0f1;
    text-decoration: none;
    background-color: #0f3460;
    transition: background-color 0.3s;
    font-size: 0.9em;
}

.sidebar .menu a:hover {
    background-color: #e94560;
}

.sidebar .menu .num {
    font-weight: bold;
    color: #e94560;
    margin-right: 6px;
}

.sidebar .menu a:hover .num {
    color: #fff;
}

.sidebar .menu .active {
    background-color: #e94560;
    font-weight: bold;
}

body.index-layout .content {
    margin-left: 400px;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    min-height: 100vh;
}

body.index-layout .welcome-box {
    background-color: white;
    padding: 40px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    max-width: 800px;
    width: 100%;
}

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

body.index-layout .welcome-box h3 {
    color: #0f3460;
    margin-top: 0;
    margin-bottom: 20px;
    font-weight: normal;
    border-bottom: 2px solid #e94560;
    padding-bottom: 10px;
    font-size: 1.15em;
}

body.index-layout .welcome-box p {
    font-size: 16px;
    line-height: 1.8;
    color: #555;
    margin-bottom: 14px;
    text-align: justify;
}

.sidebar .footer {
    margin-top: auto;
    text-align: center;
    padding-top: 20px;
    font-size: 0.85em;
    color: #7f8c8d;
    border-top: 1px solid #0f3460;
    padding-bottom: 20px;
    margin-bottom: 25px;
}

.sidebar .footer a {
    color: #7f8c8d;
    text-decoration: none;
}

@media (max-width: 800px) {
    .sidebar {
        width: 100%;
        position: relative;
        height: auto;
    }
    body.index-layout .content {
        margin-left: 0;
        padding: 20px;
    }
    body.index-layout .welcome-box {
        padding: 20px;
    }
}

/* ============================================================
   SRE – TRYB PREZENTACJI jak kryptologia.netstudio.net.pl
   (dopisane; istniejących reguł powyżej nie zmieniano)
   Wspólny skrypt: script.js
   ============================================================ */

:root {
    --image-zoom-scale: 2.0;
}

/* --- wyróżnione bloki treści slajdu --- */
.callout {
    background-color: #eef5fa;
    border-left: 5px solid #2980b9;
    padding: 15px;
    margin: 12px 0;
    font-size: 0.98em;
}

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

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

/* --- alias klasy rozszerzenia ze strony wzorcowej --- */
.slide_ext {
    background-color: #eef5fa;
    padding: 24px;
    padding-right: 20%;
    border-top: 2px solid #2c3e50;
}

.slide_ext.hidden {
    display: none;
}

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

/* --- niebieski przycisk menu: Widok / Zoom / Bloki --- */
.menu-bar .img-btn {
    background: #2980b9;
    color: #fff;
    border: none;
    padding: 6px 16px;
    cursor: pointer;
    font-size: 0.9em;
    font-family: inherit;
    font-weight: 600;
    transition: background-color 0.3s;
}

.menu-bar .img-btn:hover {
    background: #1f618d;
}

.menu-drop {
    position: relative;
    display: inline-block;
    margin-left: 8px;
}

.menu-drop .img-btn {
    margin-left: 0;
}

.menu-drop-panel {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 6px;
    min-width: 200px;
    background: #243342;
    border: 1px solid #364d63;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
    z-index: 1200;
    padding: 6px;
}

.menu-drop-panel.open {
    display: block;
}

.menu-drop-title {
    color: #9fb3c8;
    font-size: 0.75em;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 7px 8px 3px;
}

.menu-opt {
    display: block;
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    color: #ecf0f1;
    padding: 6px 10px;
    font-size: 0.85em;
    font-family: inherit;
    cursor: pointer;
    transition: background-color 0.2s;
}

.menu-opt:hover {
    background: #2980b9;
}

.menu-opt.active {
    background: #1f618d;
    font-weight: 700;
    box-shadow: inset 3px 0 0 #f1c40f;
}

.menu-drop-sep {
    height: 1px;
    background: #364d63;
    margin: 5px 2px;
}

.menu-drop.open .img-btn {
    background: #1f618d;
}

/* --- przyciski Poprzedni / Następny w nagłówku slajdu --- */
.slide-nav {
    display: none;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    padding: 0;
    flex-shrink: 0;
}

body.view-slides .slide-nav {
    display: flex;
}

.header > .slide-nav {
    align-self: center;
}

.slide-nav-btn {
    width: 7em;
    height: 1.75em;
    font-size: 0.85em;
    font-family: inherit;
    font-weight: 600;
    color: #fff;
    background: #2980b9;
    border: none;
    cursor: pointer;
    line-height: 1.75em;
    padding: 0;
    transition: background-color 0.3s;
}

.slide-nav-btn:hover:not(:disabled) {
    background: #1f618d;
}

.slide-nav-btn:disabled {
    background: #9aa7b4;
    cursor: default;
}

/* --- widok slajdowy: jeden slajd na ekranie --- */
body.view-slides .slide {
    display: none;
}

body.view-slides .slide.slide-active {
    display: block;
}

/* --- zoom obrazka po najechaniu myszką --- */
/* Slajd i jego wnętrze MUSZĄ mieć overflow: visible (zamiast hidden),
   inaczej powiększony obrazek jest obcinany do ramki slajdu.
   Reguły dopisane (nie ruszają oryginalnego .slide powyżej). */
.slide {
    overflow: visible;
    position: relative;
}

.slide .content,
.slide .text,
.illustration,
.illustration-placeholder {
    overflow: visible;
}

.illustration,
.illustration-placeholder {
    position: relative;
}
.illustration a,
.illustration-placeholder a {
    display: inline-block;
    overflow: visible;
}

.illustration img,
.illustration-placeholder img {
    transition: transform 0.25s ease-in-out, box-shadow 0.25s ease-in-out;
    transform-origin: center center;
    cursor: pointer;
}

.illustration img:hover,
.illustration-placeholder img:hover {
    transform: scale(var(--image-zoom-scale, 2.0));
    position: relative;
    z-index: 999999 !important;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.55);
}

.slide:hover,
.slide:has(.illustration img:hover),
.slide:has(.illustration-placeholder img:hover) {
    z-index: 50;
}

/* --- zoom wyłączony w menu: hover nie powiększa --- */
body.zoom-disabled .illustration img:hover,
body.zoom-disabled .illustration-placeholder img:hover {
    transform: scale(1) !important;
    box-shadow: none !important;
    z-index: auto !important;
}
