* { 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(.sidebar) {
    display: flex;
    min-height: 100vh;
    background-color: #f4f7f6;
}

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

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

/* ===== NAV / MENU-BAR ===== */
.menu-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: #243342;
    padding: 8px 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: center;
}

.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; }

/* ===== NAV (telekom style) ===== */
nav {
    background-color: #2c3e50;
    padding: 10px 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

nav a:hover { background-color: #e74c3c; }

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

/* ===== SIDEBAR ===== */
.sidebar {
    width: 400px;
    background-color: #1a1a2e;
    color: white;
    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: 15px;
    color: #e94560;
}

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

.sidebar .section-title {
    font-size: 13px;
    text-align: left;
    color: #e94560;
    margin-top: 18px;
    margin-bottom: 8px;
    font-weight: bold;
    border-bottom: 1px solid #0f3460;
    padding-bottom: 4px;
}

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

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

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

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

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

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

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

/* ===== CONTENT / MAIN AREA ===== */
body > .content {
    flex: 1;
    padding: 40px;
    margin-left: 400px;
    min-height: 100vh;
}

body:has(.index-box) > .content {
    margin-left: 300px;
    display: block;
}

body > .content:has(.welcome-box) {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* ===== SLIDE LAYOUT ===== */
.slide {
    max-width: 1200px;
    margin: 30px auto;
    background: #f9f9f9;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.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;
    flex: 1;
}

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

.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); }

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 {
    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.ascii-art {
    background-color: #1e1e1e;
    color: #d4d4d4;
    padding: 16px;
    overflow-x: auto;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.92em;
    line-height: 1.3;
    margin: 12px 0;
    border-left: 5px solid #e74c3c;
}

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

/* ===== CODE BLOCKS ===== */
.cli-code {
    width: 100%;
}

.code-block {
    width: 100%;
}

code {
    color: #ee0000;
}

/* ===== COMMON ===== */

.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;
}

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

/* ===== SLIDE EXT ===== */
.slide_ext {
    background-color: #eef5fa;
    padding: 24px 24px;
    padding-right: 20%;
    border-top: 2px solid #2c3e50;
    display: none;
}

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

.slide_ext.hidden {
    display: block;
}

.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%;
}

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;
}

/* ===== IMAGES ===== */
.images {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-top: auto;
    padding-bottom: 25px;
}

.images img {
    display: block;
    max-width: 100%;
    height: auto;
	width: 700px;
}

.str_img {
    display: flex;
    justify-content: center;
    align-items: center;
}

.str_img img {
    width: 300px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* ===== WELCOME BOX ===== */
.welcome-box {
    background-color: white;
    padding: 40px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    max-width: 800px;
    width: 100%;
}

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

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

.welcome-box p {
    font-size: 16px;
    line-height: 1.8;
    color: #555;
    margin-bottom: 14px;
}

/* ===== INDEX BOX ===== */
.index-box {
    background-color: white;
    padding: 30px 40px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    max-width: 1000px;
    width: 100%;
    margin: 0 auto;
}

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

.index-box h3 {
    color: #0f3460;
    margin-top: 0;
    margin-bottom: 24px;
    font-weight: normal;
    border-bottom: 2px solid #e94560;
    padding-bottom: 10px;
}

.index-box p.desc {
    color: #555;
    margin-bottom: 24px;
    line-height: 1.6;
}

/* ===== CLI BLOCK (for pomocnik.css based pages) ===== */
.cli-block {
    background-color: #1e1e1e;
    color: #d4d4d4;
    padding: 16px;
    overflow-x: auto;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
    line-height: 1.4;
    margin: 12px 0;
    border-left: 5px solid #e74c3c;
    word-wrap: break-word;
}

.cli-line {
    display: block;
    line-height: 1.2;
}

.cli-comment { color: #6a9955; font-style: italic; }
.cli-cmd { color: #569cd6; }
.cli-prompt { color: #888; }
.cli-out { color: #d4d4d4; white-space: pre-wrap; }
.cli-var { color: #9cdcfe; }
.cli-keyword { color: #569cd6; }
.cli-string { color: #ce9178; }
.cli-number { color: #b5cea8; }

.highlight {
    color: #e74c3c;
    font-weight: bold;
}

/* ===== CONTAINER (for pomocnik.css pages) ===== */
.container {
    max-width: 1100px;
    margin: 30px auto;
    background: #f9f9f9;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    padding: 30px;
}

.container h1 {
    color: #2c3e50;
    margin-bottom: 20px;
    border-bottom: 3px solid #e74c3c;
    padding-bottom: 10px;
}

.container h2 {
    color: #2c3e50;
    margin-top: 30px;
    margin-bottom: 15px;
    border-bottom: 2px solid #ddd;
    padding-bottom: 8px;
}

.container h3 {
    color: #2c3e50;
    margin-top: 20px;
    margin-bottom: 10px;
}

.container p {
    margin-bottom: 12px;
    text-align: justify;
    line-height: 1.7;
}

.container ul, .container ol {
    margin: 10px 0 10px 25px;
}

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

/* ===== SKRYPTY ZASADY specific classes ===== */
.script-header {
    background-color: #2c3e50;
    color: white;
    padding: 14px 24px;
    font-size: 1.2em;
    font-weight: bold;
}

/* ===== MEDIA QUERIES ===== */
@media (max-width: 800px) {
    .sidebar { width: 100%; position: relative; height: auto; }
    .content { margin-left: 0 !important; padding: 20px; }
    .index-box { padding: 20px; }
}

@media (max-width: 768px) {
    .sidebar { width: 100%; position: relative; height: auto; }
    .content { margin-left: 0 !important; padding: 20px; }
    .slide .content { flex-direction: column; }
    .slide .illustration { order: -1; }
    .container { padding: 15px; }
}

/* ===== CODE COLORING ===== */
.code-keyword { color: #569cd6; }
.code-string { color: #ce9178; }
.code-comment { color: #6a9955; }
.code-register { color: #4ec9b0; }
.code-numeric { color: #b5cea8; }
.code-type { color: #4ec9b0; }
.code-function { color: #dcdcaa; }
.code-operator { color: #d4d4d4; }
.code-variable { color: #9cdcfe; }
.code-command { color: #dcdcaa; }

/* ===== INFO/WARNING/TIP BOXES ===== */
.tip-box {
    background-color: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 10px 15px;
    margin: 10px 0;
    font-size: 0.95em;
}

.warning-box {
    background-color: #f8d7da;
    border-left: 4px solid #dc3545;
    padding: 10px 15px;
    margin: 10px 0;
    font-size: 0.95em;
}

.info-box {
    background-color: #d1ecf1;
    border-left: 4px solid #17a2b8;
    padding: 10px 15px;
    margin: 10px 0;
    font-size: 0.95em;
}

.code-description {
    font-size: 0.9em;
    color: #555;
    margin-top: 5px;
    font-style: italic;
}

/* ===== PRISM.JS SYNTAX HIGHLIGHTING (VS CODE DARK+ INSPIRED) ===== */
code[class*=language-] {
    color: #d4d4d4;
    background: #1e1e1e;
    font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
    font-size: 1em;
    text-align: left;
    white-space: pre;
    word-spacing: normal;
    word-break: normal;
    word-wrap: normal;
    line-height: 1.5;
    -moz-tab-size: 4;
    -o-tab-size: 4;
    tab-size: 4;
    -webkit-hyphens: none;
    -moz-hyphens: none;
    -ms-hyphens: none;
    hyphens: none;
}

.token.cdata,
.token.comment,
.token.doctype,
.token.prolog { color: #6a9955; font-style: italic; }

.token.punctuation { color: #808080; }

.token.attr-name,
.token.deleted,
.token.namespace { color: #9cdcfe; }

.token.tag { color: #569cd6; }

.token.function-name { color: #dcdcaa; }

.token.boolean,
.token.number { color: #b5cea8; }

.token.function { color: #dcdcaa; }

.token.class-name,
.token.constant,
.token.property,
.token.symbol { color: #4ec9b0; }

.token.atrule,
.token.builtin,
.token.important { color: #569cd6; }

.token.keyword,
.token.selector { color: #569cd6; }

.token.attr-value,
.token.char,
.token.regex,
.token.string { color: #ce9178; }

.token.variable { color: #9cdcfe; }

.token.entity,
.token.operator,
.token.url { color: #d4d4d4; }

.token.bold,
.token.important { font-weight: 700; }

.token.italic { font-style: italic; }

.token.entity { cursor: help; }

.token.inserted { color: #b5cea8; }

.token.deleted { color: #ce9178; }

.token.path { color: #4ec9b0; }
.token.attr-name { color: #9cdcfe; }

/* ===== CODE BLOCK DARK BACKGROUND ===== */
.code-block,
pre:has(> code[class*="language-"]) {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 10px;
    font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
    border-left: 5px solid #e74c3c;
    overflow-x: auto;
    line-height: 1.4;
}


/* === image manipulation === */
	.hover-link {
		position: relative; /* Ważne: pozwala na pozycjonowanie obrazka względem linku */
		text-decoration: none;
		color: #007BFF;
		font-weight: bold;
	}

	/* Styl dla małego obrazka - domyślnie ukryty */
	.hover-link .hover-img {
		display: none;        /* Ukrywa obrazek na starcie */
		position: absolute;   /* Pozwala ustawić obrazek w dowolnym miejscu */
		top: 25px;            /* Przesunięcie w dół (poniżej tekstu) */
		left: 0;              /* Wyrównanie do lewej krawędzi linku */
		width: 80px;          /* Szerokość małego obrazka */
		height: auto;         /* Automatyczna wysokość, by zachować proporcje */
		border: 1px solid #ccc;
		box-shadow: 2px 2px 5px rgba(0,0,0,0.2);
		z-index: 10;          /* Gwarantuje, że obrazek pojawi się na wierzchu innych elementów */
	}

	/* Efekt po najechaniu myszką (hover) */
	.hover-link:hover .hover-img {
		display: block;       /* Pokazuje obrazek, gdy najedziesz na link */
	}
	
	/* Skrypt JS do pokazywania obrazka nad wszystkim */
	.maly-div {
		width: 150px;
		height: 50px;
		background-color: #f0f0f0;
		overflow: hidden; /* To tutaj blokowało poprzedni sposób! */
		border: 1px solid #333;
		padding: 10px;
	}

	/* Styl dla globalnego podglądu - ukryty i nad wszystkim */
	#global-preview {
		display: none;
		position: absolute; /* Pozycjonowanie względem całej strony */
		z-index: 99999;     /* Maksymalna wartość, obrazek będzie na samej górze */
		width: 120px;
		height: auto;
		border: 2px solid white;
		box-shadow: 0px 4px 15px rgba(0,0,0,0.5);
		pointer-events: none; /* Sprawia, że myszka "ignoruje" obrazek (brak migania) */
	}