/**
 * chemie9.css - Zentrale Stylesheet-Datei für Chemie Klasse 9
 *
 * Konsolidiert alle CSS-Regeln für Chemie Klasse 9:
 * - saeuren, basen, rechnen (Titration, Stöchiometrie)
 *
 * Folgt dem Muster von chemie10.css gemäß CLAUDE.md
 */

/* ===========================
   CSS VARIABLES (Farbschema)
   =========================== */
:root {
    /* Blaue Töne (Hauptfarbe für Chemie - wie Mathe) */
    --blue-light-1: #85c1e9;
    --blue-light-2: #5dade2;
    --blue-medium-1: #3498db;
    --blue-medium-2: #2980b9;
    --blue-dark-1: #1e3c72;
    --blue-dark-2: #154360;
    --blue-light-bg: #e8f4f8;
    --blue-medium-bg: #d6eaf8;
    --blue-dark-bg: #aed6f1;

    /* Grüne Töne (für spezielle Elemente) */
    --chem-green-1: #4CAF50;
    --chem-green-2: #45a049;
    --chem-green-3: #388e3c;
    --chem-green-bg: rgba(76, 175, 80, 0.1);

    /* Akzentfarben */
    --chem-orange-1: #ff9800;
    --chem-orange-2: #ef6c00;
    --chem-yellow-1: #ffc107;
    --chem-red-1: #f44336;
    --chem-red-2: #c62828;

    /* Neutrale Farben */
    --chem-gray-light: #f9f9f9;
    --chem-gray-medium: #f5f5f5;
    --chem-gray-border: #ddd;
    --chem-text-dark: #2c3e50;
    --chem-text-medium: #666;
}

/* ===========================
   MATHJAX FONT HANDLING
   =========================== */
/* Ensure MathJax uses correct fonts, not Poppins from body */
mjx-container {
    font-family: MJXZERO, MJXTEX-I, MJXTEX, MJXTEX-C, MJXTEX-S2, MJXTEX-S3, MJXTEX-S4, MJXTEX-A, MJXTEX-B, MJXTEX-S1, serif !important;
}

mjx-container * {
    font-family: inherit;
}

/* ===========================
   HERO-BEREICH
   =========================== */
.hero {
    position: relative;
    overflow: hidden;
    padding: 60px 30px;
    background: linear-gradient(135deg, #88c4ff 0%, #c2e9fb 100%);
    border-radius: 15px;
    margin-bottom: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.hero h1:not(.display-4) {
    font-size: 2.8rem;
    margin-bottom: 20px;
}

.hero h1 {
    color: #1e3c72;
    position: relative;
    z-index: 2;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    z-index: 2;
}

/* Hintergrund-Elemente für Hero */
.bg-element,
.nomenklatur-element-1,
.nomenklatur-element-2,
.nomenklatur-element-3,
.chem-element-1,
.chem-element-2,
.chem-element-3 {
    position: absolute;
    opacity: 0.1;
    z-index: 1;
    font-size: 100px;
    color: #1e3c72;
}

.nomenklatur-element-1,
.chem-element-1 {
    top: 20px;
    right: 50px;
    transform: rotate(15deg);
}

.nomenklatur-element-2,
.chem-element-2 {
    bottom: 20px;
    left: 60px;
    transform: rotate(-10deg);
    font-size: 120px;
}

.nomenklatur-element-3,
.chem-element-3 {
    top: 70px;
    left: 30%;
    transform: rotate(5deg);
    font-size: 150px;
    opacity: 0.05;
}

/* ===========================
   CONTENT SECTIONS
   =========================== */
.content-section,
.nomenklatur-content,
.nomenklatur-section {
    background-color: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 40px;
}

.nomenklatur-section {
    border: 1px solid #c2e9fb;
}

.content-section h2,
.nomenklatur-section h2 {
    color: var(--blue-dark-1);
    margin-top: 30px;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 3px solid var(--blue-medium-1);
    font-weight: 600;
}

.content-section h2:first-of-type {
    margin-top: 0;
}

.content-section h3 {
    color: var(--blue-dark-1);
    margin-top: 25px;
    margin-bottom: 15px;
    font-weight: 600;
    font-size: 1.5rem;
}

.content-section h4 {
    color: var(--blue-medium-2);
    margin-top: 20px;
    margin-bottom: 12px;
    font-weight: 600;
    font-size: 1.2rem;
}

.content-section p,
.nomenklatur-section p {
    font-size: 1.1rem;
    margin-bottom: 20px;
    line-height: 1.8;
}

/* ===========================
   MOLECULE CONTAINERS
   =========================== */
.molecule-container {
    display: flex;
    gap: 20px;
    margin: 20px 0 60px 0;
    flex-wrap: wrap;
    justify-content: center;
    position: relative;
    width: 100%;
    clear: both;
}

.molecule-container::after {
    content: "";
    display: table;
    clear: both;
}

.molecule-item {
    border: 1px solid var(--chem-gray-border);
    padding: 15px 15px 60px 15px;
    border-radius: 5px;
    background-color: var(--chem-gray-light);
    width: 250px;
    min-height: 300px;
    text-align: center;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.molecule-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.molecule-item h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: var(--chem-text-dark);
}

.molecule-item p {
    color: var(--chem-text-medium);
    font-size: 0.9em;
    margin-bottom: 15px;
}

/* Molecule Groups */
.molecule-groups-container {
    margin: 30px 0;
}

.molecule-group {
    margin-bottom: 50px;
}

.molecule-group h3 {
    color: #1e3c72;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.molecule-items {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

/* Molecule Models */
.molecule-models {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    margin: 30px 0 60px 0;
    gap: 20px;
    width: 100%;
    clear: both;
}

.molecule-models::after {
    content: "";
    display: table;
    clear: both;
}

.molecule-model {
    text-align: center;
    margin: 15px;
    padding: 15px 15px 60px 15px;
    background-color: var(--chem-gray-medium);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    width: 220px;
    min-height: 280px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
}

.molecule-model:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.15);
}

.molecule-model h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.1em;
    width: 100%;
    color: var(--chem-text-dark);
}

.molecule-model-label {
    margin-top: 10px;
    font-weight: bold;
}

/* Molecule Display */
.molecule-display {
    background-color: var(--chem-gray-light);
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
}

.molecule-image {
    margin: 0 auto;
    max-width: 400px;
    padding: 15px;
}

.molecule-caption {
    font-style: italic;
    margin-top: 10px;
    color: var(--chem-text-medium);
}

.molecule-name {
    font-weight: bold;
    margin-top: 10px;
    color: #1e3c72;
}

.molecule-formula {
    color: var(--chem-text-medium);
    font-size: 0.9rem;
    margin-top: 5px;
}

/* ===========================
   CHEMDOODLE INTEGRATION
   =========================== */
/* Canvas-Stile */
.view-2d,
.view-3d {
    width: 200px;
    height: 200px;
    margin: 0 auto 15px auto;
    display: block;
}

/* Canvas-Zentrierung in Taskcards */
.task-card .card-body canvas {
    margin-left: auto;
    margin-right: auto;
    display: block;
}

/* Molekül-Canvas-Container mit Rahmen */
.molecule-canvas-container {
    border: 2px solid var(--blue-light-2);
    border-radius: 8px;
    padding: 15px;
    background: linear-gradient(135deg, #ffffff 0%, var(--blue-light-bg) 100%);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: inline-block;
    margin: 0 auto;
}

.view-3d {
    display: none;
}

.canvas-wrapper {
    width: 100%;
    position: relative;
}

.canvas-container {
    width: 100%;
    max-width: 800px;
    position: relative;
    margin: 20px auto;
    clear: both;
    overflow: visible;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.molecule-canvas {
    width: 220px;
    height: 220px;
    margin: 0 auto 15px auto;
    display: block;
}

/* Toggle Button für 2D/3D Ansicht */
.btn-toggle {
    background-color: var(--blue-medium-1);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    padding: 8px 15px;
    min-width: 150px;
    font-size: 14px;
    line-height: 1.5;
    text-align: center;
    white-space: nowrap;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 15px;
    z-index: 100;
    transition: background-color 0.3s;
}

.btn-toggle:hover {
    background-color: var(--blue-medium-2);
}

/* ===========================
   NOMENKLATUR-BEISPIELE
   =========================== */
.nomenklatur-examples {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    margin: 20px 0 40px 0;
    width: 100%;
}

.nomenklatur-examples::after {
    content: "";
    display: table;
    clear: both;
}

.nomenklatur-example {
    margin: 10px;
    padding: 15px;
    background: linear-gradient(135deg, #ffffff 0%, var(--blue-light-bg) 100%);
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    border: 2px solid var(--blue-light-2);
    width: 240px;
    text-align: center;
    min-height: 250px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.nomenklatur-example h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: var(--blue-dark-1);
    font-weight: 600;
}

.nomenklatur-example .formula {
    margin-bottom: 15px;
}

/* ===========================
   PROPERTIES & REACTIONS
   =========================== */
.properties-examples {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    margin: 20px 0 40px 0;
    width: 100%;
}

.properties-examples::after {
    content: "";
    display: table;
    clear: both;
}

.property-example {
    margin: 10px;
    padding: 15px;
    background-color: #f8f8f8;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    width: 280px;
    text-align: center;
    min-height: 250px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

/* Reaction Examples */
.reaction-examples {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin: 20px 0 40px 0;
    width: 100%;
}

.reaction-example {
    margin: 15px;
    padding: 20px;
    background-color: #f0f8ff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 450px;
    box-sizing: border-box;
}

.reaction-example h3,
.reaction-example h4 {
    color: var(--chem-blue-1);
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.reaction-example .formula {
    background-color: #fff;
    padding: 15px;
    border-radius: 6px;
    margin: 20px 0;
    text-align: center;
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    display: block;
    min-height: 50px;
    font-size: 1.2em;
}

.reaction-item {
    margin: 15px;
    padding: 15px 15px 60px 15px;
    background-color: #f8fff8;
    border: 1px solid var(--chem-gray-border);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    width: 320px;
    text-align: center;
    min-height: 280px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    float: left;
}

.reaction-arrow {
    font-size: 1.5em;
    margin: 0 10px;
    color: #555;
    vertical-align: middle;
}

/* ===========================
   CONTENT BOXES
   =========================== */
/* Info Box */
.info-box {
    background-color: var(--chem-blue-light);
    border-left: 5px solid var(--chem-blue-1);
    padding: 20px;
    margin: 20px 0;
    border-radius: 5px;
}

.info-box h3,
.info-box h4 {
    color: var(--chem-blue-2);
    margin-top: 0;
    margin-bottom: 10px;
}

/* Example Box */
.example-box {
    background: linear-gradient(135deg, #ffffff 0%, var(--blue-light-bg) 100%);
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    border-left: 5px solid var(--blue-medium-1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.example-box h4 {
    color: var(--blue-dark-1);
    margin-top: 0;
    font-size: 1.1em;
    font-weight: 600;
}

.example-title {
    color: var(--blue-dark-1);
    margin-top: 0;
    font-size: 1.1em;
    font-weight: 600;
}

/* Hint Box (Dark Blue for Important Notes) */
.hint-box {
    background: linear-gradient(135deg, var(--blue-dark-bg) 0%, #1a4d7a 100%);
    border-left: 4px solid var(--blue-dark-1);
    padding: 20px;
    margin: 20px 0;
    border-radius: 0 8px 8px 0;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(30, 60, 114, 0.2);
}

.hint-box h4 {
    margin-top: 0;
    color: #ffffff;
    font-weight: 600;
}

.hint-box strong {
    color: #ffffff;
}

.hint-box p {
    color: #e8f4f8;
    margin-bottom: 0;
}

.hint-box ul {
    margin-bottom: 0;
    color: #e8f4f8;
}

/* MathJax-Formeln in hint-box sollen weiß sein */
.hint-box mjx-container,
.hint-box mjx-container * {
    color: #ffffff !important;
}

/* Warning/Attention Box */
.warning-box,
.attention {
    background-color: #fff8e1;
    border-left: 5px solid var(--chem-yellow-1);
    padding: 20px;
    margin: 20px 0;
    border-radius: 5px;
}

.warning-box h3,
.attention h3 {
    margin-top: 0;
    color: var(--chem-orange-2);
}

.attention i {
    margin-right: 8px;
}

/* Tip Box */
.tip-box {
    background-color: var(--blue-light-bg);
    border-left: 5px solid var(--blue-medium-1);
    padding: 20px;
    margin: 20px 0;
    border-radius: 5px;
}

.tip-box h3,
.tip-box h4 {
    color: var(--blue-dark-1);
    margin-top: 0;
}

/* Result Box */
.result-box {
    background-color: var(--blue-light-bg);
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    border-left: 4px solid var(--blue-medium-1);
}

/* Important Box */
.important-box {
    background-color: #ffebee;
    border-left: 5px solid var(--chem-red-1);
    padding: 15px;
    margin: 20px 0;
    border-radius: 0 8px 8px 0;
}

.important-box h4 {
    margin-top: 0;
    color: var(--chem-red-2);
}

/* ===========================
   FORMULA BOX & TABLES
   =========================== */
.formula-box {
    background-color: var(--blue-light-bg);
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    overflow-x: auto;
    border-left: 4px solid var(--blue-medium-1);
}

.formula-box h3,
.formula-box h4 {
    margin-top: 0;
    color: var(--blue-dark-1);
    font-weight: 600;
}

.formula-box table {
    width: 100%;
    border-collapse: collapse;
}

.formula-box th,
.formula-box td {
    padding: 10px;
    text-align: center;
    border: 1px solid var(--chem-gray-border);
}

.formula-box th {
    background-color: #f0f0f0;
}

.formula-box tr:nth-child(even) {
    background-color: var(--chem-gray-light);
}

.formula {
    font-size: 1.1em;
    text-align: center;
}

/* Comparison Table */
.comparison-table {
    overflow-x: auto;
    margin: 20px 0;
}

.comparison-table table {
    width: 100%;
    border-collapse: collapse;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.comparison-table th,
.comparison-table td {
    padding: 12px;
    text-align: center;
    border: 1px solid var(--chem-gray-border);
}

.comparison-table th {
    background-color: #e8eaf6;
    color: #3f51b5;
}

.comparison-table tr:nth-child(even) {
    background-color: var(--chem-gray-medium);
}

.comparison-table tr:hover {
    background-color: #f0f4c3;
}

/* pKs Table */
.pks-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.pks-table th,
.pks-table td {
    border: 1px solid var(--chem-gray-border);
    padding: 10px;
    text-align: center;
}

.pks-table th {
    background-color: var(--blue-medium-1);
    color: white;
}

.pks-table tr:nth-child(even) {
    background-color: var(--chem-gray-medium);
}

.pks-table tr:hover {
    background-color: #e9f7e9;
}

/* ===========================
   INTERACTIVE ELEMENTS
   =========================== */
.interactive-section {
    background: linear-gradient(135deg, var(--blue-light-bg) 0%, var(--blue-medium-bg) 100%);
    padding: 25px;
    border-radius: 10px;
    margin: 30px 0;
    border: 1px solid var(--blue-light-2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.interactive-section h3 {
    margin-top: 0;
    color: var(--blue-dark-1);
    font-weight: 600;
    border-bottom: 2px solid var(--blue-medium-1);
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.controls-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
    margin: 15px 0;
}

.demo-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
}

.form-control {
    padding: 8px 12px;
    border: 1px solid var(--chem-gray-border);
    border-radius: 4px;
    font-size: 14px;
    min-width: 150px;
}

.cta-button {
    background-color: var(--blue-medium-1);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 20px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.cta-button:hover {
    background-color: var(--blue-medium-2);
}

/* ===========================
   CHALLENGE & QUIZ
   =========================== */
.challenge-section {
    background-color: #f0f7ff;
    padding: 30px;
    border-radius: 10px;
    margin: 40px 0;
    border: 1px solid #88c4ff;
    text-align: center;
}

.challenge-section h3 {
    color: #1e3c72;
    margin-top: 0;
    margin-bottom: 20px;
}

.challenge-options {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.challenge-area {
    max-width: 900px;
    margin: 0 auto;
    padding: 30px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.challenge-question {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.question-number {
    flex: 0 0 30px;
    font-weight: bold;
    font-size: 1.2rem;
    color: #1e3c72;
}

.challenge-molecule {
    flex: 0 0 220px;
    margin: 0 20px;
}

.challenge-answer {
    flex: 1;
    text-align: left;
}

.answer-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #c2e9fb;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.answer-input:focus {
    border-color: #1e3c72;
    outline: none;
    box-shadow: 0 0 0 3px rgba(30, 60, 114, 0.2);
}

.answer-input.correct {
    border-color: var(--chem-green-1);
    background-color: #f1f8e9;
}

.answer-input.incorrect {
    border-color: var(--chem-red-1);
    background-color: #ffebee;
}

.result-indicator {
    display: inline-block;
    margin-left: 10px;
    font-weight: bold;
    font-size: 1.2rem;
}

.result-indicator.correct {
    color: var(--chem-green-1);
}

.result-indicator.incorrect {
    color: var(--chem-red-1);
}

#challenge-results {
    margin-top: 30px;
    padding: 20px;
    border-radius: 8px;
    background-color: #f0f7ff;
    text-align: center;
}

#challenge-results h4 {
    color: #1e3c72;
    margin-top: 0;
    margin-bottom: 10px;
}

/* Quiz Container */
.quiz-container {
    background: linear-gradient(135deg, var(--blue-light-bg) 0%, #ffffff 100%);
    padding: 25px;
    border-radius: 10px;
    margin: 20px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 2px solid var(--blue-light-2);
}

.quiz-question {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid var(--blue-medium-1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.quiz-question h3 {
    font-size: 1.1rem;
    color: var(--blue-dark-1);
    margin-bottom: 15px;
    font-weight: 600;
}

.quiz-options {
    margin-top: 10px;
    padding-left: 20px;
    margin-left: 20px;
}

.quiz-options label {
    display: block;
    margin-bottom: 10px;
    cursor: pointer;
}

.quiz-options input[type="radio"] {
    margin-right: 10px;
}

.quiz-results {
    display: none;
    background-color: #e8f5e9;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
}

.correct {
    color: var(--chem-green-1);
    font-weight: bold;
}

.incorrect {
    color: var(--chem-red-1);
    font-weight: bold;
}

/* ===========================
   DIFFICULTY FILTERS
   =========================== */
.difficulty-filters {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.difficulty-filter {
    padding: 8px 15px;
    background-color: #f0f7ff;
    border: 1px solid #88c4ff;
    color: #1e3c72;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.difficulty-filter:hover {
    background-color: #d0e8ff;
}

.difficulty-filter.active {
    background-color: #1e3c72;
    color: white;
}

.difficulty-indicator {
    display: inline-block;
    margin-left: 15px;
    vertical-align: middle;
}

.difficulty-level {
    font-size: 0.85rem;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: normal;
}

.difficulty-0 {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.difficulty-1 {
    background-color: #fff8e1;
    color: var(--chem-orange-1);
}

.difficulty-2 {
    background-color: #ffebee;
    color: var(--chem-red-2);
}

/* ===========================
   HIGHLIGHT LINKS
   =========================== */
.highlight-link {
    display: flex;
    background-color: var(--chem-gray-medium);
    border-radius: 8px;
    margin: 30px 0;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.highlight-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
    background-color: var(--chem-blue-light);
}

.highlight-link i {
    font-size: 36px;
    color: var(--chem-blue-1);
    margin-right: 20px;
    display: flex;
    align-items: center;
}

.highlight-link-content {
    flex: 1;
}

.highlight-link-content h3 {
    margin-top: 0;
    color: var(--chem-blue-1);
}

.highlight-link-content a {
    display: inline-block;
    margin-top: 10px;
    color: var(--chem-blue-1);
    text-decoration: none;
    font-weight: bold;
}

.highlight-link-content a:hover {
    text-decoration: underline;
}

/* ===========================
   SPECIAL SECTIONS
   =========================== */
/* Experimental Section */
.experimental-section {
    background-color: #f5f8ff;
    border-radius: 10px;
    padding: 20px;
    margin: 30px 0;
    border: 1px solid #dde4f0;
}

.experimental-section h3 {
    color: var(--chem-blue-2);
    margin-top: 0;
}

/* Conductivity Demo */
.conductivity-demo {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #f0f8ff;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.conductivity-visualization {
    background-color: #f0f0f0;
    border-radius: 10px;
    padding: 15px;
    margin: 20px 0;
    min-height: 300px;
    position: relative;
}

/* Dimers Section */
.dimers-section {
    background-color: #f0f9ff;
    border-radius: 8px;
    padding: 20px;
    margin: 30px 0;
    border: 1px solid #c2e0ff;
}

.dimers-illustration {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    margin: 20px 0;
}

/* Reaction Animation */
.reaction-animation {
    position: relative;
    width: 100%;
    height: 300px;
    background-color: var(--chem-gray-light);
    border-radius: 8px;
    overflow: hidden;
    margin: 20px 0;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
}

/* Hydrogen Bonds Highlight */
.h-bonds-highlight {
    border: 2px dashed var(--chem-blue-1);
    border-radius: 8px;
    padding: 5px;
    margin: 5px 0;
    display: inline-block;
}

/* Boiling Point Chart */
.boiling-point-chart {
    width: 100%;
    max-width: 700px;
    margin: 20px auto;
    border: 1px solid var(--chem-gray-border);
    border-radius: 8px;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
    background-color: #fff;
}

/* Image Placeholder */
.image-placeholder {
    text-align: center;
    margin: 15px auto;
    max-width: 100%;
}

.dimer-image {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.image-caption {
    font-style: italic;
    margin-top: 10px;
    color: var(--chem-text-medium);
    font-size: 0.9em;
}

/* ===========================
   KEY POINTS LIST
   =========================== */
.key-points {
    background-color: #f9fbe7;
    padding: 15px 15px 15px 35px;
    border-radius: 8px;
    margin: 20px 0;
    border-left: 4px solid #cddc39;
}

.key-points li {
    margin-bottom: 10px;
}

.key-points li:last-child {
    margin-bottom: 0;
}

/* ===========================
   TOPIC CARDS
   =========================== */
.topic-cards {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    margin: 25px 0;
    gap: 20px;
}

.topic-card {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.topic-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* ===========================
   UTILITY CLASSES
   =========================== */
.clearfix::after {
    content: "";
    display: table;
    clear: both;
}

.hidden {
    display: none !important;
}

/* ===========================
   MATHJAX ADJUSTMENTS
   =========================== */
.MathJax_Display {
    overflow-x: auto !important;
    overflow-y: hidden !important;
}

.MathJax {
    display: inline-block !important;
}

/* ===========================
   CARD STYLES (like mathe10)
   =========================== */
.task-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    border: none;
}

.task-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(30, 60, 114, 0.2);
}

.task-card .card-header {
    padding: 1rem 1.25rem;
    border-bottom: none;
}

/* ===========================
   BUTTON STYLES (Blue theme - wie Mathe)
   =========================== */
.btn-mathe {
    background: linear-gradient(135deg, var(--blue-medium-1) 0%, var(--blue-medium-2) 100%) !important;
    color: white !important;
    border: none !important;
    transition: all 0.3s ease;
    padding: 0.5rem 1.5rem;
    font-weight: 500;
}

.btn-mathe:hover {
    background: linear-gradient(135deg, var(--blue-medium-2) 0%, var(--blue-dark-1) 100%) !important;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

.btn-mathe-light {
    background: linear-gradient(135deg, var(--blue-light-1) 0%, var(--blue-light-2) 100%) !important;
    color: white !important;
    border: none !important;
    transition: all 0.3s ease;
    padding: 0.5rem 1.5rem;
    font-weight: 500;
}

.btn-mathe-light:hover {
    background: linear-gradient(135deg, var(--blue-light-2) 0%, var(--blue-medium-1) 100%) !important;
    transform: translateY(-2px);
}

.btn-mathe-dark {
    background: linear-gradient(135deg, var(--blue-dark-1) 0%, var(--blue-dark-2) 100%) !important;
    color: white !important;
    border: none !important;
    transition: all 0.3s ease;
    padding: 0.5rem 1.5rem;
    font-weight: 500;
}

.btn-mathe-dark:hover {
    background: linear-gradient(135deg, var(--blue-dark-2) 0%, #0d2137 100%) !important;
    transform: translateY(-2px);
}

/* ===========================
   BADGE STYLES (Blue theme - wie Mathe)
   =========================== */
.badge-easy {
    background-color: var(--blue-light-2) !important;
    color: white !important;
    padding: 0.25rem 0.75rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.badge-medium {
    background-color: var(--blue-medium-1) !important;
    color: white !important;
    padding: 0.25rem 0.75rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.badge-hard {
    background-color: var(--blue-dark-1) !important;
    color: white !important;
    padding: 0.25rem 0.75rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
}

/* ===========================
   CARD HEADER GRADIENTS (Blue theme - wie Mathe)
   =========================== */
.card-header-light {
    background: linear-gradient(135deg, var(--blue-light-1) 0%, var(--blue-light-2) 100%);
}

.card-header-medium {
    background: linear-gradient(135deg, var(--blue-medium-1) 0%, var(--blue-medium-2) 100%);
}

.card-header-dark {
    background: linear-gradient(135deg, var(--blue-dark-1) 0%, var(--blue-dark-2) 100%);
}

/* ===========================
   RESPONSIVE DESIGN
   =========================== */
@media (max-width: 768px) {
    /* Hero */
    .hero h1:not(.display-4) {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .hero {
        padding: 40px 20px;
    }

    /* Content Sections */
    .content-section,
    .nomenklatur-section {
        padding: 25px;
    }

    /* Molecule Containers */
    .molecule-container,
    .molecule-models,
    .nomenklatur-examples,
    .properties-examples,
    .reaction-examples,
    .topic-cards {
        flex-direction: column;
        align-items: center;
        margin-bottom: 40px;
    }

    .molecule-item,
    .molecule-model,
    .nomenklatur-example,
    .property-example,
    .reaction-item,
    .topic-card {
        width: 90%;
        max-width: 300px;
        margin-bottom: 30px;
    }

    .reaction-example {
        width: 90%;
        max-width: none;
    }

    .reaction-item {
        width: 100%;
        float: none;
        margin: 15px 0;
    }

    /* Canvas & Buttons */
    .view-2d,
    .view-3d,
    .molecule-canvas {
        width: 180px;
        height: 180px;
    }

    .btn-toggle {
        width: 80%;
        min-width: unset;
    }

    /* Tables */
    table,
    .comparison-table,
    .formula-box {
        display: block;
        overflow-x: auto;
        width: 100%;
        font-size: 14px;
    }

    /* Controls */
    .controls-container,
    .demo-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .form-control,
    .cta-button {
        width: 100%;
        margin-bottom: 10px;
    }

    /* Highlight Links */
    .highlight-link {
        flex-direction: column;
        text-align: center;
    }

    .highlight-link i {
        margin: 0 0 15px 0;
        justify-content: center;
    }

    /* Difficulty Filters */
    .difficulty-filters {
        flex-direction: column;
        align-items: center;
    }

    .difficulty-filter {
        width: 100%;
        max-width: 200px;
        text-align: center;
    }

    /* Challenge */
    .challenge-question {
        flex-direction: column;
        align-items: flex-start;
    }

    .question-number {
        margin-bottom: 10px;
    }

    .challenge-molecule {
        margin: 0 0 15px 0;
        align-self: center;
    }

    .challenge-answer {
        width: 100%;
    }

    /* Quiz */
    .quiz-molecule {
        max-width: 100%;
        overflow-x: auto;
    }

    .quiz-options label {
        display: block;
        margin-bottom: 10px;
    }

    /* Canvas Container */
    .canvas-container {
        overflow-x: auto;
        padding-bottom: 20px;
    }

    canvas#siedepunkt-canvas,
    canvas#leitfaehigkeit-canvas {
        min-width: 800px;
        display: block;
        margin: 0 auto;
        max-width: 100%;
        height: auto;
    }
}

/* Sehr kleine Bildschirme */
@media (max-width: 480px) {
    .hero {
        padding: 40px 20px;
    }

    .hero h1:not(.display-4) {
        font-size: 1.8rem;
    }

    .view-2d,
    .view-3d,
    .molecule-canvas {
        width: 160px;
        height: 160px;
    }

    .molecule-item,
    .molecule-model,
    .nomenklatur-example,
    .property-example,
    .reaction-item {
        padding: 10px 10px 60px 10px;
    }

    .btn-toggle {
        font-size: 13px;
        padding: 7px 12px;
    }

    .topic-card {
        flex-direction: column;
    }


/* ================================================
   Responsive MathJax Formeln (ÜBERARBEITET)
   ================================================ */

/* Basis-Skalierung mit clamp() für automatische Anpassung */
mjx-container {
    font-size: clamp(0.85rem, 2vw, 1.1rem) !important;
    max-width: 100%;
}

/* Inline-Formeln */
mjx-container[display="inline"] {
    font-size: clamp(0.85rem, 1.8vw, 1rem) !important;
}

/* Display-Formeln (zentriert) */
mjx-container[display="block"] {
    font-size: clamp(0.9rem, 2.2vw, 1.15rem) !important;
    margin: 1rem 0;
}

/* Tablet (768px und kleiner) */
@media (max-width: 768px) {
    mjx-container {
        font-size: 0.9rem !important;
    }
    
    mjx-container[display="inline"] {
        font-size: 0.88rem !important;
    }
    
    mjx-container[display="block"] {
        font-size: 0.95rem !important;
    }
}

/* Mobile (480px und kleiner) */
@media (max-width: 480px) {
    mjx-container {
        font-size: 0.85rem !important;
    }
    
    mjx-container[display="inline"] {
        font-size: 0.82rem !important;
    }
    
    mjx-container[display="block"] {
        font-size: 0.88rem !important;
        margin: 0.75rem 0;
    }
}

/* Nur bei wirklich breiten Formeln Scrollbar anzeigen */
mjx-container[style*="width"] {
    overflow-x: auto;
    overflow-y: hidden;
}

/* Touch-Scrolling für mobile Geräte */
@media (pointer: coarse) {
    mjx-container[style*="width"] {
        -webkit-overflow-scrolling: touch;
    }
}

/* Formeln in Boxen (formula-box, example-box, etc.) */
.formula-box mjx-container,
.example-box mjx-container,
.solution-box mjx-container,
.hint-box mjx-container {
    word-wrap: break-word;
    overflow-wrap: break-word;
}
