/* ============================================================
   PROGRAMOWANIE APLIKACJI MOBILNYCH - style.css
   Wspólny arkusz stylów dla kursu (5 prezentacji)
   Układ i kolorystyka wzorowane na kryptologia.netstudio.net.pl
   ============================================================ */

/* === BAZA === */
:root {
    --image-zoom: 2;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
    line-height: 1.7;
    background-color: #f0f2f5;
    padding: 0;
}

/* === PASEK MENU (widok wykładu) === */
body.lecture-layout { background-color: #f0f2f5; padding: 0; }

.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, .menu-bar a.active { background-color: #e74c3c; font-weight: bold; }
.menu-bar .ext-btn {
    background: #e74c3c;
    color: #fff;
    border: none;
    padding: 6px 16px;
    cursor: pointer;
    font-size: 0.85em;
    margin-left: auto;
    font-family: inherit;
    font-weight: 600;
    transition: background-color 0.3s;
}
.menu-bar .ext-btn:hover { background: #c0392b; }

.menu-bar .img-btn {
    background: #2980b9;
    color: #fff;
    border: none;
    padding: 6px 14px;
    cursor: pointer;
    font-size: 0.85em;
    font-family: inherit;
    font-weight: 600;
    transition: background-color 0.3s;
}
.menu-bar .img-btn:hover { background: #1f618d; }

/* === MENU ROZWIJANE GRAFIKA / WIDOK === */
.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: #2980b9; font-weight: 700; }
.menu-drop-sep { height: 1px; background: #364d63; margin: 5px 2px; }

/* === WIDOK: LISTA / SLAJDY === */
.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; }

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

/* === SLAD === */
.slide {
    max-width: 1100px;
    margin: 30px auto;
    background: #f9f9f9;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.slide:hover,
.slide-content:hover,
.illustration:hover,
.diagram:hover {
    overflow: visible;
}
.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%; }
.illustration { flex: 2; min-width: 250px; display: flex; align-items: center; justify-content: center; }

/* === TYPOGRAFIA === */
h3, .text h2 { 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; }
li strong { color: #2c3e50; }

/* === POLE DEFINICJI / PRZYKLADU / WAŻNE / PYTANIA === */
.definition { background-color: #eef5fa; border-left: 5px solid #2c3e50; padding: 15px; margin: 12px 0; font-size: 0.98em; }
.example { background-color: #fff3cd; border-left: 5px solid #ffc107; padding: 15px; margin: 12px 0; font-size: 0.98em; }
.questions { background-color: #eef5fa; border-left: 5px solid #2c3e50; padding: 15px; margin: 12px 0; }
.questions ol { margin-left: 20px; }
.questions li { margin-bottom: 8px; }
.highlight { background-color: #eef5fa; color: #c7254e; padding: 2px 6px; font-weight: bold; font-size: 0.9em; }
.subtitle { color: #555; font-size: 1.05em; }

/* === WAŻNY BOX (żółte tło, pomarańczowa krawędź) === */
.important-box, .important {
    background-color: #fff3cd; border-left: 5px solid #e67e22;
    padding: 14px 18px; margin: 12px 0; font-size: 0.98em;
}
.important-box strong, .important strong { color: #856404; }

/* === ELEMENTY PLANU SLADU === */
.goal {
    background-color: #f0f4f8;
    border-left: 5px solid #3498db;
    padding: 12px 16px;
    margin: 12px 0;
    font-size: 0.96em;
}
.goal strong { color: #1a2a3a; }
.note-ai {
    background-color: #f9f0f4;
    border-left: 5px solid #9b59b6;
    padding: 12px 16px;
    margin: 12px 0;
    font-size: 0.95em;
}
.note-ai strong { color: #6c3483; }

/* === REZERWACJA OBRAZU (KLIKALNY PLACEHOLDER ORAZ SVG / IMG) === */
.diagram {
    text-align: center;
    width: 100%;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 0.95em;
    line-height: 1.6;
    color: #2c3e50;
    overflow-x: auto;
}
.diagram svg {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 0 !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
    background: #ffffff;
    border: 1px solid #e2e8f0;
    position: relative;
    z-index: 1;
    transform: scale(1);
    transform-origin: center center;
    transition: transform 0.25s cubic-bezier(0.2, 0, 0.2, 1), box-shadow 0.25s ease;
}
.diagram .slide-svg-link {
    display: block;
    max-width: 100%;
    margin: 0 auto;
    text-decoration: none;
    cursor: zoom-in;
    border: none;
    box-shadow: none;
    position: relative;
}
.diagram .slide-svg-link:hover,
.diagram .slide-svg-link:focus,
.diagram svg:hover {
    z-index: 999;
}
.diagram .slide-svg-link:hover svg,
.diagram .slide-svg-link:focus svg,
.diagram svg:hover {
    transform: scale(var(--image-zoom, 2));
    z-index: 1000;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.4);
}
.diagram .slide-img-link {
    display: block;
    max-width: 100%;
    margin: 0 auto;
    text-decoration: none;
    cursor: zoom-in;
    border: none;
    box-shadow: none;
    position: relative;
}
.diagram .slide-img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    border: none;
    box-shadow: none;
    position: relative;
    z-index: 1;
    transform: scale(1);
    transform-origin: center center;
    transition: transform 0.25s cubic-bezier(0.2, 0, 0.2, 1), box-shadow 0.25s ease;
}
.diagram .slide-img-link:hover,
.diagram .slide-img-link:focus {
    z-index: 999;
}
.diagram .slide-img-link:hover .slide-img,
.diagram .slide-img-link:focus .slide-img,
.diagram .img-placeholder:hover img,
.diagram .img-placeholder:focus img,
.diagram a:hover img,
.diagram img:hover {
    transform: scale(var(--image-zoom, 2));
    z-index: 1000;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.4);
}
.diagram .img-placeholder img {
    position: relative;
    z-index: 1;
    transform: scale(1);
    transform-origin: center center;
    transition: transform 0.25s cubic-bezier(0.2, 0, 0.2, 1), box-shadow 0.25s ease;
}
/* Dynamiczny zoom wyłączony */
body.zoom-disabled .diagram .slide-svg-link:hover svg,
body.zoom-disabled .diagram .slide-svg-link:focus svg,
body.zoom-disabled .diagram svg:hover,
body.zoom-disabled .diagram .slide-img-link:hover .slide-img,
body.zoom-disabled .diagram .slide-img-link:focus .slide-img,
body.zoom-disabled .diagram .img-placeholder:hover img,
body.zoom-disabled .diagram .img-placeholder:focus img,
body.zoom-disabled .diagram a:hover img,
body.zoom-disabled .diagram img:hover {
    transform: none !important;
    box-shadow: none !important;
    z-index: 1 !important;
}
body.zoom-disabled .diagram .slide-svg-link,
body.zoom-disabled .diagram .slide-img-link,
body.zoom-disabled .diagram .img-placeholder,
body.zoom-disabled .diagram a {
    cursor: pointer;
}
.img-placeholder {
    display: block;
    text-decoration: none;
    background-color: #ffffff;
    color: #2c3e50;
    padding: 18px 12px;
    margin: 8px auto;
    transition: background-color 0.3s, border-color 0.3s;
    max-width: 340px;
}
.img-placeholder:hover { background-color: #eef5fa; border-color: #e74c3c; }
.img-placeholder .img-frame {
    display: block;
    font-weight: 700;
    font-size: 1em;
    color: #364d63;
}
.img-placeholder .img-file {
    display: block;
    margin-top: 6px;
    font-size: 0.8em;
    font-family: 'Consolas', 'Courier New', Courier, monospace;
    color: #e74c3c;
    word-break: break-all;
}
.img-placeholder .img-desc {
    display: block;
    margin-top: 8px;
    font-size: 0.8em;
    color: #777;
    font-style: italic;
}

/* === ROZSZERZENIE SLADU === */
.slide_ext { background-color: #eef5fa; padding: 24px; padding-right: 20%; border-top: 2px solid #2c3e50; }
.slide_ext p { margin-bottom: 8px; font-size: 0.95em; }
.slide_ext h3 { color: #2c3e50; font-size: 1.05em; }
.slide_ext.hidden { display: none; }

/* === TABELE === */
table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 0.95em; }
th { background-color: #2c3e50; color: #fff; 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; }

/* === BLOKI KODU / KONSOLA === */
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 #e74c3c;
}
code { background-color: #f0f0f0; padding: 2px 6px; border-radius: 3px; }
pre code { background: none; padding: 0; }

/* === SWAP PYTANIA I ODPOWIEDZI === */
.qa-item { margin-bottom: 14px; padding: 10px 14px; background: #f9f9f9; border-left: 4px solid #3498db; }
.qa-item .question { font-weight: 600; color: #2c3e50; }
.qa-item .answer { color: #555; margin-top: 4px; display: none; }
.qa-item .toggle-btn {
    display: inline-block; margin-top: 6px; padding: 3px 12px;
    background: #364d63; color: #fff; border: none; cursor: pointer;
    font-family: inherit; font-size: 0.85em;
}
.qa-item .toggle-btn:hover { background: #e74c3c; }

/* === SLOWNIK / OS CZASU === */
.dictionary { margin: 8px 0; }
.dictionary dt { color: #364d63; font-weight: bold; margin-top: 8px; }
.dictionary dd { margin-left: 20px; margin-bottom: 6px; }
.timeline { display: flex; justify-content: space-around; flex-wrap: wrap; margin: 16px 0; }
.timeline-item { background-color: #eef5fa; border: 1px solid #ddd; padding: 12px; margin: 8px; min-width: 110px; text-align: center; font-size: 0.9em; color: #555; }
.timeline-item strong { color: #364d63; display: block; margin-bottom: 4px; }

/* === NAWIGACJA POPRZEDNI / NASTEPNY === */
.nav-buttons {
    max-width: 1100px; margin: 0 auto 30px;
    display: flex; justify-content: space-between; padding: 0 16px;
}
.nav-buttons a {
    display: inline-block; padding: 10px 22px;
    background-color: #364d63; color: #fff; text-decoration: none;
    font-size: 0.95em; border-radius: 4px; transition: background-color 0.3s;
}
.nav-buttons a:hover { background-color: #e74c3c; }
.nav-buttons a.disabled { background-color: #aaa; pointer-events: none; }

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

/* === PASKI NAPISANE W ERGONOMII STRONY GLOWNEJ (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; color: #888; margin-bottom: 25px; font-style: italic; }
.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; }
.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; width: 100%; }
.sidebar .footer a { color: #7f8c8d; text-decoration: none; }
.section-title { margin-top: 20px; color: #e94560; font-size: 12px; text-align: center; text-transform: uppercase; letter-spacing: 1px; }

.sidebar + .content { flex: 1; padding: 40px; margin-left: 400px; min-height: 100vh; }
.content:has(.welcome-box) { display: flex; flex-direction: column; align-items: center; justify-content: center; }

.welcome-box { background-color: white; padding: 40px; 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: 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; }
.welcome-box ul { margin: 10px 0 10px 20px; }
.welcome-box li { margin-bottom: 4px; }

.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; }
.toc { background: #f0f4f8; padding: 16px 20px; margin-bottom: 28px; border-left: 4px solid #0f3460; }
.toc h4 { color: #0f3460; margin-bottom: 10px; }
.toc a { color: #0f3460; text-decoration: none; font-size: 0.92em; line-height: 1.8; }
.toc a:hover { text-decoration: underline; color: #e94560; }
.letter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 6px; margin-bottom: 24px; }
.letter-card { background: #f0f4f8; border-left: 4px solid #0f3460; text-align: center; padding: 6px 0; cursor: pointer; font-weight: 700; font-size: 1.05em; color: #0f3460; transition: all 0.2s; user-select: none; }
.letter-card:hover { background: #e94560; color: #fff; border-left-color: #1a1a2e; }
.letter-card.active { background: #e94560; color: #fff; border-left-color: #1a1a2e; }
.cat { margin-bottom: 36px; }
.cat h4 { color: #1a1a2e; font-size: 1.15em; background: #f0f4f8; padding: 10px 14px; border-left: 5px solid #e94560; margin-bottom: 14px; }
.entry { padding: 7px 14px; border-bottom: 1px solid #eef1f0; }
.entry:last-child { border-bottom: none; }
.entry .term-link { color: #1a1a2e; text-decoration: none; font-weight: 600; display: block; padding: 2px 0; transition: color 0.15s; }
.entry .term-link:hover { color: #e94560; text-decoration: underline; }

/* === SZUKANIE W MATERIALACH === */
.search-box { background-color: white; padding: 30px; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); max-width: 900px; width: 100%; margin: 0 auto; }
.search-box h2 { color: #1a1a2e; margin-bottom: 8px; }
.search-box h3 { color: #0f3460; margin-top: 0; margin-bottom: 20px; font-weight: normal; border-bottom: 2px solid #e94560; padding-bottom: 10px; }
.search-form { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; align-items: center; }
.search-form input[type="text"] { flex: 1; min-width: 200px; padding: 12px 16px; border: 2px solid #ddd; font-size: 1em; outline: none; transition: border-color 0.3s; }
.search-form input[type="text"]:focus { border-color: #e94560; }
.search-form .options { display: flex; gap: 16px; align-items: center; }
.search-form .options label { font-size: 0.9em; color: #555; cursor: pointer; display: flex; align-items: center; gap: 4px; }
.search-form .options input[type="radio"] { accent-color: #e94560; }
.search-form button { padding: 12px 28px; background-color: #e94560; color: white; border: none; font-size: 1em; cursor: pointer; transition: background-color 0.3s; }
.search-form button:hover { background-color: #c73a52; }
.stats { font-size: 0.9em; color: #888; margin-bottom: 16px; }
.result { background: #f0f4f8; border-left: 4px solid #0f3460; padding: 14px 16px; margin-bottom: 12px; }
.result.found { border-left-color: #e94560; }
.result .r-part { font-weight: bold; color: #0f3460; font-size: 0.85em; }
.result .r-title { font-size: 1.05em; font-weight: 600; color: #1a1a2e; margin: 4px 0; }
.result .r-snippet { font-size: 0.92em; color: #555; line-height: 1.5; }
.result .r-link { display: inline-block; margin-top: 6px; font-size: 0.85em; color: #e94560; text-decoration: none; }
.result .r-link:hover { text-decoration: underline; }
.result mark { background-color: #ffdd57; padding: 1px 3px; }
.no-results { text-align: center; padding: 40px; color: #888; font-style: italic; }

/* === PRZYCISK NA GORE STRONY === */
.scroll-top {
    position: fixed; bottom: 30px; right: 30px; background: #e94560; color: white;
    border: none; padding: 10px 16px; cursor: pointer; font-size: 1.2em;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2); z-index: 500;
}
.scroll-top:hover { background: #c73a52; }

/* === RESPONSYWNY === */
@media (max-width: 800px) {
    .sidebar { width: 100%; position: relative; height: auto; }
    .sidebar + .content { margin-left: 0; padding: 20px; }
    .index-box { 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; }
    .search-form { flex-direction: column; align-items: stretch; }
}

/* === 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) */
	}