/* Lekcje — styl lekcji (statyczne strony HTML w motywie) */
:root {
    --accent: #2563eb;
    --accent-light: #dbeafe;
    --surface: #f8fafc;
    --contrast: #1a1a2e;
    --muted: #64748b;
    --success: #16a34a;
    --error: #dc2626;
    --sidebar-width: 320px;
}

* { box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    color: var(--contrast);
    background: var(--surface);
    margin: 0;
    line-height: 1.6;
}

/* Top bar */
.lesson-topbar {
    background: var(--accent);
    color: #fff;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}
.lesson-topbar a.back {
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    opacity: 0.95;
}
.lesson-topbar a.back:hover { opacity: 1; }
.lesson-badge {
    background: rgba(255,255,255,0.2);
    border-radius: 999px;
    padding: 4px 14px;
    font-size: 0.9rem;
    font-weight: 600;
}

/* Lesson content */
.lesson-content {
    max-width: 860px;
    margin: 0 auto;
    padding: 32px 24px 64px;
}
.lesson-content h1 {
    font-size: 2rem;
    color: var(--accent);
    margin: 0 0 8px;
    line-height: 1.2;
}
.lesson-subtitle {
    color: var(--muted);
    font-size: 1.05rem;
    margin: 0 0 32px;
}

/* Section cards */
.lesson-section {
    background: #fff;
    border-radius: 16px;
    padding: 24px 28px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.lesson-section h2 {
    font-size: 1.4rem;
    color: var(--contrast);
    margin: 0 0 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.lesson-section h2 .sec-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--accent-light);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}
.lesson-section p { margin: 0 0 12px; }
.lesson-section ul { margin: 0 0 12px; padding-left: 20px; }
.lesson-section li { margin-bottom: 6px; }

/* Example box */
.example-box {
    background: var(--accent-light);
    border-left: 4px solid var(--accent);
    border-radius: 8px;
    padding: 16px 20px;
    margin: 16px 0;
}
.example-box .ex-label {
    font-weight: 700;
    color: var(--accent);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}
.example-box .ex-math {
    font-size: 1.2rem;
    font-family: 'Cambria Math', 'Times New Roman', serif;
    color: var(--contrast);
}

/* Key idea */
.key-idea {
    background: #fffbeb;
    border-left: 4px solid #f59e0b;
    border-radius: 8px;
    padding: 16px 20px;
    margin: 16px 0;
}
.key-idea .ki-label {
    font-weight: 700;
    color: #b45309;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

/* Exercise */
.exercise {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--surface);
}
.exercise:last-child { border-bottom: none; }
.exercise .ex-q {
    font-weight: 600;
    font-size: 1.05rem;
    margin-bottom: 10px;
}
.exercise .ex-q .q-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 0.9rem;
    margin-right: 8px;
    font-weight: 700;
}
.ex-input {
    width: 120px;
    padding: 10px 14px;
    font-size: 1rem;
    border: 2px solid var(--accent-light);
    border-radius: 10px;
    text-align: center;
    font-family: inherit;
    color: var(--contrast);
    transition: border-color 0.15s;
}
.ex-input:focus {
    outline: none;
    border-color: var(--accent);
}
.ex-feedback {
    margin-top: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    min-height: 1.2em;
}
.ex-feedback.correct { color: var(--success); }
.ex-feedback.wrong { color: var(--error); }
.ex-check {
    margin-top: 10px;
    padding: 8px 18px;
    font-size: 0.95rem;
    font-weight: 600;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
}
.ex-check:hover { background: #1d4ed8; }
.ex-result {
    margin-top: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    min-height: 1.2em;
}

/* Multiple choice */
.ex-choices {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}
.ex-choice {
    padding: 8px 16px;
    border: 2px solid var(--accent-light);
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.95rem;
    background: #fff;
    transition: all 0.15s;
    font-family: inherit;
}
.ex-choice:hover { border-color: var(--accent); }
.ex-choice.selected { border-color: var(--accent); background: var(--accent-light); }
.ex-choice.correct { border-color: var(--success); background: #dcfce7; }
.ex-choice.wrong { border-color: var(--error); background: #fee2e2; }

/* PDF download button */
.pdf-download {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    background: var(--accent);
    color: #fff;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.05rem;
    transition: background 0.15s;
    box-shadow: 0 2px 6px rgba(37,99,235,0.3);
}
.pdf-download:hover { background: #1d4ed8; }
.pdf-download .pdf-icon { font-size: 1.3rem; }
.pdf-note {
    color: var(--muted);
    font-size: 0.9rem;
    margin-top: 10px;
}

/* Score summary */
.ex-score {
    margin-top: 16px;
    padding: 14px 20px;
    background: var(--surface);
    border-radius: 10px;
    font-weight: 600;
    text-align: center;
    font-size: 1.05rem;
}

/* Diagram / illustration */
.lesson-diagram {
    margin: 16px 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    background: #fff;
}
.lesson-diagram img {
    display: block;
    width: 100%;
    height: auto;
}

/* Collapsible exercise blocks (level groups: Łatwe / Średnie / Zaawansowane) */
.level-block {
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    margin-bottom: 14px;
    background: #fff;
    overflow: hidden;
}
.level-block summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    user-select: none;
    font-weight: 700;
    font-size: 1.05rem;
    transition: background 0.15s;
}
.level-block summary::-webkit-details-marker { display: none; }
.level-block summary::before {
    content: "▸";
    font-size: 1.1rem;
    color: var(--muted);
    transition: transform 0.2s;
}
.level-block[open] > summary::before { transform: rotate(90deg); }
.level-block summary:hover { background: #f8fafc; }
.level-block .level-count {
    margin-left: auto;
    background: var(--surface);
    color: var(--muted);
    border-radius: 999px;
    padding: 2px 12px;
    font-size: 0.85rem;
    font-weight: 700;
}
.level-block .level-hint {
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 500;
}
.level-block .level-body {
    padding: 8px 18px 18px;
    border-top: 1px solid #e2e8f0;
}
/* Level accents */
.level-block[data-level="easy"] { border-color: #bbf7d0; }
.level-block[data-level="easy"] summary { background: #f0fdf4; }
.level-block[data-level="easy"] summary::before { color: #16a34a; }
.level-block[data-level="medium"] { border-color: #fde68a; }
.level-block[data-level="medium"] summary { background: #fffbeb; }
.level-block[data-level="medium"] summary::before { color: #b45309; }
.level-block[data-level="advanced"] { border-color: #fecaca; }
.level-block[data-level="advanced"] summary { background: #fef2f2; }
.level-block[data-level="advanced"] summary::before { color: #dc2626; }

/* Responsive */
@media (max-width: 600px) {
    .lesson-content { padding: 20px 16px 48px; }
    .lesson-content h1 { font-size: 1.5rem; }
    .ex-input { width: 100%; }
    .ex-choices { flex-direction: column; }
}
