@charset "utf-8";
/**
 * @file        style.css
 * @description Modulares CSS für Mathe-Trainer mit Variablen, Layout, Komponenten, App-Modulen und Feedback-Styles
 * @project     riedersberger.de
 * @version     1.1
 * @since       2026-06-23
 *
 * Änderungen 2026-07-31 20:20:
 * - [ADD] .feedback-success/.feedback-error/.text-strike/.feedback-symbol fehlten
 *         komplett - render_exercise_card.php nutzt diese Klassen für die Feedback-Karte
 *         (falsche Zahl rot+durchgestrichen, ✗-Symbol rot), ohne Definition blieben
 *         Zahl und Symbol farb- und stilios (schwarz, nicht durchgestrichen).
 * @changed 2026-07-31 20:35 - [MOD] .text-strike: waagerechtes text-decoration:
 *          line-through durch schräges Pseudo-Element (::after, rotate(-18deg)) ersetzt.
 * @changed 2026-07-31 21:10 - [MOD] .text-strike::after: Linienfarbe von currentColor
 *          (schwarz, da Zahl seit 21:00 nicht mehr rot ist) auf var(--color-error) (rot)
 *          geändert - Zahl bleibt schwarz, nur der Strich ist rot.
 * @changed 2026-07-31 21:20 - [ADD] .w-100, .mt-2: Utility-Klassen fehlten komplett, obwohl
 *          im Template genutzt (u.a. "Nächste Aufgabe"-Button, sollte volle Breite haben).
 * @changed 2026-07-31 21:20 - [ADD] .solution-box/.solution-box-label/.solution-box-equation:
 *          "Richtige Lösung"-Box zeigt jetzt die komplette Gleichung statt nur der nackten
 *          Zahl, Ergebnis in Grün (feedback-success). .solution-box selbst war zuvor
 *          ebenfalls nirgends definiert.
 * @changed 2026-07-31 21:30 - [ADD] .text-light war komplett undefiniert (Rechenzeichen-
 *          Symbol in der Aufgaben-Anzeige). &nbsp; allein sorgte bei 'Fredoka One' für keinen
 *          sichtbaren Abstand - jetzt zusätzlich echtes CSS-Margin (0.3em) plus die
 *          eigentlich vorgesehene hellere Textfarbe.
 * @changed 2026-07-31 21:40 - [MOD] .btn: font-size (1.3rem) und mehr vertikales Padding
 *          (1.1rem) ergänzt - "Prüfen"/"Nächste Aufgabe" hatten keine eigene Schriftgröße
 *          (Browser-Standard, wirkte neben der 4rem-Aufgabenanzeige winzig) und wenig Höhe.
 *          .btn-large (Start-Button auf index.php) proportional mit angehoben (1.5rem/1.25rem
 *          Padding), damit er weiterhin größer als .btn bleibt.
 * @changed 2026-07-31 22:05 - [FIX] Regression aus 21:40: Änderung betraf pauschal ALLE
 *          .btn-Elemente (Tabs, Nav-Buttons, admin.php-Formulare etc.), sollte aber nur für
 *          "Prüfen"/"Nächste Aufgabe" gelten. .btn und .btn-large auf Ursprungswerte
 *          zurückgesetzt, neue Klasse .btn-submit (padding 1.1rem 1.5rem, font-size 1.3rem)
 *          nur an diesen beiden Buttons (render_exercise_card.php) ergänzt.
 * @changed 2026-07-31 21:50 - [FIX] Regression aus 21:20-Änderung: .solution-box hatte vorher
 *          gar keine eigene Schriftgröße und erbte die 4rem von .aufgabe-display - wirkte
 *          dadurch groß. Die neuen .solution-box-label/.solution-box-equation-Klassen hatten
 *          das versehentlich auf 1rem/2rem verkleinert. Equation zurück auf 4rem (plus
 *          Mobile-Override analog .aufgabe-text), Label auf 1.3rem.
 * @changed 2026-07-31 22:15 - [ADD] .stats-bar/.stat-item/.stat-label/.stat-value fehlten
 *          komplett (render_stats.php nutzt diese Klassen). Neu: .stats-progress-bar/
 *          .stats-progress-segment/.stats-progress-correct/.stats-progress-wrong für die
 *          optionale grün/rote Balkenanzeige (STATS_BAR_ENABLED).
 *
 * Änderungen 2026-07-31 18:55:
 * - [ADD] .btn-secondary fehlte komplett - "Neue Auswahl"/"Beenden" (uebung.php) nutzen
 *         class="btn btn-secondary nav-link", ohne die Klasse fielen sie auf den
 *         Browser-Standard-Linkstil zurück (blau/rot, unterstrichen). Jetzt mit
 *         var(--color-secondary) hinterlegt, analog zu .btn-primary.
 * - [ADD] .nav-buttons (Flex mit Abstand) ergänzt - fehlte ebenfalls, Buttons klebten
 *         ohne Zwischenraum aneinander.
 *
 * Änderungen 2026-07-31:
 * - [FIX] .rechenart-option input:checked + .rechenart-label: aktive Auswahl war rot
 *         (var(--color-primary)) statt grün hinterlegt; nutzt jetzt neue Variablen
 *         --color-success / --color-success-light
 * - [ADD] Variablen --color-success-light, --color-error-light, --color-accent-light ergänzt
 * - [FIX] .btn-large: margin-top ergänzt, Button klebte direkt unter den Rechenarten-Kacheln
 * - [ADD] Neue Sektion 7 (.info-card): löst ungültigen Inline-Gradient in index.php ab
 *         (var(--color-accent-dark)22 existierte nicht und war ungültiges CSS-Syntax,
 *         wodurch der Kartenhintergrund transparent blieb und die Überschrift auf dem
 *         dunklen Body-Hintergrund schwarz/unlesbar wirkte)
 *
 * Änderungen v1.1 (2026-07-15):
 * - [MOD] px → rem: .antwort-input-inline width, body padding in @media (max-width: 768px),
 *         @keyframes slideUp translateY
 * - [REM] -moz-appearance: textfield entfernt (appearance ohne Prefix ausreichend)
 *
 * Mathe-Trainer - Modular CSS
 * 1. Variablen & Basis
 * 2. Layout & Container
 * 3. Komponenten (Buttons, Inputs, Badges)
 * 4. App-Module (Auswahl, Übung, Stats)
 * 5. Feedback & Lernhilfen
 * 6. Responsive Design
 * 7. Info-Karte ("So funktioniert's")
 */

/* ============================================================================
   1. VARIABLEN & BASIS
   ============================================================================ */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&family=Fredoka+One&display=swap');

:root {
    --color-primary: #FF6B6B;
    --color-primary-dark: #EE5A52;
    --color-primary-light: #FFE5E5;
    --color-secondary: #4ECDC4;
    --color-secondary-dark: #45B7AF;
    --color-secondary-light: #E8F8F7;
    --color-accent: #FFE66D;
    --color-accent-light: #FFF6D8;
    --color-success: #51CF66;
    --color-success-light: #E9F9EC;
    --color-error: #FF6B6B;
    --color-error-light: #FFE5E5;
    --color-bg: #F8F9FA;
    --color-bg-card: #FFFFFF;
    --color-text: #2B2D42;
    --color-text-light: #6C757D;
    --color-border: #E9ECEF;

    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.16);
    
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    
    --space-md: 1.5rem;
    --space-lg: 2rem;
    
    --transition-normal: 250ms ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Poppins', sans-serif;
    background: #375D97; /* Ein kräftiges Blau für den Hintergrund */
    color: var(--color-text);
    line-height: 1.6;
    padding: var(--space-md);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3 { font-family: 'Fredoka One', cursive; }

/* ============================================================================
   2. LAYOUT & CONTAINER
   ============================================================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    flex: 1;
}

.card {
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-lg);
    margin-bottom: var(--space-lg);
    animation: slideUp 0.5s ease;
}

.stats-bar {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.stat-item { font-size: 1.1rem; }
.stat-label { color: var(--color-text-light); margin-right: 0.25rem; }
.stat-value { font-weight: 700; }
.stat-value.correct { color: var(--color-success); }
.stat-value.wrong { color: var(--color-error); }

.stats-progress-bar {
    display: flex;
    width: 100%;
    max-width: 400px;
    margin: 0.75rem auto 0;
    height: 2rem;
    border-radius: var(--radius-full);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.stats-progress-segment {
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
    transition: width var(--transition-normal);
    white-space: nowrap;
}

.stats-progress-correct { background: var(--color-success); }
.stats-progress-wrong { background: var(--color-error); }

.header {
    text-align: center;
    margin-bottom: var(--space-lg);
    padding: var(--space-lg);
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(1.25rem); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================================================
   3. KOMPONENTEN (Buttons, Inputs, Badges)
   ============================================================================ */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-normal);
    font-family: 'Poppins', sans-serif;
}

.btn-primary { background: var(--color-success); color: white; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* Nur für die beiden großen Absende-Buttons der Übungskarte ("Prüfen", "Nächste
   Aufgabe"), NICHT für alle .btn - siehe Änderungsprotokoll 2026-07-31 21:40/22:00. */
.btn-submit {
    padding: 1.1rem 1.5rem;
    font-size: 1.3rem;
}

.btn-secondary {
    background: var(--color-secondary);
    color: white;
    text-decoration: none;
}
.btn-secondary:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); background: var(--color-secondary-dark); }
.btn-secondary:visited { color: white; }

.btn-large {
    font-size: 1.2rem;
    padding: 1rem 2rem;
    width: 100%;
    margin-top: var(--space-lg);
}

.nav-buttons {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-top: var(--space-md);
}

.antwort-input {
    width: 100%;
    font-size: 3rem;
    padding: 1rem;
    text-align: center;
    border: 4px solid var(--color-border);
    border-radius: var(--radius-md);
    font-family: 'Fredoka One', cursive;
}

.antwort-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px var(--color-primary-light);
}

.antwort-input-inline {
    display: inline-block !important;
    width: 10rem !important;
    height: auto !important;
    font-size: 4rem !important;
    line-height: 1 !important;
    border: none !important;
    border-bottom: 3px solid #ccc !important;
    background: transparent !important;
    text-align: center !important;
    font-family: 'Fredoka One', cursive, sans-serif !important;
    color: var(--color-text) !important;
    padding: 0 0.5rem !important;
    margin-left: 0.5rem !important;
    outline: none !important;
    box-shadow: none !important; /* Entfernt eventuelle Schatten von anderen Styles */
    appearance: textfield !important; /* Entfernt Spinner-Buttons in Firefox */
}

/* Entfernt die kleinen Pfeile (Spinner) in Chrome/Safari */
.antwort-input-inline::-webkit-outer-spin-button,
.antwort-input-inline::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.info-badge {
    padding: 0.5rem 1rem;
    background: var(--color-primary);
    color: white;
    border-radius: var(--radius-full);
    font-size: 0.9rem;
}

/* ============================================================================
   4. APP-MODULE (Auswahl, Übung, Stats)
   ============================================================================ */

/* Auswahl-Grid */
.rechenarten-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.rechenart-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-lg);
    background: white;
    border: 3px solid var(--color-border);
    border-radius: var(--radius-md);
    cursor: pointer;
}

.rechenart-option input:checked + .rechenart-label {
    border-color: var(--color-success);
    background: var(--color-success-light);
}

/* Übungsbereich */
.aufgabe-display {
    text-align: center;
    padding: 3rem;
    background: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%);
    border-radius: var(--radius-lg);
    font-size: 4rem;
    font-family: 'Fredoka One', cursive;
}

.timer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: bold;
}

/* Statistik */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    text-align: center;
}

.stat-card-value {
    font-size: 2.5rem;
    color: var(--color-primary);
    display: block;
}

/* ============================================================================
   5. FEEDBACK & LERNHILFEN
   ============================================================================ */
.feedback-card {
    margin-top: 2rem;
    padding: 2rem;
    border-radius: var(--radius-lg);
    text-align: center;
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.feedback-correct { background: var(--color-success); color: white; }
.feedback-wrong { background: var(--color-error); color: white; }

.feedback-success { color: var(--color-success); }
.feedback-error { color: var(--color-error); }

/* Schräger Strich statt text-decoration: line-through (die wäre waagerecht) */
.text-strike {
    position: relative;
    display: inline-block;
}
.text-strike::after {
    content: '';
    position: absolute;
    left: -8%;
    top: 50%;
    width: 116%;
    height: 0.08em;
    background: var(--color-error);
    transform: rotate(-18deg);
    transform-origin: center;
}

.feedback-symbol { margin-left: 0.5rem; }

.solution-box {
    margin-top: 1.5rem;
    padding: 1rem 1.5rem;
    background: var(--color-success-light);
    border-radius: var(--radius-md);
}

.solution-box-label {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--color-text-light);
    margin-bottom: 0.5rem;
}

.solution-box-equation {
    font-family: 'Fredoka One', cursive;
    font-size: 4rem;
}

.visual-help {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: var(--radius-md);
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.visual-symbol { font-size: 2rem; }

@keyframes popIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

/* ============================================================================
   6. RESPONSIVE DESIGN & UTILS
   ============================================================================ */
@media (max-width: 768px) {
    body { padding: 0.625rem; }
    .aufgabe-text { font-size: 2.5rem; }
    .solution-box-equation { font-size: 2.5rem; }
    .header h1 { font-size: 2rem; }
}

.hidden { display: none !important; }
.text-center { text-align: center; }
.w-100 { width: 100%; }
.mt-2 { margin-top: 0.5rem; }

/* Rechenzeichen-Symbol in der Aufgaben-Anzeige: &nbsp; allein reicht bei
   'Fredoka One' nicht als sichtbarer Abstand, daher zusätzlich echtes CSS-Margin. */
.text-light {
    color: var(--color-text-light);
    margin: 0 0.3em;
}

/* ============================================================================
   7. INFO-KARTE ("So funktioniert's")
   ============================================================================ */
.info-card {
    background: linear-gradient(135deg, var(--color-secondary-light), var(--color-accent-light));
}

.info-card h3 {
    color: var(--color-text);
}

.info-card ul {
    list-style: none;
    padding: 0;
    line-height: 2;
    color: var(--color-text);
}
/* ============================================================================
   8. FOOTER
   ============================================================================ */
.footer-legal {
	margin-top: 2rem;
	padding: 1rem;
	text-align: center;
	font-size: 0.85rem;
	color: var(--color-text-light);
	border-top: 1px solid var(--color-border);
}

.footer-legal a {
	color: var(--color-text-light);
	text-decoration: none;
}

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

.footer-sep {
	margin: 0 0.5rem;
	color: var(--color-text-light);
}
