/* Hilfe: Modal + Vollansicht (public/js/help.js). Farben nur über die vorhandenen CSS-Variablen,
   damit body.dark-theme automatisch greift. */

.help-q-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 24px; height: 24px; margin-left: 10px; vertical-align: middle;
    border-radius: 50%; border: 1px solid var(--border-light);
    background: var(--bg-light); color: var(--text-gray);
    font-size: 13px; font-weight: 700; line-height: 1; cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
}
.page-title:has(> .help-q-btn) { white-space: nowrap; }
.help-q-btn:hover { background: var(--accent-primary, #4f46e5); color: #fff; border-color: transparent; }

.help-sidebar-btn {
    width: 100%; margin-top: 8px; padding: 8px 12px;
    background: transparent; color: var(--text-gray);
    border: 1px solid var(--border-light); border-radius: 8px;
    font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
}
.help-sidebar-btn:hover { color: var(--text-dark); background: var(--bg-light); }
.help-sidebar-btn kbd { font-size: 0.75em; padding: 1px 5px; border: 1px solid var(--border-light); border-radius: 4px; }

/* ── Modal ── */
.help-overlay {
    position: fixed; inset: 0; z-index: 9500;
    background: rgba(15, 23, 42, 0.55);
    display: flex; align-items: center; justify-content: center; padding: 24px;
}
body.help-modal-open { overflow: hidden; }
.help-modal {
    width: min(1100px, 100%); height: min(760px, 100%);
    background: var(--bg-white); color: var(--text-dark);
    border-radius: 14px; box-shadow: 0 24px 64px rgba(0,0,0,0.35);
    overflow: hidden; display: flex; flex-direction: column;
}

/* ── Gemeinsames Layout ── */
.help-shell { display: flex; flex-direction: column; min-height: 0; height: 100%; }
.help-top {
    display: flex; gap: 10px; align-items: center;
    padding: 14px 16px; border-bottom: 1px solid var(--border-light);
}
.help-search-wrap { position: relative; flex: 1; }
.help-search-icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); font-size: 0.9em; opacity: 0.6; pointer-events: none; }
.help-search {
    width: 100%; padding: 10px 12px 10px 34px; margin: 0;
    border: 1px solid var(--border-light); border-radius: 8px;
    background: var(--bg-light); color: var(--text-dark); font-size: 0.95em;
}
.help-search:focus { outline: 2px solid var(--accent-primary, #4f46e5); outline-offset: -1px; }
.help-close {
    background: none; border: none; cursor: pointer; color: var(--text-gray);
    font-size: 1.3em; line-height: 1; padding: 6px 8px; border-radius: 6px;
}
.help-close:hover { background: var(--bg-light); color: var(--text-dark); }

.help-body { display: flex; flex: 1; min-height: 0; }
.help-nav {
    width: 240px; flex: none; overflow-y: auto; padding: 10px 8px 16px;
    border-right: 1px solid var(--border-light); background: var(--bg-light);
}
.help-nav-group {
    font-size: 0.7em; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
    color: var(--text-gray); padding: 12px 10px 4px;
}
.help-nav-item {
    display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
    padding: 7px 10px; border: none; border-radius: 7px; background: none;
    color: var(--text-dark); font-size: 0.9em; cursor: pointer;
}
.help-nav-item:hover { background: var(--bg-white); }
.help-nav-item.active { background: var(--accent-primary, #4f46e5); color: #fff; font-weight: 600; }
.help-nav-icon { width: 20px; text-align: center; flex: none; }
.help-nav-select { display: none; }

.help-content { flex: 1; min-width: 0; overflow-y: auto; padding: 20px 28px 40px; }
.help-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.help-section-title { margin: 0; font-size: 1.35em; color: var(--text-dark); }
.help-goto, .help-link { padding: 6px 12px !important; font-size: 0.82em !important; }
.help-intro { color: var(--text-gray); margin: 4px 0 14px; line-height: 1.55; }
.help-toc { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.help-toc a {
    font-size: 0.8em; padding: 3px 10px; border-radius: 12px; text-decoration: none;
    border: 1px solid var(--border-light); color: var(--text-gray);
}
.help-toc a:hover { color: var(--text-dark); background: var(--bg-light); }

.help-item {
    border: 1px solid var(--border-light); border-radius: 10px;
    padding: 14px 18px; margin-bottom: 12px; scroll-margin-top: 12px;
}
.help-item-hl { border-color: var(--accent-primary, #4f46e5); box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18); }
.help-item-title { margin: 0 0 8px; font-size: 1.02em; color: var(--text-dark); }
.help-para { margin: 0 0 10px; line-height: 1.6; color: var(--text-dark); }
.help-list { margin: 0 0 10px 20px; padding: 0; line-height: 1.6; color: var(--text-dark); }
.help-list li { margin-bottom: 3px; }
.help-callout {
    margin: 4px 0 10px; padding: 9px 12px; border-radius: 8px; line-height: 1.5;
    background: rgba(245, 158, 11, 0.12); border-left: 3px solid #f59e0b; color: var(--text-dark);
}
.help-callout::before { content: '⚠️ '; }
.help-link { margin-top: 2px; }

.help-results-head { font-size: 0.8em; color: var(--text-gray); margin-bottom: 10px; }
.help-result {
    display: block; width: 100%; text-align: left; cursor: pointer;
    padding: 11px 14px; margin-bottom: 8px; border-radius: 9px;
    border: 1px solid var(--border-light); background: none; color: var(--text-dark);
}
.help-result:hover { border-color: var(--accent-primary, #4f46e5); background: var(--bg-light); }
.help-result-section { font-size: 0.75em; color: var(--text-gray); margin-bottom: 2px; }
.help-result-title { font-weight: 700; margin-bottom: 3px; }
.help-result-snippet { font-size: 0.85em; color: var(--text-gray); line-height: 1.45; }
.help-result-snippet mark { background: rgba(245, 158, 11, 0.35); color: inherit; border-radius: 2px; padding: 0 1px; }
.help-empty { color: var(--text-gray); padding: 20px 0; }

/* Screenshots */
.help-fig { margin: 6px 0 10px; }
.help-fig-btn {
    display: block; padding: 0; margin: 0; border: 1px solid var(--border-light); border-radius: 8px;
    overflow: hidden; background: #fff; cursor: zoom-in; max-width: 100%;
}
.help-fig-btn img { display: block; width: 100%; max-width: 720px; height: auto; }
.help-fig figcaption { font-size: 0.8em; color: var(--text-gray); margin-top: 5px; }
.help-zoom {
    position: fixed; inset: 0; z-index: 9600; background: rgba(15, 23, 42, 0.85);
    display: flex; align-items: center; justify-content: center; padding: 20px; cursor: zoom-out;
}
.help-zoom img { max-width: 100%; max-height: 100%; border-radius: 8px; background: #fff; box-shadow: 0 20px 60px rgba(0,0,0,0.5); }

/* Vollansicht: Seite scrollt selbst, Navigation bleibt stehen */
.help-shell-page { height: auto; }
.help-shell-page .help-top { padding: 0 0 14px; }
.help-shell-page .help-body { align-items: flex-start; }
.help-shell-page .help-nav { position: sticky; top: 80px; max-height: calc(100vh - 110px); border-radius: 10px; border: 1px solid var(--border-light); }
.help-shell-page .help-content { overflow: visible; padding: 0 0 20px 24px; }

/* ── Mobil ── */
@media (max-width: 768px) {
    .help-overlay { padding: 0; }
    .help-modal { width: 100%; height: 100%; border-radius: 0; }
    .help-nav { display: none; }
    .help-nav-select {
        display: block; margin: 10px 16px 0; padding: 9px 10px; font-size: 0.95em;
        border: 1px solid var(--border-light); border-radius: 8px;
        background: var(--bg-light); color: var(--text-dark);
    }
    .help-shell-page .help-nav-select { margin: 0 0 12px; }
    .help-content { padding: 14px 16px 30px; }
    .help-shell-page .help-content { padding: 0; }
    .help-item { padding: 12px 14px; }
    .help-toc { display: none; }
}
