/* Hilfe — Hülle: Kopfzeile, Navigation, Suche, Rahmen, Mobilansicht.
   Farben ausschliesslich aus den Gestaltungswerten der Oberfläche (/css/style.css),
   damit heller und dunkler Stil von selbst stimmen. Kein Hex-Wert hier.
   Die Bausteine der Seiten selbst stehen in inhalt.css. */

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    background: var(--aic-bg);
    color: var(--aic-text);
    font-size: 14px;
}

/* ---------- Kopfzeile (in beiden Stilen blau, wie die Oberfläche) ---------- */

.help-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 52px;
    padding: 0 16px;
    background: var(--aic-accent);
    color: var(--aic-text-inverse);
    flex-shrink: 0;
    z-index: 100;
}

.help-header-left,
.help-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    min-width: 0;
}

.help-header-title {
    font-size: 18px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Das Logo der Oberfläche (dieselbe Datei wie das Favicon, blauer Grund = Kopfzeilenfarbe). */
.header-logo {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.header-icon {
    width: 26px;
    height: 26px;
    filter: brightness(0) invert(1);
    flex-shrink: 0;
}

.lang-icon { width: 18px; height: 18px; }

.lang-dropdown {
    background: var(--aic-surface);
    color: var(--aic-text);
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
}

.burger-btn {
    display: none;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border-radius: var(--aic-radius-sm);
    border: 1px solid var(--aic-bild-kante);
    background: transparent;
    color: var(--aic-text-inverse);
    cursor: pointer;
}
.burger-btn svg { width: 22px; height: 22px; }

/* ---------- Rahmen ---------- */

.help-container {
    display: flex;
    height: calc(100vh - 52px);
    position: relative;
}

/* ---------- Navigation (in beiden Stilen dunkel, wie die Hauptnavigation) ---------- */

.help-sidebar {
    width: 280px;
    min-width: 280px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--aic-surface-dark);
    flex-shrink: 0;
}

.sidebar-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--aic-border-dark-6);
}

.search-icon {
    width: 16px;
    height: 16px;
    opacity: .6;
    filter: brightness(0) invert(1);
    flex-shrink: 0;
}

.search-input {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid var(--aic-border-dark-5);
    border-radius: var(--aic-radius-sm);
    background: var(--aic-surface-dark-2);
    color: var(--aic-text-inverse);
    font: inherit;
    font-size: 13px;
    outline: none;
}
.search-input:focus { border-color: var(--aic-accent); }
.search-input::placeholder { color: var(--aic-text-faint-4); }

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 6px 0;
}

/* Ein Eintrag je Ebene; die Einrückung kommt aus --tiefe (von help.js gesetzt). */
.nav-item {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    padding: 0 14px 0 calc(14px + var(--tiefe, 0) * 16px);
    color: var(--aic-text-faint-4);
    font-size: 13px;
    cursor: pointer;
    user-select: none;
    border-left: 3px solid transparent;
}
.nav-item:hover { background: var(--aic-surface-dark-2); color: var(--aic-text-inverse); }
.nav-item.active {
    border-left-color: var(--aic-accent-6);
    background: var(--aic-surface-dark-3);
    color: var(--aic-text-inverse);
    font-weight: 500;
}

/* Oberste Ebene: Rubrik */
.nav-item.ebene-0 {
    min-height: 38px;
    background: var(--aic-accent);
    color: var(--aic-text-inverse);
    font-weight: 500;
    /* Trennlinie wie der Rand der Kopfzeilen-Knöpfe der Oberfläche (Weiss, 30 %); der linke
       Markierungsrand trägt im Ruhezustand die Flächenfarbe, sonst steht dort ein dunkler Streifen. */
    border-bottom: 1px solid color-mix(in srgb, var(--aic-text-inverse) 30%, transparent);
    border-left-color: var(--aic-accent);
}
.nav-item.ebene-0:hover { background: var(--aic-accent-2); border-left-color: var(--aic-accent-2); }
.nav-item.ebene-0.active { background: var(--aic-accent-2); border-left-color: var(--aic-text-inverse); }

.nav-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-chevron {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    opacity: .7;
    filter: brightness(0) invert(1);
    transition: transform .2s;
}
.nav-chevron.offen { transform: rotate(90deg); }
.nav-chevron-platz { width: 14px; flex-shrink: 0; }

.nav-kinder { display: none; }
.nav-kinder.offen { display: block; }

/* Kennzeichen „in Entwicklung" hinter dem Titel */
.nav-marke {
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 8px;
    background: var(--aic-surface-dark-2);
    color: var(--aic-text-faint-4);
    white-space: nowrap;
}

.suchtreffer-bereich {
    margin-left: 6px;
    color: var(--aic-text-dim);
    font-size: 11px;
}

.nav-leer {
    padding: 14px;
    color: var(--aic-text-faint-4);
    font-size: 13px;
}

/* ---------- Inhaltsfläche ---------- */

.help-content {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
    background: var(--aic-bg);
}

/* Brotkrumen über dem Inhalt */
.help-breadcrumb {
    max-width: 1120px;
    margin: 0 auto 12px;
    font-size: 12px;
    color: var(--aic-text-muted);
}
.help-breadcrumb a { color: var(--aic-accent); text-decoration: none; cursor: pointer; }
.help-breadcrumb a:hover { text-decoration: underline; }
.help-breadcrumb .bc-sep { margin: 0 6px; color: var(--aic-text-dim); }

.content-loading,
.content-error {
    text-align: center;
    padding: 60px 20px;
    font-size: 14px;
    color: var(--aic-text-dim);
}
.content-error { color: var(--aic-error-text); }

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 52px 0 0 0;
    background: var(--aic-bild-zeigen);
    z-index: 140;
}
.sidebar-overlay.visible { display: block; }

/* ---------- Nach oben (help.js blendet ihn ein, sobald gescrollt wurde) ---------- */

.nach-oben {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 120;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid color-mix(in srgb, var(--aic-text-inverse) 30%, transparent);
    background: var(--aic-accent);
    color: var(--aic-text-inverse);
    box-shadow: var(--aic-shadow-md);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity .2s, transform .2s, visibility .2s, background .15s;
}
.nach-oben.sichtbar { opacity: 1; visibility: visible; transform: none; }
.nach-oben:hover, .nach-oben:focus-visible { background: var(--aic-accent-2); }
.nach-oben svg { width: 26px; height: 26px; }

@media (max-width: 480px) {
    .nach-oben { right: 14px; bottom: 14px; }
}

/* ---------- Bildlaufleisten ---------- */

.sidebar-nav::-webkit-scrollbar,
.help-content::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-thumb,
.help-content::-webkit-scrollbar-thumb { background: var(--aic-border-dark); border-radius: 3px; }

/* ---------- Touch (Tablet, Handy): Tippziele mindestens 44 px ---------- */

@media (pointer: coarse) {
    .nav-item, .nav-item.ebene-0 { min-height: 44px; }
    .nav-chevron { width: 18px; height: 18px; padding: 2px; box-sizing: content-box; }
    .search-input { padding: 10px 12px; font-size: 16px; }   /* 16 px: iOS zoomt sonst beim Antippen */
    .lang-dropdown { padding: 8px 10px; font-size: 14px; }
    .burger-btn { padding: 9px; }
    .help-breadcrumb a { display: inline-block; padding: 6px 0; }
}

/* ---------- Tablet ---------- */

@media (max-width: 1024px) {
    .help-sidebar { width: 230px; min-width: 230px; }
    .help-content { padding: 24px 20px; }
}

/* ---------- Mobil: Navigation fährt von links herein ---------- */

/* Schmal (Tablet hochkant, Handy) ODER niedrig (Handy quer): die Navigation fährt herein, statt
   dem Inhalt die halbe Breite zu nehmen. */
@media (max-width: 900px), (max-height: 500px) and (max-width: 1100px) {
    .burger-btn { display: flex; }
    .help-header-title { font-size: 15px; }

    .help-sidebar {
        position: fixed;
        top: 52px;
        left: 0;
        bottom: 0;
        width: 80%;
        max-width: 300px;
        z-index: 150;
        transform: translateX(-110%);
        transition: transform .25s ease;
        box-shadow: var(--aic-shadow-md);
    }
    .help-sidebar.open { transform: translateX(0); }

    .help-content { padding: 20px 16px; }
}

@media (max-width: 480px) {
    .help-header { padding: 0 10px; }
    .help-header-title { font-size: 13px; }
    .help-content { padding: 16px 12px; }
}
