:root {
    --bg-color: #101010;
    --surface-color: #1e1e1e;
    --module-bg-color: #252525;
    --primary-color: #03dac6;
    --primary-variant-color: #018786;
    --secondary-color: #bb86fc;
    --info-color: #ffc107;
    --text-color: #e0e0e0;
    --text-color-light: #a0a0a0;
    --correct-color: #4caf50;
    --incorrect-color: #f44336;
    --surface-light: rgba(255, 255, 255, 0.08);
    --border-light: rgba(255, 255, 255, 0.05);
    --font-family: 'Google Sans', 'Roboto', sans-serif;
    --border-radius: 16px;
    --container-padding: 3rem;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    background-image: radial-gradient(circle at top right, rgba(3, 218, 198, 0.05), transparent 40%), 
                      radial-gradient(circle at bottom left, rgba(187, 134, 252, 0.05), transparent 50%);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem;
}

/* Haupt-Container ("App-Karte") */
.container {
    width: 100%;
    max-width: 800px;
    background-color: var(--surface-color);
    border-radius: var(--border-radius);
    border: 1px solid var(--surface-light);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

/* --- View Management & Animation --- */
.view {
    display: none;
    padding: var(--container-padding);
    animation: fadeInUp 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}
.view.active { display: block; }

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeInUp 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards; opacity: 0; }

/* =============================================================== */
/* Button System                                                 */
/* =============================================================== */
.btn {
    font-family: var(--font-family);
    padding: 0.9rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    border: 2px solid transparent;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.25s ease;
    background-color: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}
.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}
.btn-primary { color: var(--primary-color); border-color: var(--primary-color); }
.btn-primary:hover { background-color: var(--primary-color); color: var(--bg-color); }
.btn-secondary { color: var(--secondary-color); border-color: var(--secondary-color); }
.btn-secondary:hover { background-color: var(--secondary-color); color: var(--bg-color); }
.btn-info { color: var(--info-color); border-color: var(--info-color); }
.btn-info:hover { background-color: var(--info-color); color: var(--bg-color); }
.btn-subtle { color: var(--text-color-light); border-color: var(--surface-light); font-weight: 400; }
.btn-subtle:hover { background-color: var(--surface-light); color: var(--text-color); transform: translateY(0); box-shadow: none; }
.btn-full { width: 100%; margin-top: 1.5rem; background-color: var(--primary-color); color: var(--bg-color); font-size: 1.1rem; font-weight: 700; }
.btn-full:hover { background-color: var(--primary-variant-color); border-color: var(--primary-variant-color); }

/* =============================================================== */
/* Header & Typografie                                           */
/* =============================================================== */
.view-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 2.5rem; gap: 1.5rem; }
.main-header { text-align: left; margin-bottom: 3rem; }
h1 { font-size: 2.8rem; font-weight: 700; margin-bottom: 0.5rem; color: var(--text-color); }
.subtitle { font-size: 1.1rem; color: var(--text-color-light); max-width: 600px; line-height: 1.5; }
#show-checklist-btn { padding: 0.5rem 1rem; font-size: 0.9rem; }

/* =============================================================== */
/* Dashboard View - Organized Layout                             */
/* =============================================================== */
.module-section {
    background-color: var(--module-bg-color);
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border-light);
    transition: transform 0.2s ease;
}
.module-section:hover { border-color: var(--surface-light); }
.module-section h2 {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--surface-light);
    color: var(--secondary-color);
    font-weight: 700;
    letter-spacing: 0.5px;
}
.theme-block { margin-bottom: 2rem; }
.theme-block:last-of-type { margin-bottom: 1.5rem; }
.theme-block h3 {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}
.theme-block h3::before {
    content: '•';
    color: var(--primary-color);
    margin-right: 10px;
    font-size: 1.5em;
    line-height: 0.8;
}
.button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding-left: 1.2rem; /* Leicht eingerückt für Hierarchie */
}
.module-divider {
    border: none;
    height: 1px;
    background-color: var(--surface-light);
    margin: 1.5rem 0;
    opacity: 0.5;
}

/* =============================================================== */
/* Intro & Quiz Views                                            */
/* =============================================================== */
#intro-title { color: var(--primary-color); font-size: 2rem; font-weight: 700; }
#intro-text { font-size: 1.15rem; color: var(--text-color); line-height: 1.8; margin-bottom: 2.5rem; }
#intro-text h2 { color: var(--primary-color); margin-top: 1.5rem; font-size: 1.3rem; margin-bottom: 0.5rem; }
#intro-text h3 { color: var(--secondary-color); margin-top: 1.5rem; font-size: 1.1rem; margin-bottom: 0.5rem; }
#intro-text ul { padding-left: 1.5rem; margin-top: 0.5rem; }

#quiz-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 2rem; }
#quiz-progress-container { flex-grow: 1; height: 10px; background-color: var(--surface-light); border-radius: 5px; overflow: hidden; }
#quiz-progress-bar { width: 0%; height: 100%; background: linear-gradient(90deg, var(--primary-variant-color), var(--primary-color)); transition: width 0.4s ease; }
#question-text { font-size: 1.5rem; line-height: 1.5; text-align: center; margin-bottom: 2.5rem; color: var(--text-color); font-weight: 500; }
#answer-options { display: flex; flex-direction: column; gap: 1rem; }

.answer-btn, .tf-btn { padding: 1.2rem; background-color: transparent; border: 1px solid var(--surface-light); color: var(--text-color-light); border-radius: var(--border-radius); text-align: left; font-size: 1.05rem; cursor: pointer; transition: all 0.2s; display: block; width: 100%; }
.answer-btn:hover:not([disabled]), .tf-btn:hover:not([disabled]) { border-color: var(--secondary-color); background-color: rgba(187, 134, 252, 0.1); color: var(--text-color); }
.answer-btn.correct, .tf-btn.correct { background-color: var(--correct-color); border-color: var(--correct-color); color: #fff; font-weight: 500; }
.answer-btn.incorrect, .tf-btn.incorrect { background-color: var(--incorrect-color); border-color: var(--incorrect-color); color: #fff; font-weight: 500; }
.answer-btn:disabled, .tf-btn:disabled { cursor: not-allowed; opacity: 0.7; }
.tf-container { display: flex; gap: 1rem; }
.tf-btn { text-align: center; }

#quiz-footer { margin-top: 2rem; text-align: center; min-height: 90px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
#feedback-text { font-size: 1.3rem; font-weight: 700; margin-bottom: 0.5rem; display: block; }
#feedback-text.correct { color: var(--correct-color); }
#feedback-text.incorrect { color: var(--incorrect-color); }
#feedback-tip { font-size: 1rem; color: var(--text-color-light); margin-bottom: 1.5rem; font-style: italic; max-width: 600px; }
#next-question-btn { padding: 1rem 3rem; font-size: 1.1rem; }

/* =============================================================== */
/* Results View - FIXED CENTERING                                */
/* =============================================================== */
.results-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}
.results-content .view-header {
    width: 100%;
    justify-content: center;
    margin-bottom: 2rem;
}
.results-content h2 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin: 0;
    text-align: center;
}
.result-chart {
    width: 180px;
    height: 180px;
    margin: 0 auto 2rem;
    display: block;
}
.circular-chart { display: block; width: 100%; height: 100%; }
.circle-bg { fill: none; stroke: var(--surface-light); stroke-width: 3; }
.circle { fill: none; stroke: var(--correct-color); stroke-width: 3; stroke-linecap: round; transition: stroke-dasharray 1s ease-out; }
.percentage-text { fill: var(--text-color); font-size: 0.6em; text-anchor: middle; font-weight: 700; }
#result-score {
    font-size: 1.4rem;
    margin-bottom: 0.8rem;
    font-weight: 500;
    text-align: center;
    width: 100%;
    display: block;
    color: var(--text-color);
}
#result-motivation {
    font-size: 1.1rem;
    color: var(--text-color-light);
    max-width: 600px;
    margin: 0 auto 2rem;
    text-align: center;
    line-height: 1.5;
    width: 100%;
    display: block;
}
#feedback-details {
    text-align: left;
    width: 100%;
    max-width: 600px;
    margin: 2rem auto 0;
    padding-top: 2rem;
    border-top: 1px solid var(--surface-light);
}
#feedback-details h3 { color: var(--incorrect-color); margin-bottom: 1.5rem; text-align: center; font-weight: 700; }
#feedback-list { list-style: none; }
#feedback-list li { background-color: rgba(244, 67, 54, 0.1); padding: 1rem; border-radius: 8px; margin-bottom: 0.8rem; border-left: 4px solid var(--incorrect-color); }
#feedback-list li b { color: var(--incorrect-color); display: block; margin-bottom: 0.3rem; }

.results-actions { display: flex; justify-content: center; gap: 1rem; margin-top: 2.5rem; flex-wrap: wrap; width: 100%; }
.results-actions .btn { padding: 1rem 2rem; min-width: 160px; }

/* =============================================================== */
/* Modal & Responsive                                            */
/* =============================================================== */
.hidden { display: none !important; }
.modal { position: fixed; z-index: 200; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.85); backdrop-filter: blur(5px); display: flex; justify-content: center; align-items: center; opacity: 0; transition: opacity 0.3s ease; pointer-events: none;}
.modal:not(.hidden) { opacity: 1; pointer-events: auto;}
.modal-content { background-color: var(--surface-color); padding: 2.5rem; border: 1px solid var(--surface-light); width: 90%; max-width: 700px; border-radius: var(--border-radius); position: relative; transform: scale(0.95); transition: transform 0.3s ease; box-shadow: 0 20px 50px rgba(0,0,0,0.5); }
.modal:not(.hidden) .modal-content { transform: scale(1); }
.modal-content h2 { color: var(--primary-color); }
.close-btn { color: var(--text-color-light); position: absolute; top: 1.5rem; right: 1.5rem; font-size: 2rem; font-weight: bold; cursor: pointer; line-height: 1; }
.close-btn:hover { color: var(--primary-color); }

/* --- NEU: Verbesserte Checklisten-Stile --- */
#checklist-content {
    margin-top: 2rem;
    max-height: 60vh; /* Ermöglicht Scrollen bei langen Listen */
    overflow-y: auto;
    padding-right: 1rem; /* Platz für den Scrollbalken */
}
.checklist-module {
    margin-bottom: 2.5rem;
}
.checklist-module:last-of-type {
    margin-bottom: 0;
}
.checklist-module h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--surface-light);
    letter-spacing: 0.5px;
}
.checklist-module ul {
    list-style: none;
    padding: 0;
}
.checklist-module li {
    font-size: 1rem;
    color: var(--text-color-light);
    padding: 1rem 1rem 1rem 2.5rem; /* Oben, Rechts, Unten, Links */
    position: relative;
    border-bottom: 1px solid var(--border-light);
    transition: background-color 0.2s ease;
    line-height: 1.5;
}
.checklist-module li:last-child {
    border-bottom: none;
}
.checklist-module li:hover {
    background-color: var(--surface-light);
    color: var(--text-color);
}
.checklist-module li::before {
    content: '✓';
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--correct-color);
    font-weight: 700;
    font-size: 1.2rem;
}

/* =============================================================== */
/* MOBILE & TABLET STYLES                                        */
/* =============================================================== */
@media (max-width: 768px) {
    body { 
        padding: 0; 
        align-items: flex-start;
    }
    .container { 
        padding: 0; 
        min-height: 100vh; 
        border-radius: 0; 
        border: none; 
        box-shadow: none; 
    }
    .view { 
        padding: 1.5rem;
    }
    h1 { 
        font-size: 2rem;
    }
    .module-section { 
        padding: 1.5rem; 
    }
    .results-actions { 
        flex-direction: column-reverse;
    }
    .results-actions .btn { 
        width: 100%; 
    }
}

/* =============================================================== */
/* Button "Zurück zur Homepage"                             */
/* =============================================================== */
.back-home-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000; /* Stellt sicher, dass der Button über allem liegt */
    background-color: var(--surface-color);
    color: var(--text-color-light);
    padding: 0.7rem 1.2rem;
    text-decoration: none;
    border-radius: var(--border-radius);
    font-family: var(--font-family);
    font-weight: 500;
    border: 1px solid var(--surface-light);
    transition: all 0.2s ease;
}
.back-home-btn:hover {
    background-color: var(--surface-light);
    color: var(--text-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

/* Mobile Position für den Zurück-Button */
@media (max-width: 768px) {
    .back-home-btn {
        top: 10px;
        left: 10px;
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}