body {
    font-family: Calibri, 'Segoe UI', Candara, Segoe, Optima, Arial, sans-serif;
    font-size: 18px; /* Oder 1.15rem für eine gute Lesbarkeit */
    line-height: 1.5; /* 1,5-facher Zeilenabstand */
}

/* Speziell für Fließtext-Absätze und Listen */
p, li {
    font-size: 1.1rem;
    line-height: 1.5;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
}

body {
    background-color: #f4f5f7;
    color: #333;
}

/* Header mit zentriertem Titel */
header {
    background-color: #708090;
    color: white;
    padding: 14px 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.logo {
    font-size: 22px;
    font-weight: bold;
    border: 2px solid white;
    padding: 4px 16px;
    border-radius: 12px 0 12px 0;
    cursor: pointer;
}

/* Pfadnavigation (Breadcrumb) */
.breadcrumb {
    background-color: #e9ecef;
    padding: 10px 24px;
    font-size: 12px;
    color: #555;
    border-bottom: 1px solid #ddd;
}

/* Haupt-Layout */
.main-container {
    display: flex;
    padding: 24px;
    gap: 24px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Inhaltsbereich (Links) */
.content {
    flex: 3;
    background: white;
    padding: 28px;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.content h1 {
    color: #708090;
    border-bottom: 2px solid #708090;
    padding-bottom: 8px;
    margin-bottom: 20px;
    font-size: 22px;
}

.content h3 {
    margin-top: 15px;
    margin-bottom: 8px;
    color: #222;
}

/* Hauptklasse für alle Infoboxen */
.info-box {
    background-color: #f8f9fa;
    border-left: 4px solid #708090;
    padding: 16px;
    margin-bottom: 24px;
    border-radius: 4px;
    font-size: 1.1rem;
    line-height: 1.5;
}

/* Schriftfarbe für die Überschrift in der Standard-Box */
.info-box h3 {
    color: #708090;
    margin-top: 0; /* Verhindert ungewollten Abstand nach oben */
}

/* Pink / Ziel */
.info-box.Ziel {
    background-color: #f6e8f8;
    border-left-color: #fa3bd7;
}
.info-box.Ziel h3 {
    color: #fa3bd7;
}
.info-box.Ziel h3::before {
    content: "🎯 ";
    margin-right: 6px;
}

/* Blau / Aufgabe */
.info-box.Aufgabe {
    background-color: #e8f4f8;
    border-left-color: #0b7ced;
}
.info-box.Aufgabe h3 {
    color: #0b7ced;
}
/* Aufgabe / Arbeitsauftrag */
.info-box.Aufgabe h3::before {
    content: "✏️ "; /* Alternativ: 📝 oder ⚙️ */
    margin-right: 6px;
}

/* Gelb / Think-Pair-Share */
.info-box.tps {
    background-color: #fef9e7;
    border-left-color: #f1c40f;
}
.info-box.tps h3 {
    color: #d4ac0d; /* Etwas dunkleres Gelb/Gold für bessere Lesbarkeit der Schrift */
}
.info-box.tps h3::before {
    content: "🧠👥💬 ";
    margin-right: 6px;
}

/* Rot / Sicherung */
.info-box.sicherung {
    background-color: #fadbd8;
    border-left-color: #e74c3c;
}
.info-box.sicherung h3 {
    color: #e74c3c;
}
/* Sicherung / Fazit */
.info-box.sicherung h3::before {
    content: "📌 "; /* Alternativ: 🔒 oder 💾 */
    margin-right: 6px;
}

/* Grau / Info */
.info-box.info {
    background-color: #f2f4f4;
    border-left-color: #7f8c8d;
}
.info-box.info h3 {
    color: #7f8c8d;
}
/* Information / Merkkasten */
.info-box.info h3::before {
    content: "💡 "; /* Alternativ: ℹ️ oder 📖 */
    margin-right: 6px;
}

/* Grün / Erfolg oder Tipp */
.info-box.success {
    background-color: #eafaf1;
    border-left-color: #2ecc71;
}
.info-box.success h3 {
    color: #2ecc71;
}

/* Grid-Karten auf Übersichtsseiten */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.card {
    background-color: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    color: inherit;
    display: block;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border-color: #708090;
}

.card h3 {
    color: #708090;
    margin-bottom: 10px;
}

/* Sidebar Navigation (Rechts) */
.sidebar {
    flex: 1;
    background: white;
    padding: 20px;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    font-size: 14px;
}

.sidebar-menu, .sub-menu {
    list-style: none;
}

.sidebar-menu > li {
    margin-bottom: 10px;
}

.sub-menu {
    margin-left: 15px;
    margin-top: 6px;
    border-left: 2px solid #e9ecef;
    padding-left: 12px;
    display: none;
}

.sub-menu.open {
    display: block;
}

.sub-menu li {
    margin-bottom: 6px;
}

.sidebar a, .menu-toggle {
    text-decoration: none;
    color: #495057;
    cursor: pointer;
    display: inline-block;
    padding: 4px 6px;
    border-radius: 3px;
    width: 100%;
}

.sidebar a:hover, .menu-toggle:hover {
    color: #708090;
    background-color: #f0f0f0;
}

.sidebar a.active-link, .menu-toggle.active-link {
    font-weight: bold;
    color: #708090;
    background-color: #e6f2f0;
}

.toggle-arrow {
    display: inline-block;
    font-size: 10px;
    margin-right: 6px;
    transition: transform 0.2s;
}

.toggle-arrow.open {
    transform: rotate(90deg);
}

.phase-badge {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
}
.bg-einstieg { background-color: #808080; }
.bg-erarbeitung { background-color: #2196F3; }
.bg-sicherung { background-color: #f44336; }
.bg-ha { background-color: #ff9800; }

/* Custom Boxes */
.custom-box {
    border: 2px solid #ffb703;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 24px;
    background-color: #ffffff;
}

.custom-box-header {
    background-color: #ffb703;
    color: #000000;
    padding: 10px 16px;
    font-weight: bold;
    font-size: 16px;
}

.custom-box-body {
    padding: 16px;
    line-height: 1.5;
}

.box-yellow { border-color: #ffc107; }
.box-yellow .custom-box-header { background-color: #ffc107; color: #000; }

/* Mathe-Tabellen */
.math-table-wrapper {
    overflow-x: auto;
    margin: 15px 0;
}

.math-table {
    width: 100%;
    border-collapse: collapse;
    text-align: center;
}

.math-table th, .math-table td {
    border: 1px solid #999;
    padding: 8px;
    text-align: center;
    vertical-align: middle;
}

.math-table th { background-color: #e0e0e0; font-weight: bold; }

.math-table input {
    width: 100%;
    max-width: 60px;
    padding: 6px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background-color: #eee;
    text-align: center;
    font-weight: bold;
    color: #888;
}

.math-table input:focus {
    background-color: #fff;
    color: #333;
    outline: 2px solid #708090;
}

.pdf-container {
    width: 100%;
    height: 80vh;
    margin: 15px 0;
    border: 1px solid #ccc;
    border-radius: 6px;
    overflow: hidden;
}

/* ==========================================
   RESPONSIVE DESIGN (iPad & iPhone)
   ========================================== */

@media screen and (max-width: 992px) {
    .main-container {
        flex-direction: column;
        padding: 12px;
        gap: 16px;
    }

    .content, .sidebar {
        width: 100%;
    }

    .image-gallery {
        flex-wrap: wrap;
    }
    
    .image-gallery img {
        width: calc(50% - 5px) !important;
        height: 140px !important;
    }
}

@media screen and (max-width: 600px) {
    header { padding: 10px 16px; }
    .logo { font-size: 18px; }
    .content { padding: 16px; }

    .image-gallery img {
        width: 100% !important;
        height: auto !important;
    }

    .pdf-container { height: 50vh; }
}

/* Ausblenden der Schritte, die gerade nicht aktiv sind */
.einstieg-step {
    display: none;
}

.einstieg-step.active {
    display: block;
}

/* Styling der Navigation-Buttons unten */
.step-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    padding-top: 15px;
    border-top: 2px solid #e9ecef;
}

.step-navigation button {
    background-color: #708090;
    color: white;
    border: none;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.step-navigation button:hover:not(:disabled) {
    background-color: #125699;
}

.step-navigation button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

#step-indicator {
    font-weight: bold;
    color: #666;
    font-size: 14px;
}

/* Flexible Bildergalerie */
.image-gallery {
    display: flex;
    gap: 15px;
    width: 100%;
    margin-bottom: 20px;
}

.image-gallery img {
    width: 25%;
    height: auto; /* Höhe passt sich automatisch im richtigen Seitenverhältnis an */
    object-fit: contain; /* Verhindert das Zerschneiden der Bilder */
    border-radius: 6px;
}

/* Anpassung für schmale Bildschirme */
@media screen and (max-width: 992px) {
    .image-gallery {
        flex-wrap: wrap;
    }
    
    .image-gallery img {
        width: calc(50% - 10px); /* 2 Bilder nebeneinander */
    }
}

@media screen and (max-width: 600px) {
    .image-gallery img {
        width: 100%; /* 1 Bild pro Zeile untereinander */
    }
}

/* Standardmäßig ist der Hamburger-Button auf Desktop-Bildschirmen versteckt */
.mobile-menu-btn {
    display: none;
    background: transparent;
    border: 2px solid white;
    color: white;
    font-size: 20px;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
}

/* Anpassungen für Tablet & Smartphone (unter 992px) */
@media screen and (max-width: 992px) {
    header {
        justify-content: space-between; /* Logo links, Menü-Button rechts */
    }

    .mobile-menu-btn {
        display: block; /* Button auf Mobilgeräten anzeigen */
    }

    /* Sidebar standardmäßig ausblenden */
    .sidebar {
        display: none;
        width: 100%;
    }

    /* Wird per JavaScript aktiviert, wenn man auf ☰ klickt */
    .sidebar.mobile-open {
        display: block;
    }
}

@media screen and (max-width: 992px) {
    header {
        justify-content: space-between;
        position: relative;
        z-index: 1001;
    }

    .mobile-menu-btn {
        display: block;
    }

    /* Der Hauptcontainer muss als Bezugspunkt dienen */
    .main-container {
        position: relative;
        flex-direction: column;
        padding: 12px;
    }

    /* Die Sidebar schwebt jetzt über dem Inhalt */
    .sidebar {
        display: none;
        position: absolute;
        top: 10px;
        right: 12px;
        left: 12px; /* Erstreckt sich über die gesamte Breite */
        width: auto;
        z-index: 1000;
        box-shadow: 0 10px 25px rgba(0,0,0,0.2);
        border: 1px solid #ddd;
    }

    /* Wenn das Menü aktiv ist, wird es eingeblendet */
    .sidebar.mobile-open {
        display: block;
    }
}

.mobile-menu-btn {
    z-index: 1002; /* Bleibt immer über allen Inhalten anklickbar */
}

.breadcrumb a {
    color: #708090;
    text-decoration: none;
    font-weight: bold;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* Styling für klickbare Pfadnavigation */
.breadcrumb a {
    color: #708090;
    text-decoration: none;
    font-weight: bold;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* Sicherstellen, dass der Hamburger-Button auf Mobilgeräten anklickbar ist */
.mobile-menu-btn {
    z-index: 1002;
    position: relative;
}

/* ==========================================
   RESPONSIVE DESIGN (Fix für Bilder & Menü)
   ========================================== */

@media screen and (max-width: 992px) {
    header {
        justify-content: space-between;
        position: relative;
        z-index: 1001;
    }

    .mobile-menu-btn {
        display: block;
        z-index: 1002;
    }

    .main-container {
        position: relative;
        flex-direction: column;
        padding: 12px;
    }

    /* Die Sidebar schwebt als Overlay */
    .sidebar {
        display: none;
        position: absolute;
        top: 10px;
        right: 12px;
        left: 12px;
        width: auto;
        z-index: 1000;
        box-shadow: 0 10px 25px rgba(0,0,0,0.2);
        border: 1px solid #ddd;
    }

    .sidebar.mobile-open {
        display: block;
    }

    /* Bild-Fix: Verhindert das Rausragen aus dem weißen Kasten */
    .image-gallery {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        width: 100%;
    }

    .image-gallery img {
        width: calc(50% - 5px) !important; /* Exakt 2 Bilder pro Zeile */
        height: auto !important;          /* Automatische Höhe verhindert Überlappen */
        object-fit: contain;
    }
}

@media screen and (max-width: 600px) {
    .image-gallery img {
        width: 100% !important; /* 1 Bild pro Zeile auf Smartphones */
        height: auto !important;
    }
}

/* Galerie-Container auf die Breite des Eltern-Elementes begrenzen */
.image-gallery {
    display: flex;
    flex-wrap: wrap; /* Bricht Bilder in die nächste Zeile um, wenn der Platz nicht reicht */
    gap: 12px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin-bottom: 20px;
}

/* Jedes Bild nimmt flexibel Platz ein, ohne den Kasten zu sprengen */
.image-gallery img {
    flex: 1 1 calc(25% - 12px); /* 4 Bilder pro Zeile bei genug Platz */
    min-width: 120px;            /* Mindestbreite, bevor umgebrochen wird */
    max-width: 100%;
    height: auto;               /* Erhält das Seitenverhältnis */
    object-fit: contain;
    border-radius: 6px;
}

/* Auf kleineren Bildschirmen (Tablets) automatisch 2 Bilder pro Zeile */
@media screen and (max-width: 992px) {
    .image-gallery img {
        flex: 1 1 calc(50% - 12px);
    }
}

/* Auf Smartphones 1 Bild pro Zeile */
@media screen and (max-width: 600px) {
    .image-gallery img {
        flex: 1 1 100%;
    }
}

.pdf-placeholder {
    width: 100%;
    height: 400px;
    background-color: #e9ecef;
    border: 2px dashed #6c757d;
    border-radius: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #6c757d;
    font-size: 18px;
    font-weight: bold;
}

.pdf-container {
    width: 100%;
    margin: 20px 0;
}

/* Das Styling für den Platzhalter und den PDF-Container */
.pdf-placeholder {
    width: 100%;
    height: 600px; /* Höhe des PDF-Betrachters */
    background-color: #e9ecef;
    border: 2px dashed #6c757d;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #6c757d;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
}

/* Der äußere Container füllt den verfügbaren Platz aus */
.pdf-container {
    width: 100%;
    height: 70vh; /* Feste Gesamthöhe für den Bereich */
    margin: 20px 0;
}

/* Das object-Element nimmt exakt 100% der Containerhöhe ein */
.pdf-placeholder {
    width: 100%;
    height: 100%;
    background-color: #e9ecef;
    border: 2px dashed #6c757d;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #6c757d;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    box-sizing: border-border;
}

.fraction {
    display: inline-flex;
    flex-direction: column;
    vertical-align: middle;
    text-align: center;
    font-size: 0.9em;
    padding: 0 4px;
}

.numerator {
    border-bottom: 2px solid currentColor;
    padding-bottom: 2px;
    line-height: 1;
}

.denominator {
    padding-top: 2px;
    line-height: 1;
}

/* Generell für div-Boxen, Infoboxen oder spezielle Container */
div, .box, .container, .card {
    font-size: 1.1rem; /* Bzw. 18px */
    line-height: 1.5;
}

/* Falls Tabellen-Boxen verwendet werden */
table, td, th {
    font-size: 1.1rem;
    line-height: 1.5;
}

/* Falls Eingabefelder oder Code-Blöcke in Boxen zu klein sind */
input, textarea, select, code, pre {
    font-size: 1rem;
    line-height: 1.5;
}

/* Innenabstand für geordnete und ungeordnete Listen in Infoboxen */
.info-box ol, 
.info-box ul {
    padding-left: 24px; /* Rückt die Nummerierung weiter nach rechts */
    margin-top: 8px;    /* Optional: Angenehmer Abstand zum Text darüber */
    margin-bottom: 12px;/* Optional: Angenehmer Abstand zum Text darunter */
}

.hanoi-applet {
            background: #ffffff;
            border: 1px solid #e2e8f0;
            border-radius: 8px;
            padding: 20px;
            text-align: center;
            user-select: none;
            touch-action: none;
            margin: 15px 0;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
        }
        .hanoi-controls {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 12px;
            flex-wrap: wrap;
            margin-bottom: 15px;
        }
        .hanoi-controls button, .hanoi-controls select {
            padding: 8px 14px;
            font-size: 14px;
            border-radius: 6px;
            border: 1px solid #CBD5E0;
            background: #fff;
            cursor: pointer;
        }
        .hanoi-controls button:hover { background: #EDF2F7; }
        .hanoi-controls button:disabled { opacity: 0.5; cursor: not-allowed; }
        .hanoi-stats {
            font-weight: bold;
            font-size: 1.1em;
            margin-bottom: 10px;
            color: #2d3748;
        }
        .hanoi-container {
            display: flex;
            justify-content: space-around;
            align-items: flex-end;
            height: 240px;
            margin: 0 auto;
            max-width: 600px;
            position: relative;
        }
        .hanoi-tower {
            width: 30%;
            height: 200px;
            border-bottom: 10px solid #4A5568;
            position: relative;
            display: flex;
            flex-direction: column-reverse;
            align-items: center;
        }
        .hanoi-tower::before {
            content: '';
            position: absolute;
            bottom: 0;
            width: 10px;
            height: 180px;
            background: #4A5568;
            z-index: 0;
            border-radius: 4px 4px 0 0;
        }
        .hanoi-disk {
            height: 24px;
            border-radius: 6px;
            z-index: 1;
            margin-bottom: 2px;
            box-shadow: 0 2px 4px rgba(0,0,0,0.2);
            touch-action: none;
            position: relative;
        }
        .hanoi-disk.dragging {
            opacity: 0.85;
            z-index: 1000;
            position: fixed;
            pointer-events: none;
        }
        .hanoi-status {
            margin-top: 15px;
            font-style: italic;
            color: #4a5568;
        }