/* === RESET & BASE === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Elegantes Teal/Petrol Theme */
    --primary: #0d9488;
    --primary-dark: #0f766e;
    --primary-light: #14b8a6;
    --secondary: #64748b;
    --success: #22c55e;
    --success-light: #dcfce7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --accent: #6366f1;

    /* Warmer, heller Hintergrund */
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --bg-card: #ffffff;

    /* Dunkle, gut lesbare Texte */
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;

    /* Subtile Borders und Schatten */
    --border: #e2e8f0;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.08);
    --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);

    --radius: 12px;
    --radius-lg: 16px;

    /* Navbar */
    --navbar-bg: #ffffff;

    /* Input fields */
    --input-bg: #ffffff;
}

/* === DARK THEME === */
[data-theme="dark"] {
    --primary: #14b8a6;
    --primary-dark: #0d9488;
    --primary-light: #2dd4bf;

    /* Dunkle Hintergründe */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-card: #1e293b;

    /* Helle Texte */
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;

    /* Angepasste Borders und Schatten */
    --border: #334155;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
    --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.25), 0 2px 4px -2px rgba(0, 0, 0, 0.15);

    /* Status colors angepasst für Dark Mode */
    --success-light: rgba(34, 197, 94, 0.15);
    --danger-light: rgba(239, 68, 68, 0.15);
    --warning-light: rgba(245, 158, 11, 0.15);

    /* Navbar */
    --navbar-bg: #1e293b;

    /* Input fields */
    --input-bg: #1e293b;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-tertiary) 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    transition: background 0.3s ease, color 0.3s ease;
}

/* === NAVBAR === */
.navbar {
    background: var(--navbar-bg);
    border-bottom: 1px solid var(--border);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: auto;
    min-height: 64px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: background 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

/* Navbar hide on scroll (mobile) */
.navbar.navbar-hidden {
    transform: translateY(-100%);
}

/* === THEME TOGGLE === */
.theme-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 1rem;
}

.theme-toggle-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 50px;
    width: 52px;
    height: 28px;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
}

.theme-toggle-btn:hover {
    border-color: var(--primary);
}

.theme-toggle-btn .toggle-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: var(--primary);
    border-radius: 50%;
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.theme-toggle-btn .toggle-thumb::before {
    content: '☀️';
}

[data-theme="dark"] .theme-toggle-btn .toggle-thumb {
    transform: translateX(24px);
}

[data-theme="dark"] .theme-toggle-btn .toggle-thumb::before {
    content: '🌙';
}

.back-to-main {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    margin-right: 16px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #c41e3a;
    background: rgba(196, 30, 58, 0.08);
    border: 1px solid rgba(196, 30, 58, 0.2);
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.back-to-main:hover {
    background: rgba(196, 30, 58, 0.15);
    border-color: rgba(196, 30, 58, 0.4);
    transform: translateX(-2px);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: 0 2px 8px rgba(13, 148, 136, 0.3);
}

.brand-text {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--primary-dark);
}

.nav-links {
    display: flex;
    gap: 0.25rem;
}

.nav-link {
    padding: 0.5rem 0.75rem;
    text-decoration: none;
    color: var(--text-secondary);
    border-radius: var(--radius);
    transition: all 0.2s;
    font-weight: 500;
    font-size: 0.9rem;
}

.nav-link:hover {
    background: var(--bg-tertiary);
    color: var(--primary-dark);
}

.nav-link.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 8px rgba(13, 148, 136, 0.25);
}

/* === MAIN CONTENT === */
.main-content {
    min-height: calc(100vh - 64px - 60px);
}

.view {
    display: none;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.view.active {
    display: block;
}

/* === BUTTONS === */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 4px rgba(13, 148, 136, 0.2);
}

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 4px 8px rgba(13, 148, 136, 0.3);
    transform: translateY(-1px);
}

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

.btn-secondary:hover {
    background: var(--border);
    transform: translateY(-1px);
}

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

.btn-success:hover {
    background: #16a34a;
    transform: translateY(-1px);
}

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

.btn-warning:hover {
    background: #d97706;
    transform: translateY(-1px);
}

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

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* === HOME VIEW === */
.hero {
    text-align: center;
    padding: 2rem 0;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--primary-dark);
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
}

.feature-cards {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary);
    opacity: 0;
    transition: opacity 0.25s;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.feature-card:hover::before {
    opacity: 1;
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.feature-card h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.8rem;
    line-height: 1.4;
}

.quick-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-card);
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* === LEARN VIEW === */
.learn-container {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
    min-height: calc(100vh - 200px);
}

.sidebar {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    height: fit-content;
    position: sticky;
    top: 80px;
}

.sidebar h2 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.topic-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.topic-item {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.topic-item:hover {
    background: var(--bg-tertiary);
}

.topic-item.active {
    background: var(--primary);
    color: white;
}

.topic-icon {
    font-size: 1.25rem;
}

.topic-name {
    flex: 1;
    font-size: 0.9rem;
}

.topic-progress {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.topic-item.active .topic-progress {
    color: rgba(255, 255, 255, 0.8);
}

.learn-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
}

.placeholder {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

.placeholder h2 {
    margin-bottom: 0.5rem;
}

/* Learn Topic Content */
.topic-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.topic-header h2 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.topic-description {
    color: var(--text-secondary);
}

.content-section {
    margin-bottom: 2rem;
}

.content-section h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

.content-section p {
    margin-bottom: 1rem;
}

.content-section ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.content-section li {
    margin-bottom: 0.5rem;
}

.anatomy-image {
    max-width: 100%;
    border-radius: var(--radius);
    margin: 1rem 0;
    border: 1px solid var(--border);
}

.info-box {
    background: var(--bg-tertiary);
    border-left: 4px solid var(--primary);
    padding: 1rem 1.5rem;
    border-radius: 0 var(--radius) var(--radius) 0;
    margin: 1rem 0;
}

.info-box.warning {
    border-left-color: var(--warning);
    background: var(--warning-light);
}

.info-box.danger {
    border-left-color: var(--danger);
    background: var(--danger-light);
}

.info-box h4 {
    margin-bottom: 0.5rem;
}

.key-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.key-fact {
    background: var(--bg-tertiary);
    padding: 1rem;
    border-radius: var(--radius);
    text-align: center;
}

.key-fact .value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.key-fact .label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* === QUIZ VIEW === */
.quiz-container {
    max-width: 800px;
    margin: 0 auto;
}

.quiz-setup {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
}

.quiz-setup h2 {
    margin-bottom: 1.5rem;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.option-group label {
    font-weight: 500;
    display: block;
    margin-bottom: 0.5rem;
}

.option-group select {
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    width: 200px;
    background: var(--input-bg);
    color: var(--text-primary);
}

.option-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

.topic-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.5rem;
}

.topic-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius);
    cursor: pointer;
}

.topic-checkbox:hover {
    background: var(--border);
}

.topic-checkbox input {
    cursor: pointer;
}

/* Quiz Active */
.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.quiz-progress {
    font-size: 1.1rem;
    font-weight: 600;
}

.quiz-score {
    color: var(--text-secondary);
}

.progress-bar {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 2rem;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    transition: width 0.3s;
    width: 0%;
}

.question-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 1rem;
}

.question-topic {
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.question-text {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.question-image img {
    max-width: 100%;
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.answers {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.answer-option {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
}

.answer-option:hover:not(.disabled) {
    border-color: var(--primary);
    background: var(--bg-tertiary);
}

.answer-option.selected {
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.1);
}

.answer-option.correct {
    border-color: var(--success);
    background: var(--success-light);
}

.answer-option.incorrect {
    border-color: var(--danger);
    background: var(--danger-light);
}

.answer-option.disabled {
    cursor: default;
}

.answer-letter {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.answer-option.selected .answer-letter {
    background: var(--primary);
    color: white;
}

.answer-option.correct .answer-letter {
    background: var(--success);
    color: white;
}

.answer-option.incorrect .answer-letter {
    background: var(--danger);
    color: white;
}

.answer-text {
    flex: 1;
    padding-top: 2px;
}

/* Explanation */
.explanation {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.explanation-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.explanation-icon {
    font-size: 1.25rem;
}

.explanation.correct {
    border-color: var(--success);
    background: var(--success-light);
}

.explanation.incorrect {
    border-color: var(--danger);
    background: var(--danger-light);
}

.quiz-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* Quiz Results */
.quiz-results {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
}

.quiz-results h2 {
    margin-bottom: 2rem;
}

.results-summary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3rem;
    margin-bottom: 2rem;
}

.result-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 8px solid var(--primary);
}

.result-circle.passed {
    border-color: var(--success);
}

.result-circle.failed {
    border-color: var(--danger);
}

.result-percentage {
    font-size: 2.5rem;
    font-weight: 700;
}

.results-details {
    text-align: left;
}

.result-message {
    margin-top: 0.5rem;
    font-size: 1.1rem;
}

.result-message.passed {
    color: var(--success);
}

.result-message.failed {
    color: var(--danger);
}

.results-by-topic {
    margin: 2rem 0;
    text-align: left;
}

.topic-result {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.topic-result-name {
    flex: 1;
}

.topic-result-bar {
    width: 200px;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
}

.topic-result-fill {
    height: 100%;
    background: var(--primary);
}

.topic-result-percent {
    width: 50px;
    text-align: right;
    font-weight: 500;
}

.results-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* === EXAM VIEW === */
.exam-container {
    max-width: 900px;
    margin: 0 auto;
}

.exam-intro {
    text-align: center;
}

.exam-intro h2 {
    margin-bottom: 2rem;
}

.exam-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.info-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: left;
}

.info-card h3 {
    margin-bottom: 1rem;
    color: var(--primary);
}

.info-card ul {
    list-style: none;
}

.info-card li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}

.info-card li:last-child {
    border-bottom: none;
}

/* Exam Active */
.exam-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 1rem;
}

.exam-timer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 600;
}

.exam-timer.warning {
    color: var(--warning);
}

.exam-timer.danger {
    color: var(--danger);
}

.exam-question-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 1rem;
}

.nav-btn {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-secondary);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.nav-btn:hover {
    background: var(--bg-tertiary);
}

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

.nav-btn.answered {
    background: var(--success-light);
    border-color: var(--success);
}

.nav-btn.marked {
    background: var(--warning-light);
    border-color: var(--warning);
}

.exam-question-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 1rem;
}

.question-number {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

#exam-question-text {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.exam-answers {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.exam-nav-buttons {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

/* Exam Results */
.exam-result-summary {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    margin: 2rem 0;
}

.result-badge {
    padding: 1rem 3rem;
    border-radius: var(--radius-lg);
    font-size: 1.5rem;
    font-weight: 700;
}

.result-badge.passed {
    background: var(--success-light);
    color: var(--success);
}

.result-badge.failed {
    background: var(--danger-light);
    color: var(--danger);
}

.exam-score {
    text-align: center;
}

#exam-score-percentage {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary);
}

.exam-review {
    margin: 2rem 0;
    max-height: 400px;
    overflow-y: auto;
}

.review-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.review-number {
    font-weight: 600;
    width: 30px;
}

.review-status {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}

.review-status.correct {
    background: var(--success-light);
    color: var(--success);
}

.review-status.incorrect {
    background: var(--danger-light);
    color: var(--danger);
}

.review-text {
    flex: 1;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.exam-result-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* === STATS VIEW === */
.stats-container {
    max-width: 900px;
    margin: 0 auto;
}

.stats-container h2 {
    margin-bottom: 2rem;
}

.stats-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-card .stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.stats-details {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.stats-details h3 {
    margin-bottom: 1rem;
}

.topic-stats {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.topic-stat-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topic-stat-name {
    width: 200px;
    font-size: 0.9rem;
}

.topic-stat-bar {
    flex: 1;
    height: 20px;
    background: var(--bg-tertiary);
    border-radius: 10px;
    overflow: hidden;
}

.topic-stat-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    transition: width 0.5s;
}

.topic-stat-percent {
    width: 50px;
    text-align: right;
    font-weight: 500;
}

.stats-history {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.stats-history h3 {
    margin-bottom: 1rem;
}

.history-list {
    max-height: 300px;
    overflow-y: auto;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.history-date {
    color: var(--text-muted);
    font-size: 0.85rem;
    width: 120px;
}

.history-score {
    font-weight: 600;
}

.history-score.passed {
    color: var(--success);
}

.history-score.failed {
    color: var(--danger);
}

.no-data {
    color: var(--text-muted);
    text-align: center;
    padding: 2rem;
}

.stats-actions {
    text-align: center;
}

/* === FOOTER === */
.footer {
    text-align: center;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: background 0.3s ease;
}

/* === UTILITIES === */
.hidden {
    display: none !important;
}

/* === RESPONSIVE === */
@media (max-width: 1200px) {
    .feature-cards {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .feature-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        height: auto;
        padding: 1rem;
        gap: 1rem;
    }

    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }

    .hero h1 {
        font-size: 1.75rem;
    }

    .feature-cards {
        grid-template-columns: 1fr;
    }

    .quick-stats {
        flex-direction: column;
        gap: 1.5rem;
    }

    .learn-container {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
    }

    .results-summary {
        flex-direction: column;
    }

    .exam-info {
        grid-template-columns: 1fr;
    }

    .topic-stat-name {
        width: 120px;
    }
}

/* === ANIMATIONS === */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.view.active {
    animation: fadeIn 0.3s ease;
}

/* === SCROLLBAR === */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary);
}

/* === KARTEIKARTEN === */
.flashcards-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

.flashcards-setup, .flashcards-results {
    text-align: center;
}

.flashcards-options {
    margin: 2rem 0;
    text-align: left;
}

.flashcard-stats-preview {
    font-size: 1.25rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
}

.flashcards-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.flashcards-score .known { color: var(--success); }
.flashcards-score .repeat { color: var(--danger); }

.flashcard-wrapper {
    perspective: 1000px;
    margin: 2rem 0;
}

.flashcard {
    width: 100%;
    height: 350px;
    cursor: pointer;
    position: relative;
}

.flashcard-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.flashcard.flipped .flashcard-inner {
    transform: rotateY(180deg);
}

.flashcard-front, .flashcard-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: var(--radius-lg);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.flashcard-front {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
}

.flashcard-back {
    background: var(--bg-secondary);
    border: 2px solid var(--primary);
    transform: rotateY(180deg);
    color: var(--text-primary);
}

.flashcard-topic {
    font-size: 0.875rem;
    opacity: 0.8;
    margin-bottom: 1rem;
}

.flashcard-term {
    font-size: 2rem;
    font-weight: 700;
}

.flip-hint {
    position: absolute;
    bottom: 1rem;
    font-size: 0.75rem;
    opacity: 0.6;
}

.flashcard-definition {
    font-size: 1.25rem;
    line-height: 1.6;
}

.flashcard-mnemonic {
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--warning-light);
    border-left: 3px solid var(--warning);
    border-radius: var(--radius);
    font-size: 0.95rem;
}

.flashcard-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.flashcard-actions .btn {
    min-width: 150px;
}

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

.btn-success:hover {
    background: #16a34a;
}

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

.btn-danger:hover {
    background: #dc2626;
}

/* === IFSG === */
.ifsg-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.ifsg-header {
    margin-bottom: 1.5rem;
}

.ifsg-header .subtitle {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.ifsg-search {
    max-width: 400px;
}

.ifsg-search input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    background: var(--input-bg);
    color: var(--text-primary);
}

.ifsg-search input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

.ifsg-search input::placeholder {
    color: var(--text-muted);
}

.ifsg-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.ifsg-tab {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-secondary);
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.ifsg-tab:hover {
    background: var(--bg-tertiary);
}

.ifsg-tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.ifsg-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

.ifsg-table-container {
    overflow-x: auto;
}

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

.ifsg-table th, .ifsg-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.ifsg-table th {
    background: var(--bg-tertiary);
    font-weight: 600;
    font-size: 0.875rem;
}

.ifsg-table tr:hover {
    background: var(--bg-tertiary);
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

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

.badge.nichtnamentlich {
    background: var(--secondary);
    color: white;
}

.ifsg-warning-box {
    background: var(--danger-light);
    border: 2px solid var(--danger);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.ifsg-warning-box h3 {
    color: var(--danger);
    margin-bottom: 0.5rem;
}

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

.ifsg-card {
    background: var(--bg-tertiary);
    border-radius: var(--radius);
    padding: 1.25rem;
    border-left: 4px solid var(--primary);
}

.ifsg-card.danger {
    border-left-color: var(--danger);
    background: var(--danger-light);
}

.ifsg-card h4 {
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.ifsg-card.danger h4 {
    color: var(--danger);
}

.ifsg-card .paragraph {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.ifsg-card .ausnahme {
    font-size: 0.85rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.ifsg-section {
    margin-bottom: 2rem;
}

.ifsg-section h3 {
    margin-bottom: 1rem;
    color: var(--primary);
}

.ifsg-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ifsg-list-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius);
}

.ifsg-list-item strong {
    color: var(--text-primary);
}

.ifsg-list-item span {
    color: var(--text-secondary);
}

@media (max-width: 768px) {
    .ifsg-tabs {
        flex-direction: column;
    }

    .ifsg-tab {
        width: 100%;
        text-align: center;
    }

    .flashcard {
        height: 300px;
    }

    .flashcard-term {
        font-size: 1.5rem;
    }
}

/* === DISCLAIMER === */
.disclaimer {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    font-style: italic;
}

/* === FRAGENTYP-BADGES === */
.type-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    margin-left: 0.5rem;
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.type-einfachauswahl {
    background: var(--success-light, #dcfce7);
    color: var(--success, #22c55e);
    border: 1px solid var(--success, #22c55e);
}

.type-aussagenkombination {
    background: #fef3c7;
    color: #d97706;
    border: 1px solid #d97706;
}

.type-mehrfachauswahl {
    background: #dbeafe;
    color: #2563eb;
    border: 1px solid #2563eb;
}

.type-zuordnung {
    background: #f3e8ff;
    color: #7c3aed;
    border: 1px solid #7c3aed;
}

/* === SCHWIERIGKEITS-BADGES === */
.difficulty-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    margin-left: 0.4rem;
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.difficulty-leicht {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #22c55e;
}

.difficulty-mittel {
    background: #fef9c3;
    color: #a16207;
    border: 1px solid #eab308;
}

.difficulty-schwer {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #ef4444;
}

/* === MEHRFACHAUSWAHL === */
.answer-option.multiple-choice {
    position: relative;
}

.answer-option.multiple-choice .checkbox-indicator {
    position: absolute;
    right: 1rem;
    width: 24px;
    height: 24px;
    border: 2px solid var(--border);
    border-radius: 4px;
    background: var(--input-bg);
}

.answer-option.multiple-choice.selected .checkbox-indicator {
    background: var(--primary);
    border-color: var(--primary);
}

.answer-option.multiple-choice.selected .checkbox-indicator::after {
    content: '✓';
    color: white;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: bold;
}

.question-text {
    white-space: pre-line;
}

#confirm-multiple {
    margin-bottom: 1rem;
}

#confirm-multiple:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* === DIFFERENTIALDIAGNOSE === */
.diff-diag-hint {
    background: var(--warning-light);
    border-left: 4px solid var(--warning);
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 0 var(--radius) var(--radius) 0;
}

.diff-diag-hint h4 {
    color: var(--warning);
    margin-bottom: 0.5rem;
}

.symptom-list {
    list-style: none;
    padding: 0;
}

.symptom-list li {
    padding: 0.25rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.symptom-list li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--warning);
    font-weight: bold;
}

/* === ORIGINAL-PRÜFUNGEN === */
.original-exams-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.original-exams-container h2 {
    margin-bottom: 0.5rem;
}

.original-exams-container .subtitle {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

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

.exam-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.exam-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.exam-card-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 1.5rem;
}

.exam-card-header h3 {
    margin-bottom: 0.25rem;
}

.exam-date {
    opacity: 0.9;
    font-size: 0.9rem;
}

.exam-card-body {
    padding: 1.5rem;
}

.exam-description {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.exam-schwerpunkte {
    margin-bottom: 1rem;
}

.exam-schwerpunkte strong {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.tag {
    display: inline-block;
    background: var(--bg-tertiary);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    margin: 0.25rem;
    color: var(--text-secondary);
}

.exam-meta {
    display: flex;
    gap: 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.exam-card .btn {
    width: 100%;
    margin: 0 1.5rem 1.5rem;
    width: calc(100% - 3rem);
}

/* Exam Session */
.exam-session-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.exam-session-info {
    display: flex;
    gap: 2rem;
    color: var(--text-secondary);
}

.exam-session-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* === MÜNDLICHE PRÜFUNG === */
.oral-exam-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
}

.oral-exam-container h2 {
    margin-bottom: 0.5rem;
}

.oral-exam-container .subtitle {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

#oral-exam-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

#oral-exam-info .info-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

#oral-exam-info .info-card h3 {
    color: var(--primary);
    margin-bottom: 1rem;
}

#oral-exam-info ul {
    list-style: none;
    padding: 0;
}

#oral-exam-info li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}

#oral-exam-info li:last-child {
    border-bottom: none;
}

.oral-categories {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.oral-category-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: var(--shadow);
}

.oral-category-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.category-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 0.5rem;
}

.oral-category-card h3 {
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

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

/* Oral Practice */
.oral-practice-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.oral-practice-header h3 {
    flex: 1;
}

.oral-question-card {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    margin-bottom: 1rem;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.oral-question-header {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    cursor: pointer;
    gap: 1rem;
    transition: background 0.2s;
}

.oral-question-header:hover {
    background: var(--bg-tertiary);
}

.oral-question-header .question-number {
    background: var(--primary);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

.oral-question-header .question-text {
    flex: 1;
    font-weight: 500;
}

.expand-icon {
    color: var(--text-muted);
    transition: transform 0.3s;
}

.oral-question-card.expanded .expand-icon {
    transform: rotate(180deg);
}

.oral-question-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.oral-question-card.expanded .oral-question-answer {
    max-height: 2000px;
}

.musterloesung {
    padding: 1.5rem;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border);
    line-height: 1.8;
}

.musterloesung strong {
    color: var(--primary);
}

.musterloesung ul, .musterloesung ol {
    margin-left: 1.5rem;
    margin-top: 0.5rem;
}

/* Result badges */
.result-badge.passed {
    background: var(--success);
    color: white;
    padding: 1rem 2rem;
    border-radius: var(--radius);
    font-size: 1.5rem;
    font-weight: bold;
}

.result-badge.failed {
    background: var(--danger);
    color: white;
    padding: 1rem 2rem;
    border-radius: var(--radius);
    font-size: 1.5rem;
    font-weight: bold;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .exam-cards {
        grid-template-columns: 1fr;
    }
    
    .oral-categories {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .exam-session-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .exam-session-info {
        flex-direction: column;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .oral-categories {
        grid-template-columns: 1fr;
    }
}

/* === LEARNING DASHBOARD === */
.learning-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.dashboard-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    text-align: center;
}

.dashboard-card h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.dashboard-card .btn {
    margin-top: 1rem;
}

.spaced-rep-card {
    border-left: 4px solid var(--primary);
}

.spaced-rep-card .due-count {
    font-size: 3rem;
    font-weight: bold;
    color: var(--primary);
}

.weak-topics-card {
    border-left: 4px solid var(--warning);
}

.weak-topics-list {
    text-align: left;
    margin: 1rem 0;
}

.weak-topic-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem;
    border-bottom: 1px solid var(--border);
}

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

.weak-percent {
    color: var(--danger);
    font-weight: bold;
}

.no-weak {
    color: var(--success);
    font-weight: 500;
}

.favorites-card {
    border-left: 4px solid #fbbf24;
}

.favorites-card .favorites-count {
    font-size: 3rem;
    font-weight: bold;
    color: #fbbf24;
}

/* Streak Animation */
.streak-item .stat-number {
    color: #ef4444;
}

.streak-item::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
}

/* === GLOBAL SEARCH === */
.global-search {
    max-width: 600px;
    margin: 2rem auto;
    position: relative;
}

.global-search input {
    width: 100%;
    padding: 1rem 1.5rem;
    border: 1px solid var(--border);
    border-radius: 50px;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: var(--input-bg);
    color: var(--text-primary);
}

.global-search input::placeholder {
    color: var(--text-muted);
}

.global-search input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    max-height: 400px;
    overflow-y: auto;
    z-index: 100;
    margin-top: 0.5rem;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
}

.search-result-item:hover {
    background: var(--bg-tertiary);
}

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

.result-type {
    font-size: 1.2rem;
}

.result-title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.no-results {
    padding: 1.5rem;
    text-align: center;
    color: var(--text-muted);
}

/* === FAVORITE BUTTON === */
.favorite-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s, transform 0.2s;
}

.favorite-btn:hover {
    opacity: 1;
    transform: scale(1.2);
}

.favorite-btn.active {
    opacity: 1;
    color: #fbbf24;
}

.question-card {
    position: relative;
}

/* === SPACED REPETITION BOX INDICATOR === */
.sr-box-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-tertiary);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.sr-box-indicator .box-level {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
}

.sr-box-indicator .box-level.box-1 { background: #ef4444; }
.sr-box-indicator .box-level.box-2 { background: #f97316; }
.sr-box-indicator .box-level.box-3 { background: #eab308; }
.sr-box-indicator .box-level.box-4 { background: #22c55e; }
.sr-box-indicator .box-level.box-5 { background: #3b82f6; }

/* === LERNFORTSCHRITT VISUALISIERUNG === */
.progress-ring {
    position: relative;
    width: 120px;
    height: 120px;
}

.progress-ring svg {
    transform: rotate(-90deg);
}

.progress-ring circle {
    fill: none;
    stroke-width: 8;
}

.progress-ring .bg {
    stroke: var(--bg-tertiary);
}

.progress-ring .progress {
    stroke: var(--primary);
    stroke-linecap: round;
    transition: stroke-dashoffset 0.5s;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .learning-dashboard {
        grid-template-columns: 1fr;
    }

    .global-search {
        margin: 1rem;
    }

    .global-search input {
        padding: 0.75rem 1rem;
    }
}

/* === AUDIO PANEL (TTS) === */
.audio-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    color: var(--text-primary);
    z-index: 1000;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    border-top-left-radius: var(--radius-lg);
    border-top-right-radius: var(--radius-lg);
    border-top: 1px solid var(--border);
    transition: transform 0.3s ease, background 0.3s ease;
}

.audio-panel.hidden {
    transform: translateY(100%);
}

.audio-panel-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.audio-icon {
    font-size: 1.5rem;
}

.audio-title {
    font-weight: 600;
    flex: 1;
}

.audio-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius);
    transition: background 0.2s;
}

.audio-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.audio-content {
    padding: 1rem 1.5rem 1.5rem;
}

.audio-now-playing {
    text-align: center;
    margin-bottom: 1rem;
}

.audio-mode {
    font-size: 0.875rem;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.audio-current-text {
    font-size: 1.1rem;
    line-height: 1.4;
    max-height: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.audio-progress-info {
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.audio-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.audio-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 1.5rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
}

.audio-btn:hover {
    background: var(--border);
    transform: scale(1.05);
}

.audio-btn.audio-play-pause {
    background: var(--primary);
    border: none;
    color: white;
    padding: 0.75rem 1.5rem;
    font-size: 1.75rem;
}

.audio-btn.audio-play-pause:hover {
    background: var(--primary-dark);
}

.audio-options {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.audio-voice,
.audio-speed {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.audio-voice label,
.audio-speed label {
    color: var(--text-secondary);
}

.audio-voice select,
.audio-speed select {
    background: var(--input-bg);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    cursor: pointer;
}

.audio-voice select:focus,
.audio-speed select:focus {
    outline: none;
    border-color: var(--primary);
}

/* Audio Button Style */
.btn-audio {
    background: linear-gradient(135deg, #7c3aed, #5b21b6);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-audio:hover {
    background: linear-gradient(135deg, #6d28d9, #4c1d95);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

/* Flashcard Start Buttons Layout */
.flashcard-start-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Oral Exam Header Actions */
.oral-header-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.oral-header-actions h3 {
    margin: 0;
}

/* Audio Panel Mobile Responsive */
@media (max-width: 768px) {
    .audio-panel {
        border-radius: 0;
    }

    .audio-controls {
        gap: 0.5rem;
    }

    .audio-btn {
        font-size: 1.25rem;
        padding: 0.5rem 0.75rem;
    }

    .audio-btn.audio-play-pause {
        font-size: 1.5rem;
        padding: 0.5rem 1rem;
    }

    .audio-current-text {
        font-size: 1rem;
    }

    .flashcard-start-buttons {
        flex-direction: column;
    }

    .oral-header-actions {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* === GAMES SECTION === */
.games-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.games-header {
    text-align: center;
    margin-bottom: 2rem;
}

.games-header h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.game-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin-top: 2rem;
}

@media (max-width: 1100px) {
    .game-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .game-cards {
        grid-template-columns: 1fr;
    }
}

.game-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow);
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.game-icon {
    font-size: 3rem;
    margin-bottom: 0.75rem;
}

.game-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.game-card p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.game-highscore {
    background: var(--bg-tertiary);
    padding: 0.75rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.game-highscore strong {
    color: var(--primary);
    font-size: 1.2rem;
}

/* Active Game Area */
.game-active {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.game-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.game-mode-title {
    font-weight: 600;
    font-size: 1.2rem;
}

.game-timer {
    background: var(--primary);
    color: white;
    font-size: 2rem;
    font-weight: 700;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    min-width: 80px;
    text-align: center;
}

.game-timer.warning {
    background: var(--warning);
    animation: pulse 0.5s infinite;
}

.game-timer.danger {
    background: var(--danger);
    animation: pulse 0.3s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.game-stats {
    display: flex;
    gap: 1.5rem;
    font-size: 1.1rem;
}

.game-score strong,
.game-streak strong {
    color: var(--primary);
    font-size: 1.3rem;
}

.game-lives {
    font-size: 1.5rem;
    letter-spacing: 0.3rem;
}

.game-progress {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    margin-bottom: 2rem;
    overflow: hidden;
}

.game-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--success));
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 100%;
}

.game-question-container {
    text-align: center;
}

.game-question {
    font-size: 1.3rem;
    font-weight: 500;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius);
    line-height: 1.6;
}

.game-answers {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.game-answer {
    padding: 1rem 1.5rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
    text-align: left;
}

.game-answer:hover {
    border-color: var(--primary);
    background: var(--bg-tertiary);
}

.game-answer.correct {
    background: var(--success-light);
    border-color: var(--success);
}

.game-answer.wrong {
    background: var(--danger-light);
    border-color: var(--danger);
}

.game-answer.disabled {
    pointer-events: none;
    opacity: 0.7;
}

/* Game Results */
.game-results-card {
    max-width: 500px;
    margin: 0 auto;
    text-align: center;
}

.game-final-score {
    margin: 2rem 0;
}

.score-label {
    display: block;
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.score-value {
    font-size: 4rem;
    font-weight: 700;
    color: var(--primary);
}

.game-results-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 2rem 0;
}

.result-stat {
    text-align: center;
}

.result-stat .stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.result-stat .stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.new-highscore {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: white;
    padding: 1rem 2rem;
    border-radius: var(--radius);
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    animation: glow 1s infinite alternate;
}

@keyframes glow {
    from { box-shadow: 0 0 10px rgba(251, 191, 36, 0.5); }
    to { box-shadow: 0 0 25px rgba(251, 191, 36, 0.8); }
}

.game-results-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Mobile Responsive for Games */
@media (max-width: 768px) {
    .game-cards {
        grid-template-columns: 1fr;
    }

    .game-header {
        flex-direction: column;
        text-align: center;
    }

    .game-stats {
        justify-content: center;
    }

    .game-answers {
        grid-template-columns: 1fr;
    }

    .game-timer {
        font-size: 1.5rem;
    }

    .score-value {
        font-size: 3rem;
    }

    .game-results-stats {
        flex-wrap: wrap;
    }
}
