/* Grundlegendes Reset und Variablen */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2196F3;
    --primary-dark: #1976D2;
    --primary-light: #BBDEFB;
    --success-color: #4CAF50;
    --error-color: #F44336;
    --warning-color: #FF9800;
    --bg-color: #f5f7fa;
    --card-bg: #ffffff;
    --text-dark: #2c3e50;
    --text-light: #7f8c8d;
    --border-color: #e0e0e0;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: var(--text-dark);
}

.container {
    width: 100%;
    max-width: 800px;
    position: relative;
}

/* Bildschirm-Verwaltung */
.screen {
    display: none;
    animation: fadeIn 0.5s ease;
}

.screen.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== LERNMODUS STYLES ===== */
.learn-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 25px;
    box-shadow: var(--shadow-lg);
}

.learn-header {
    text-align: center;
    margin-bottom: 30px;
}

.learn-icon {
    font-size: 48px;
    margin-bottom: 12px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.learn-title {
    font-size: 22px;
    color: var(--text-dark);
    margin-bottom: 10px;
    font-weight: 600;
}

.learn-subtitle {
    color: var(--text-light);
    font-size: 14px;
}

.learn-content {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 15px;
    padding: 30px;
    margin: 25px 0;
}

.learn-section {
    margin-bottom: 25px;
}

.learn-section:last-child {
    margin-bottom: 0;
}

.section-title {
    font-size: 16px;
    color: #667eea;
    margin-bottom: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-text {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-dark);
    margin-bottom: 12px;
}

.highlight-box {
    background: white;
    border-left: 4px solid #667eea;
    padding: 15px 20px;
    border-radius: 8px;
    margin: 15px 0;
}

.highlight-box strong {
    color: #667eea;
}

.example-list {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-top: 15px;
}

.example-list h4 {
    color: #764ba2;
    margin-bottom: 12px;
    font-size: 16px;
}

.example-list ul {
    list-style: none;
    padding-left: 0;
}

.example-list li {
    padding: 8px 0;
    padding-left: 30px;
    position: relative;
    color: #555;
}

.example-list li:before {
    content: "→";
    position: absolute;
    left: 10px;
    color: #667eea;
    font-weight: bold;
}

.visual-diagram {
    background: white;
    border-radius: 10px;
    padding: 25px;
    margin: 20px 0;
    text-align: center;
}

.hierarchy-chain {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin: 20px 0;
}

.hierarchy-item {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 10px 18px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 13px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    transition: transform 0.3s;
}

.hierarchy-item:hover {
    transform: scale(1.05);
}

.arrow {
    font-size: 24px;
    color: #667eea;
    font-weight: bold;
}

.ready-section {
    text-align: center;
    margin-top: 35px;
    padding-top: 30px;
    border-top: 2px dashed var(--border-color);
}

.ready-text {
    font-size: 20px;
    color: var(--text-dark);
    margin-bottom: 20px;
    font-weight: 500;
}

.ready-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 18px 50px;
    font-size: 18px;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    transition: all 0.3s;
}

.ready-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.5);
}

.ready-btn:active {
    transform: translateY(-1px);
}

.skip-link {
    display: block;
    margin-top: 15px;
    color: #999;
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
}

.skip-link:hover {
    color: #667eea;
}

.question-preview {
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 10px;
    padding: 15px;
    margin-top: 20px;
    text-align: center;
}

.question-preview-text {
    color: #856404;
    font-size: 14px;
    font-weight: 500;
}

/* ===== THEME SELECTION ===== */
.section-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.theme-counter {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

.theme-selection {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.theme-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 12px 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.theme-card:not(.disabled):hover {
    border-color: #667eea;
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

.theme-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f5f5f5;
}

.theme-card.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, #f5f7fa 0%, #e7e9ff 100%);
}

.theme-icon {
    font-size: 32px;
    min-width: 40px;
    text-align: center;
}

.theme-info {
    flex: 1;
}

.theme-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 5px;
    word-break: break-word;
    line-height: 1.3;
}

.theme-status {
    font-size: 11px;
}

.theme-status.available {
    color: #4CAF50;
}

.theme-status.unavailable {
    color: #999;
    font-style: italic;
}

.theme-checkbox {
    position: relative;
}

.theme-checkbox input[type="checkbox"] {
    appearance: none;
    width: 28px;
    height: 28px;
    border: 2px solid #ccc;
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    transition: all 0.3s;
}

.theme-checkbox input[type="checkbox"]:hover:not(:disabled) {
    border-color: #667eea;
}

.theme-checkbox input[type="checkbox"]:checked {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-color: #667eea;
}

.theme-checkbox input[type="checkbox"]:checked::after {
    content: "✓";
    position: absolute;
    color: white;
    font-size: 18px;
    font-weight: bold;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.theme-checkbox input[type="checkbox"]:disabled {
    cursor: not-allowed;
    background: #eee;
}

/* ===== LEARNING MODE TOGGLE ===== */
.learning-mode-toggle {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.toggle-header {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.toggle-icon {
    font-size: 32px;
}

.toggle-text {
    flex: 1;
}

.toggle-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 5px;
}

.toggle-description {
    font-size: 14px;
    color: var(--text-light);
}

/* Switch Toggle */
.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.slider:hover {
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.4);
}

/* Karten */
.card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 40px;
    box-shadow: var(--shadow-lg);
    margin-top: 20px;
}

/* Startbildschirm */
.logo {
    font-size: 80px;
    text-align: center;
    margin-bottom: 20px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.title {
    font-size: 2.2rem;
    font-weight: 700;
    text-align: center;
    color: white;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.subtitle {
    text-align: center;
    color: rgba(255,255,255,0.9);
    font-size: 0.95rem;
    margin-bottom: 30px;
}

/* Formular */
.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-dark);
    font-size: 0.95rem;
}

.form-group input {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* Schwierigkeitsgrad Buttons */
.difficulty-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 15px;
}

.difficulty-btn {
    background: white;
    border: 3px solid var(--border-color);
    border-radius: 12px;
    padding: 20px 10px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.difficulty-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.difficulty-btn.active {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.difficulty-btn .emoji {
    font-size: 2rem;
}

.difficulty-btn .label {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-dark);
}

.difficulty-btn .description {
    font-size: 0.75rem;
    color: var(--text-light);
}

/* Buttons */
.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.btn-secondary {
    background: transparent;
    color: var(--text-dark);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-color);
}

.btn-large {
    width: 100%;
    padding: 15px 25px;
    font-size: 1rem;
    margin-top: 20px;
}

.arrow {
    font-size: 1.3rem;
    transition: transform 0.3s;
}

.btn:hover .arrow {
    transform: translateX(5px);
}

/* Fortschrittsbalken */
.progress-bar-container {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

.progress-bar {
    height: 12px;
    background: var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--success-color));
    border-radius: 10px;
    transition: width 0.5s ease;
}

.progress-text {
    text-align: center;
    font-weight: 600;
    color: var(--text-dark);
}

/* Fragenkarte */
.question-card {
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: var(--shadow-lg);
    min-height: 400px;
}

.question-header {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
}

.theme-badge {
    background: var(--primary-light);
    color: var(--primary-dark);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.difficulty-badge {
    background: var(--warning-color);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.question-text {
    font-size: 1.5rem;
    line-height: 1.6;
    margin-bottom: 30px;
    color: var(--text-dark);
}

/* Antwortoptionen */
.question-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

.option {
    background: white;
    border: 3px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1.1rem;
}

.option:hover {
    border-color: var(--primary-color);
    transform: translateX(5px);
}

.option.selected {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.option.correct {
    border-color: var(--success-color);
    background: #e8f5e9;
}

.option.wrong {
    border-color: var(--error-color);
    background: #ffebee;
}

.option.disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/* Wahr/Falsch Buttons */
.true-false-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.true-false-btn {
    padding: 30px;
    font-size: 1.3rem;
    border-radius: 12px;
    border: 3px solid var(--border-color);
    background: white;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.true-false-btn .icon {
    font-size: 2.5rem;
}

.true-false-btn:hover {
    transform: scale(1.05);
    border-color: var(--primary-color);
}

.true-false-btn.selected {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

/* Lückentext */
.gap-text {
    display: inline-block;
    min-width: 120px;
    padding: 5px 15px;
    border-bottom: 2px solid var(--primary-color);
    margin: 0 5px;
}

.gap-input {
    border: 2px solid var(--border-color);
    border-radius: 6px;
    padding: 8px 15px;
    font-size: 1rem;
    min-width: 150px;
    margin: 0 5px;
}

.gap-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Zuordnungs-Container */
.zuordnung-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
    padding: 15px;
    background: var(--bg-color);
    border-radius: 10px;
}

.zuordnung-key {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 1.1rem;
}

.zuordnung-select {
    width: 100%;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 15px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
}

.zuordnung-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.zuordnung-select:hover {
    border-color: var(--primary-color);
}

/* Sortierungs-Container */
.sortierung-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    padding: 15px;
    background: var(--bg-color);
    border-radius: 10px;
}

.sortierung-select {
    width: 80px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 10px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    font-weight: 600;
}

.sortierung-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.sortierung-label {
    flex: 1;
    font-size: 1.1rem;
    color: var(--text-dark);
}

/* Feedback */
.feedback {
    margin: 20px 0;
    padding: 20px;
    border-radius: 12px;
    animation: slideIn 0.5s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.feedback.correct {
    background: #e8f5e9;
    border: 2px solid var(--success-color);
}

.feedback.wrong {
    background: #ffebee;
    border: 2px solid var(--error-color);
}

.feedback-content {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.feedback-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.feedback-text {
    flex: 1;
    line-height: 1.6;
}

.feedback.hidden {
    display: none;
}

/* Aktionen */
.question-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.question-actions .btn {
    min-width: 200px;
}

.hidden {
    display: none !important;
}

/* Ergebnis-Bildschirm */
.result-header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
}

.result-icon {
    font-size: 100px;
    margin-bottom: 20px;
    animation: zoomIn 0.5s ease;
}

@keyframes zoomIn {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

.result-title {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.result-card {
    background: white;
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    margin-bottom: 30px;
}

.result-grade {
    font-size: 6rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.result-score {
    font-size: 1.5rem;
    color: var(--text-dark);
}

.result-percent {
    color: var(--text-light);
    font-size: 1.2rem;
}

.result-details {
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 20px;
}

.result-details h3 {
    margin: 30px 0 15px 0;
    color: var(--text-dark);
}

.result-details h3:first-child {
    margin-top: 0;
}

/* Themen-Ergebnis */
.theme-result {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    margin-bottom: 10px;
    background: var(--bg-color);
    border-radius: 10px;
}

.theme-result-name {
    flex: 1;
    font-weight: 600;
}

.theme-result-bar {
    flex: 2;
    height: 25px;
    background: var(--border-color);
    border-radius: 15px;
    overflow: hidden;
}

.theme-result-fill {
    height: 100%;
    background: var(--success-color);
    border-radius: 15px;
    transition: width 1s ease;
}

.theme-result-percent {
    font-weight: 600;
    min-width: 60px;
    text-align: right;
}

/* Lerntipps */
.learning-tip {
    background: #fff3cd;
    border-left: 4px solid var(--warning-color);
    padding: 15px 20px;
    margin-bottom: 15px;
    border-radius: 8px;
}

.learning-tip strong {
    display: block;
    margin-bottom: 5px;
    color: var(--text-dark);
}

/* Aktionen */
.result-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* Bestenliste */
.highscore-filters {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 20px 0;
}

.filter-btn {
    padding: 10px 20px;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.filter-btn:hover {
    background: var(--bg-color);
}

.filter-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.highscore-table {
    width: 100%;
    border-collapse: collapse;
}

.highscore-table th {
    background: var(--bg-color);
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: var(--text-dark);
}

.highscore-table td {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
}

.highscore-table tr:hover {
    background: var(--bg-color);
}

.highscore-table tr.highlight {
    background: #fff3cd;
    font-weight: 600;
}

.medal {
    font-size: 1.5rem;
}

.no-highscores {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.no-highscores p {
    margin: 10px 0;
    font-size: 1.1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .title {
        font-size: 2rem;
    }
    
    .difficulty-buttons {
        grid-template-columns: 1fr;
    }
    
    .card {
        padding: 25px;
    }
    
    .question-card {
        padding: 25px;
    }
    
    .question-text {
        font-size: 1.2rem;
    }
    
    .result-grade {
        font-size: 4rem;
    }
    
    .result-actions,
    .question-actions {
        flex-direction: column;
    }
    
    .question-actions .btn {
        width: 100%;
    }
}
