/* MODERN ACADEMIC THEME (System Fonts & DSGVO Edition) */

:root {
    /* Color Palette */
    --primary: #9f1239;       /* Deep Rose 800 */
    --primary-hover: #881337; /* Rose 900 */
    --primary-light: #fff1f2; /* Rose 50 */
    --primary-border: #fecdd3;/* Rose 200 */
    
    /* Neutrals */
    --bg-body: #f8fafc;
    --bg-surface: #ffffff;
    --text-main: #334155;
    --text-dark: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;

    /* Shadows & Radius */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
    --radius: 8px;
    
    --max-w: 1100px;
}

/* Base */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    /* System Fonts für beste Performance und Datenschutz */
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
}

/* --- Mobile Navigation (Desktop: Hidden) --- */
.mobile-nav {
    display: none;
}

/* Header */
header {
    background: var(--bg-surface);
    border-bottom: 2px solid var(--primary);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0.8rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 1.8rem;
    background: var(--primary-light);
    color: var(--primary);
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
}

.logo-text h1 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-dark);
    font-weight: 700;
}

.logo-text small {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Search */
.search-bar {
    position: relative;
    max-width: 300px;
    width: 100%;
}

.search-bar input {
    width: 100%;
    padding: 8px 12px 8px 35px;
    border: 1px solid var(--border);
    border-radius: 20px;
    outline: none;
    transition: all 0.2s;
    font-family: inherit;
}

.search-bar input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.search-bar svg {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 16px;
}

/* Menu Icon */
.menu-icon {
    display: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
}

.menu-icon span {
    width: 25px;
    height: 3px;
    background-color: var(--text-dark);
    border-radius: 2px;
}

/* Layout */
main {
    max-width: var(--max-w);
    margin: 2rem auto 4rem;
    padding: 0 1.5rem;
}

.intro-section {
    text-align: center;
    margin-bottom: 3rem;
    padding: 1rem;
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.intro-section h2 {
    margin-top: 0;
    color: var(--primary);
}

/* Sections */
.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1rem;
    margin-top: 2rem;
}

.section-title h2 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--text-dark);
}

.badge {
    background: var(--primary);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 4px;
}

.badge-dark {
    background: var(--text-dark);
}

/* Accordion */
.accordion {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.accordion-item {
    border-bottom: 1px solid var(--border);
}

.accordion-item:last-child {
    border-bottom: none;
}

.accordion-header {
    padding: 1rem 1.5rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    transition: background 0.2s, color 0.2s, border-left 0.2s;
}

.accordion-header:hover {
    background: var(--bg-body);
}

.accordion-header.active {
    background: var(--primary-light);
    color: var(--primary);
    border-left: 4px solid var(--primary);
}

.icon-toggle::after {
    content: '▼';
    font-size: 0.8rem;
    display: inline-block;
    transition: transform 0.3s;
}

.accordion-header.active .icon-toggle::after {
    transform: rotate(180deg);
}

.accordion-content {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.4s ease;
    background: #fff;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 1.5rem;
}

/* Cards */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-border);
}

.card.featured {
    border: 1px solid var(--primary-border);
    background: linear-gradient(to bottom, #fff, var(--primary-light));
}

.card-content {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card h3 {
    margin: 0.5rem 0;
    font-size: 1.1rem;
    color: var(--text-dark);
}

.card p {
    font-size: 0.9rem;
    color: var(--text-muted);
    flex-grow: 1;
}

/* Buttons & Links */
.card-links a {
    display: block;
    color: var(--primary);
    text-decoration: none;
    font-size: 0.9rem;
    margin-top: 5px;
}

.card-links a:hover {
    text-decoration: underline;
}

.btn-primary,
.btn-secondary {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    border: none;
    transition: background 0.2s, border-color 0.2s;
    font-family: inherit;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--bg-body);
    color: var(--text-dark);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: #e2e8f0;
}

.tag {
    font-size: 0.65rem;
    text-transform: uppercase;
    background: var(--primary-light);
    color: var(--primary);
    padding: 2px 6px;
    border-radius: 4px;
    align-self: flex-start;
}

.tag-ai {
    color: #db2777;
    background: #fce7f3;
}

/* -------------------------------------------------- */
/* Sub-Accordions: Micro-Learning deutlich hervorheben */
/* -------------------------------------------------- */

.sub-section-wrapper {
    margin: 1.5rem;
    border: 1px solid var(--primary-border);
    border-radius: calc(var(--radius) + 4px);
    overflow: hidden;
    background: linear-gradient(135deg, #ffffff, var(--primary-light));
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}

/* Abstand nach oben, wenn direkt nach Cards */
.grid + .sub-section-wrapper {
    margin-top: 0.5rem;
}

.accordion-header-sub {
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #fff1f2, #f8fafc);
    font-size: 1rem;
    font-weight: 750;
    color: var(--text-dark);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid var(--primary-border);
    transition: background 0.2s, color 0.2s;
}

.accordion-header-sub:hover {
    background: linear-gradient(135deg, #ffe4e6, #fff1f2);
    color: var(--primary);
}

.accordion-header-sub.active {
    background: linear-gradient(135deg, #ffe4e6, #fff1f2);
    color: var(--primary);
}

/* Linke Micro-Learning-Überschrift */
.accordion-header-sub span:first-child {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    line-height: 1.3;
}

/* Markantes kleines Kapitel-Icon */
.accordion-header-sub span:first-child::before {
    content: "▣";
    color: var(--primary);
    font-size: 0.85rem;
    line-height: 1;
}

/* Falls du im HTML <small> für Module ergänzt */
.accordion-header-sub small {
    font-weight: 500;
    color: var(--text-muted);
}

/* Pfeil rechts */
.icon-toggle-sub {
    color: var(--primary);
    font-size: 0.85rem;
    line-height: 1;
    display: inline-block;
    transition: transform 0.25s ease;
    flex-shrink: 0;
}

/* Inhalt der Micro-Learning-Bereiche */
.sub-content {
    display: none;
    background: #ffffff;
}

/* Grid innerhalb der Micro-Learning-Bereiche etwas kompakter */
.sub-content .grid {
    padding: 1.25rem;
    gap: 1rem;
}

/* Cards innerhalb Micro-Learning etwas ruhiger */
.sub-content .card {
    background: #ffffff;
    border-color: #e5e7eb;
}

.sub-content .card h3 {
    font-size: 1rem;
}

.sub-content .card p {
    font-size: 0.85rem;
}

/* YouTube Videos Container */
.video-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 2rem;
}

/* --- DATENSCHUTZ: 2-Klick Video Platzhalter --- */
.video-placeholder {
    width: 100%;
    height: 200px;
    background-color: #1e293b;
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
    cursor: pointer;
    border: 1px solid var(--border);
    transition: background 0.3s;
    position: relative;
    overflow: hidden;
}

.video-placeholder:hover {
    background-color: #334155;
}

.video-placeholder h3 {
    color: #fff;
    margin: 0 0 10px 0;
    font-size: 0.95rem;
}

.video-placeholder p {
    color: #cbd5e1;
    font-size: 0.8rem;
    max-width: 90%;
    margin-bottom: 15px;
}

.btn-load-video {
    background: #ef4444;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

/* Quiz Styling */
#quiz-container {
    margin-top: 20px;
}

.question {
    background: var(--bg-surface);
    border: 1px solid var(--border) !important;
    border-left: 4px solid var(--text-muted) !important;
    border-radius: var(--radius);
    padding: 1.5rem !important;
    margin-bottom: 1.5rem !important;
    box-shadow: var(--shadow-sm);
}

.answer-container {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.answer-container:hover {
    background: var(--bg-body);
}

input[type="checkbox"] {
    accent-color: var(--primary);
    width: 18px;
    height: 18px;
    margin-top: 4px;
}

#timer {
    background: var(--text-dark);
    color: white;
    padding: 10px 20px;
    border-radius: 99px;
    display: inline-block;
    font-weight: bold;
    margin-bottom: 20px;
    position: sticky;
    top: 80px;
    z-index: 90;
    box-shadow: var(--shadow-md);
}

#result {
    margin-top: 30px;
    padding: 20px;
    background: var(--primary-light);
    border: 1px solid var(--primary-border);
    border-radius: var(--radius);
    color: var(--primary);
}

/* Footer */
footer {
    border-top: 1px solid var(--border);
    margin-top: 4rem;
    padding: 2rem;
    text-align: center;
    background: #fff;
    color: var(--text-muted);
    font-size: 0.9rem;
}

footer a {
    color: var(--primary);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .header-inner {
        flex-wrap: wrap;
    }

    .search-bar {
        order: 3;
        max-width: 100%;
        margin-top: 10px;
    }

    .menu-icon {
        display: flex;
    }

    .video-container {
        grid-template-columns: 1fr;
    }
    
    .mobile-nav {
        display: block;
    }

    .mobile-nav nav ul {
        display: none;
        list-style: none;
        padding: 0;
        margin: 0;
        background: white;
        border-bottom: 1px solid var(--border);
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        z-index: 99;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    }

    .mobile-nav nav ul.show {
        display: block;
    }

    .mobile-nav nav ul li {
        border-top: 1px solid var(--border);
    }

    .mobile-nav nav ul li a {
        display: block;
        padding: 15px;
        text-decoration: none;
        color: var(--text-dark);
        font-weight: 600;
    }

    .grid {
        grid-template-columns: 1fr;
        padding: 1rem;
    }

    .sub-section-wrapper {
        margin: 1rem;
    }

    .accordion-header-sub {
        align-items: flex-start;
        font-size: 0.95rem;
    }
}