/* Gemeinsames Seitenlayout burkhardheim.de.
   Uebernommen aus code/burkhard_heim/header.php, damit die nach
   FastAPI migrierten Seiten sich optisch nicht von den noch
   verbliebenen PHP-Seiten unterscheiden. Aenderungen hier und dort
   muessen zusammenpassen, bis die letzte PHP-Seite abgeloest ist. */

body {
    font-family: Arial, sans-serif;
    background-color: #f0f0f0;
    color: #000;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}
.container {
    width: 70%;
    max-width: 1000px;
    margin: 20px auto;
    padding: 20px;
    background-color: #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    border: 1px solid #ccc; /* Leichte graue Border */
}
.menu-icon {
    font-size: 24px;
    cursor: pointer;
    color: #333;
    margin: 10px;
    align-self: flex-start; /* Hamburger-Menü oben links */
}
/* ------------------------------------------------------------------ */
/* Menü                                                                 */
/*                                                                      */
/* Die Schublade von früher — sie gleitet von links herein, ein         */
/* Schleier legt sich über die Seite — nur ohne alles, was nicht        */
/* trägt: keine Rahmen, keine Kacheln, keine Überschrift, keine         */
/* Trennstriche. Was bleibt, sind Namen in einer Reihenfolge, der       */
/* Umfang leise dahinter, und ganz unten das Beiwerk.                   */
/* ------------------------------------------------------------------ */

.menu-icon {
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: #333;
    background: none;
    border: none;
    padding: 10px 12px;
    margin: 0;
    align-self: flex-start;
}
.menu-icon:hover { color: #000; }

.menue {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    height: 100dvh;
    width: min(320px, 88vw);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    padding: 10px 0 20px;
    box-sizing: border-box;
    background: #111;
    color: #eee;
    overflow-y: auto;
    text-align: left;
    /* Geschlossen steht sie links draußen. visibility verhindert, dass
       man mit der Tabulatortaste in ein unsichtbares Menü läuft; sie
       wird verzögert geschaltet, damit das Hinausgleiten sichtbar
       bleibt. */
    transform: translateX(-105%);
    visibility: hidden;
    transition: transform 0.25s ease, visibility 0s linear 0.25s;
    box-shadow: 2px 0 14px rgba(0, 0, 0, 0.4);
}
.menue.offen {
    transform: translateX(0);
    visibility: visible;
    transition: transform 0.25s ease, visibility 0s;
}

.menue-schleier {
    position: fixed;
    inset: 0;
    z-index: 999;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
.menue-schleier.offen { opacity: 1; pointer-events: auto; }

.menue-zu {
    align-self: flex-end;
    padding: 6px 16px;
    font-size: 26px;
    line-height: 1;
    color: #bbb;
    background: none;
    border: none;
    cursor: pointer;
}
.menue-zu:hover { color: #fff; }

.menue-inhalt {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.menue-gruppenname {
    margin: 16px 0 1px;
    padding: 0 22px;
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #666;
}

.menue-zeile {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 22px;
    font-size: 17px;
    color: #eee;
    text-decoration: none;
}
.menue-zeile:hover { background: #2a2a2a; color: #fff; }
.menue-zeile.hier { color: #7fbfff; }
.menue-zahl {
    flex-shrink: 0;
    font-size: 11px;
    color: #6f6f6f;
    white-space: nowrap;
}

.menue-beiwerk {
    display: flex;
    flex-wrap: wrap;
    gap: 3px 16px;
    margin-top: auto;
    padding: 16px 22px 0;
}
.menue-beiwerk a {
    font-size: 12px;
    color: #6a6a6a;
    text-decoration: none;
}
.menue-beiwerk a:hover { color: #fff; }
.menue-beiwerk a.hier { color: #7fbfff; }

img {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    height: auto;
    cursor: pointer;
}
footer {
    margin-top: 40px;
    text-align: center;
    color: #666;
}
footer a {
    color: #666;
    text-decoration: none;
}
footer a:hover {
    color: #333;
}
@media (max-width: 768px) {
    .container {
        width: 90%;
    }
}

/* Tabellen responsiv */
table {
    width: 100%;
    border-collapse: collapse;
}
th, td {
    border: 1px solid black;
    padding: 8px;
    text-align: left;
}
th { background-color: #f2f2f2; }
input[type="text"] { margin-bottom: 10px; padding: 5px; }
@media (max-width: 640px) {
    table { display: block; overflow-x: auto; }
}

/* Navigation-Listen */
ul {
    list-style-type: none;
    padding: 0;
    text-align: center;
}
li {
    display: inline-block;
    margin-right: 10px;
    font-size: 16px;
}
li a {
    text-decoration: none;
    color: #007bff;
    font-weight: bold;
    padding-left: 5px;
    padding-right: 5px;
}
li a:hover {
    color: #0056b3;
}

/* Netzwerk-Diagramm */
.network-wrapper {
    position: relative;
    width: 100%;
}
#mynetwork {
    width: 100%;
    height: 70vh;
    min-height: 420px;
    border: 1px solid lightgray;
    border-radius: 6px;
    background: #fff;
}
.legend {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: #fff;
    font-family: Arial, sans-serif;
    font-size: 14px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}
.legend > div:first-child {
    font-weight: bold;
}
.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}
.legend-box {
    width: 18px;
    height: 18px;
    border: 1px solid #333;
    border-radius: 3px;
}
/* Zeitleiste */
.timeline {
    margin-top: 18px;
    width: 100%;
}
.timeline h2 {
    margin: 0 0 12px;
}
.timeline-filter {
    margin: 8px 0 4px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.timeline-filter label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    background: #f7f7f7;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
}
.timeline-filter input {
    cursor: pointer;
}
.timeline-scroll {
    overflow-x: auto;
    padding-bottom: 10px;
    width: 100%;
}
.timeline-track {
    position: relative;
    --year-scale: 14px;
    --row-offset: 16px;
    width: calc((2026 - 1850) * var(--year-scale));
    min-width: 100%;
    border-top: 2px solid #ddd;
    padding-top: 34px;
    padding-bottom: 28px;
    height: 480px;
}
.timeline-bar {
    position: absolute;
    top: var(--row-offset);
    height: 22px;
    background: linear-gradient(90deg, #7fbfff, #3c7bd6);
    border-radius: 12px;
    color: #fff;
    font-size: 13px;
    line-height: 22px;
    padding: 0 10px;
    white-space: nowrap;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.timeline-bar.alt1 { background: linear-gradient(90deg, #f8c471, #d68910); }
.timeline-bar.alt2 { background: linear-gradient(90deg, #82e0aa, #27ae60); }
.timeline-bar.alt3 { background: linear-gradient(90deg, #bb8fce, #7d3c98); }
.timeline-bar.alt4 { background: linear-gradient(90deg, #f1948a, #c0392b); }
.timeline-marker {
    position: absolute;
    top: 0;
    width: 4px;
    height: 100%;
    background: rgba(220,50,47,0.95);
    border-radius: 2px;
}
.timeline-marker .label {
    position: absolute;
    left: -36px;
    width: 90px;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    color: #111;
    background: #fff;
    padding: 3px 6px;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
    border: 1px solid #e0e0e0;
}
.timeline-marker .label.bottom {
    bottom: 12px;
}
.timeline-marker .label.top {
    top: 12px;
}
.bar-event {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #dc3230;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.25);
    transform: translate(-50%, -6px);
    z-index: 6;
}
.bar-event .note {
    position: absolute;
    top: -6px;
    left: 14px;
    min-width: 38px;
    font-size: 12px;
    font-weight: 700;
    color: #111;
    text-align: center;
    background: #fff;
    padding: 2px 6px;
    border-radius: 5px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    white-space: nowrap;
    z-index: 7;
}
/* Hover-Highlight */
.timeline-bar:hover,
.timeline-marker:hover,
.bar-event:hover {
    box-shadow: 0 0 0 3px rgba(220,50,47,0.15), 0 2px 6px rgba(0,0,0,0.25);
    z-index: 10;
}
/* Fokus: andere ausblenden, aktuelles hervorheben */
.timeline-track.dim .bar-event,
.timeline-track.dim .timeline-marker {
    opacity: 0.12;
    transition: opacity 0.12s ease;
}
.timeline-track .bar-event.focus,
.timeline-track .timeline-marker.focus {
    opacity: 1 !important;
    z-index: 10;
}
.timeline-track .bar-event.focus .note,
.timeline-track .timeline-marker.focus .label {
    opacity: 1;
}
@media (max-width: 640px) {
    #mynetwork {
        height: 60vh;
        min-height: 320px;
    }
    .legend {
        font-size: 13px;
        gap: 6px 10px;
    }
    .timeline-track {
        --year-scale: 10px;
        width: calc((2026 - 1850) * var(--year-scale));
        height: 440px;
    }
    .timeline-bar {
        font-size: 12px;
        height: 20px;
        line-height: 20px;
        padding: 0 8px;
    }
    .timeline-marker .label {
        left: -24px;
        width: 64px;
    }
}
