/* LP-Variablen: in css/tokens.css konsolidiert (rückwärtskompatibel) */

/**
 * css/learning-path.css
 *
 * Styles für Lernpfad-Seiten — Container, Sidebar,
 * Content-Boxen, Quiz, Buttons, Progress-Bar.
 *
 * Design Tokens: siehe css/tokens.css
 * Siehe: docs/conventions/ENGINEERING_CONVENTIONS.md Abschnitt 9
 */

/* OVERRIDE Global Body Scroll for Learning Paths */
body {
    overflow-y: auto !important; 
    height: auto !important;
}

/* Learning Path Layout - centered text (default) */
.lp-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: var(--space-xl, 2rem);
    background: var(--color-surface, white);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 20px var(--color-shadow, rgba(0,0,0,0.05));
}

/* --- NEW: Sidebar Layout (Game Mode) --- */
.lp-layout-game-container {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    position: fixed;
    top: 0; 
    left: 0;
}

.lp-sidebar {
    width: var(--lp-sidebar-width);
    background: var(--color-surface, white);
    border-right: 1px solid var(--color-border, #ddd);
    display: flex;
    flex-direction: column;
    z-index: 10;
    box-shadow: 2px 0 10px var(--color-shadow, rgba(0,0,0,0.05));
    height: 100vh;
}

.lp-sidebar-header {
    padding: var(--space-md, 1rem);
    background: var(--color-text, #2c3e50);
    color: var(--color-text-inverse, white);
}
.lp-sidebar-header h1 {
    font-size: 1.2rem;
    margin: 0;
}
.lp-sidebar-header .subtitle {
    font-size: 0.8rem;
    opacity: 0.8;
}

.lp-sidebar-content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1rem;
}

.lp-sidebar-footer {
    padding: var(--space-md, 1rem);
    border-top: 1px solid var(--color-border-light, #eee);
    background: var(--color-bg-light, #f8f9fa);
    display: flex;
    justify-content: space-between;
    gap: var(--space-sm, 10px);
}

.lp-main-content {
    flex-grow: 1;
    background: var(--color-bg, #dfe6e9);
    position: relative;
    display: flex;
    flex-direction: column;
}

.lp-game-frame-full {
    border: none;
    width: 100%;
    height: 100%;
    display: block;
}


/* --- NEW: Split Layout (Complexity) --- */
.lp-layout-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    height: calc(100vh - 150px); /* Approx height minus header/footer */
}
.lp-split-left {
    overflow-y: auto;
    padding-right: 1rem;
}
.lp-split-right {
    background: var(--color-bg, #f0f2f5);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}


/* Shared Element Styles */
.lp-header {
    margin-bottom: var(--space-xl, 2rem);
    border-bottom: 1px solid var(--color-border, #ddd);
    padding-bottom: var(--space-md, 1rem);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.lp-block {
    margin-bottom: var(--lp-spacing);
    padding: 1.2rem;
    border-radius: var(--border-radius, 6px);
    background: var(--color-surface, white);
    border: 1px solid var(--color-border-light, #eee);
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

/* Legacy class – kept for backward compatibility with search-trees path */
.lp-task {
    background-color: #f0f7fb;
    border-left: 4px solid var(--lp-accent-color);
}
.lp-task::before {
    content: "Aufgabe";
    font-weight: bold;
    color: var(--lp-accent-color);
    display: block;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    font-size: 0.75rem;
}

/* Legacy class */
.lp-explanation {
    background-color: #f9f9f9;
    border-left: 4px solid #95a5a6;
}

.lp-hint {
    font-style: italic;
    color: #666;
    margin-top: 0.5rem;
    background: #fff;
    padding: 0.5rem;
    border: 1px dashed #ccc;
    border-radius: 4px;
}

/* ===== NEW STANDARDIZED CONTENT BLOCKS (v2) ===== */

/* Info-Box: Pure theory & facts */
.lp-info-box {
    background-color: var(--color-bg-light, #f8f9fa);
    border-left: 4px solid var(--color-info, #6c757d);
}
.lp-info-box::before {
    content: "ℹ️ Information";
    font-weight: bold;
    color: var(--color-info, #6c757d);
    display: block;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.03em;
}

/* Instruction-Box: User action guidance */
.lp-instruction-box {
    background-color: #fff3cd;
    border-left: 4px solid #ffc107;
}
.lp-instruction-box::before {
    content: "👉 Anleitung";
    font-weight: bold;
    color: #856404;
    display: block;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.03em;
}

/* Task-Box: Interactive tasks that gate progression */
.lp-task-box {
    background-color: #e3f2fd;
    border-left: 4px solid #1976d2;
}
.lp-task-box::before {
    content: "✏️ Aufgabe";
    font-weight: bold;
    color: #1976d2;
    display: block;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.03em;
}

.lp-task-input {
    padding: 0.5rem 0.75rem;
    border: 2px solid #bbdefb;
    border-radius: 6px;
    font-size: 1rem;
    width: 120px;
    margin-right: 0.5rem;
    transition: border-color 0.2s;
}
.lp-task-input:focus {
    outline: none;
    border-color: #1976d2;
}

.lp-task-feedback {
    margin-top: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    font-weight: 500;
    display: none;
}
.lp-task-feedback.correct {
    display: block;
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}
.lp-task-feedback.incorrect {
    display: block;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Definition-Box: Key terms */
.lp-definition-box {
    background-color: #e8f5e9;
    border-left: 4px solid #4caf50;
}
.lp-definition-box::before {
    content: "📖 Definition";
    font-weight: bold;
    color: #2e7d32;
    display: block;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.03em;
}

/* Math-Box: Formulas and calculations */
.lp-math-box {
    background-color: #fce4ec;
    border-left: 4px solid #e91e63;
}
.lp-math-box::before {
    content: "🔢 Mathematik";
    font-weight: bold;
    color: #c2185b;
    display: block;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.03em;
}

/* Prerequisite / Link Box */
.lp-prerequisite-box {
    background-color: #fff8e1;
    border-left: 4px solid #ff9800;
    border: 2px dashed #ffcc02;
    border-left: 4px solid #ff9800;
}
.lp-prerequisite-box::before {
    content: "📋 Voraussetzung";
    font-weight: bold;
    color: #e65100;
    display: block;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.03em;
}

/* Highlight values for evaluation display */
.value-positive {
    color: #2e7d32;
    font-weight: 700;
    font-size: 1.1em;
}
.value-negative {
    color: #c62828;
    font-weight: 700;
    font-size: 1.1em;
}
.value-neutral {
    color: #f57f17;
    font-weight: 700;
    font-size: 1.1em;
}

/* Factorial / big number emphasis */
.big-number {
    font-family: 'Courier New', monospace;
    font-size: 1.2em;
    font-weight: 700;
    color: #1565c0;
}

/* Chess piece values table */
.piece-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.5rem 0;
}
.piece-table th, .piece-table td {
    padding: 0.5rem 0.75rem;
    border: 1px solid #ddd;
    text-align: center;
}
.piece-table th {
    background: #f5f5f5;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Buttons */
.lp-btn {
    padding: 0.6rem 1rem;
    border: none;
    border-radius: 4px;
    background-color: var(--lp-accent-color);
    color: white;
    cursor: pointer;
    font-size: 0.9rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.lp-btn:hover { background-color: var(--color-primary-hover, #2980b9); }
.lp-btn-outline {
    background-color: transparent;
    border: 1px solid var(--lp-accent-color);
    color: var(--lp-accent-color);
}
.lp-btn-outline:hover {
    background-color: var(--lp-accent-color);
    color: white;
}
.lp-btn-sm { padding: 0.4rem 0.8rem; font-size: 0.8rem; }

/* Progress Bar */
.lp-progress-bar {
    width: 100%;
    height: 6px;
    background-color: var(--color-border-light, #eee);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 5px;
}
.lp-progress-fill {
    height: 100%;
    background-color: var(--lp-success-color);
    width: 0%; 
    transition: width 0.3s ease;
}

/* Quiz Wizard */
.lp-quiz-step { display: none; }
.lp-quiz-step.active { display: block; animation: fadeIn 0.3s; }
.lp-quiz-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: var(--space-md, 12px);
    margin: var(--space-sm, 8px) 0;
    border: 1px solid var(--color-border, #ddd);
    border-radius: var(--border-radius, 6px);
    cursor: pointer;
    transition: all 0.2s;
}
.lp-quiz-option:hover { background-color: #f5f5f5; }
.lp-quiz-option.selected { border-color: var(--lp-accent-color); background-color: #eaf6fd; }
.lp-quiz-option.correct { background-color: #d4edda; border-color: #c3e6cb; }
.lp-quiz-option.wrong { background-color: #f8d7da; border-color: #f5c6cb; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }


/* =========================================
   UTILITY BLOCKS (exemplar refactoring)
   ========================================= */

/* Tip/Hint box — gelber Akzent */
.lp-tip-box {
    padding: var(--space-sm, 0.75rem);
    background: #fff3cd;
    border-left: 3px solid #ffc107;
    font-size: var(--font-size-sm, 0.9rem);
    border-radius: var(--border-radius, 6px);
    margin-top: var(--space-md, 1rem);
}

/* Stats box — blaues Info-Panel */
.lp-stats-box {
    background: #e3f2fd;
    padding: var(--space-sm, 0.75rem);
}

.lp-stats-box p {
    margin: 0;
    font-size: var(--font-size-sm, 0.9rem);
}

.lp-stats-box .text-muted {
    margin-top: var(--space-xs, 0.25rem);
    font-size: var(--font-size-xs, 0.85rem);
    color: var(--color-text-muted, #666);
}

/* Success box — grüner Erfolgshinweis */
.lp-success-box {
    background: #e8f5e9;
    border-left: 4px solid #4caf50;
    color: #2e7d32;
}

.lp-success-box p {
    margin: 0;
}

/* Full-width button */
.lp-btn--full {
    width: 100%;
    margin: var(--space-md, 1rem) 0;
}

/* Progress wrapper */
.lp-progress-wrapper {
    width: 200px;
    flex-shrink: 0;
}
