/* assets/css/ui.css */
/* Version: DIAMANT COMPLETE (Backup Badges + Editor Fixes) */

/* ============================================================ */
/* 0. FONTS */
/* ============================================================ */
/*@font-face {
    font-family: 'CustomFont1';
    src: url('../fonts/Prima-Regular.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}*/

/* ============================================================ */
/* 1. GLOBALES SETUP */
/* ============================================================ */
body {
    min-height: 100vh;
    padding: 20px;
    font-family: 'CustomFont1', system-ui, -apple-system, sans-serif;
    color: #333;
    margin: 0;
    
    /* Hintergrundbild fixiert */
    background: url('/assets/img/bg.png') no-repeat center center fixed; 
    background-size: cover;
}

h1, h2 { margin-top: 0; color: #1e293b; }
* { font-style: normal; } /* Reset Kursiv */

/* ============================================================ */
/* 2. LAYOUT & CONTAINER (Transparenz 65%) */
/* ============================================================ */
.container-box, 
.admin-container,
.sammlung-container,
.editor-container,
.confirm-box {
    width: 100%; 
    max-width: 1200px; 
    margin: 40px auto; 
    padding: 30px;
    
    /* 65% Deckkraft (Milchglas) */
    background-color: rgba(255, 255, 255, 0.65); 
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);

    text-align: center;

    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15); 
    
    /* WICHTIG: Verhindert Überlauf */
    box-sizing: border-box; 
    border: 1px solid rgba(255,255,255,0.4);
}

/* ADMIN LIST DESIGN */
.admin-row {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #e2e8f0; 
    padding: 15px; 
    border-radius: 8px; 
    display: flex; justify-content: space-between; align-items: center; 
    margin-bottom: 10px; transition: all 0.2s;
}
.admin-row:hover { transform: translateY(-2px); box-shadow: 0 4px 6px rgba(0,0,0,0.05); }

.admin-row.header-box {
    margin-bottom: 25px;
    background-color: rgba(255, 255, 255, 0.95);
    border-bottom: 2px solid #e2e8f0;
}

.admin-info { display: flex; flex-direction: column; text-align: left; }
.admin-actions { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.admin-actions form { margin: 0; padding: 0; display: flex; }

@media (max-width: 700px) {
    .container-box, .admin-container { width: 95%; padding: 15px; margin: 20px auto; }
    .admin-row { flex-direction: column; align-items: flex-start; gap: 15px; }
    .admin-actions { width: 100%; justify-content: flex-start; flex-wrap: wrap; }
}
/* assets/css/ui.css */

/* === ZENTRALE TYPOGRAFIE FÜR SPIELE === */

/* Der Titel in der Box */
.container-box h1 {
    text-align: center !important; /* Erzwingt Zentrierung */
    font-size: 2.5rem;             /* Schöne, große Größe */
    margin-bottom: 15px;
    color: #1e293b;                /* Dunkles Grau/Blau */
    font-weight: 800;
}

/* Die Anweisung darunter */
.instruction {
    text-align: center !important;
    font-size: 1.25rem;            /* Gut lesbar */
    color: #64748b;                /* Etwas heller */
    margin-top: -10px;
    margin-bottom: 30px;
    line-height: 1.5;
    display: block;
}

/* Mobil-Anpassung */
@media (max-width: 600px) {
    .container-box h1 { font-size: 1.8rem; }
    .instruction { font-size: 1rem; }
}

/* ============================================================ */
/* 3. BUTTONS (Standard Breite 120px) */
/* ============================================================ */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 12px 15px;
    
    /* Fixe Breite für Index-Buttons */
    min-width: 120px;       
    width: 120px;           
    flex: 0 0 auto;         
    
    border-radius: 4px;
    font-family: sans-serif; font-weight: 700; font-size: 1rem;
    text-decoration: none !important; cursor: pointer; transition: all 0.2s ease;
    border: 1px solid transparent; box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    text-align: center;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 3px 5px rgba(0,0,0,0.15); }

/* Größen */
.btn-sm { padding: 10px 10px; font-size: 0.8rem; }
.btn-lg { padding: 15px 30px; font-size: 1.2rem; }

/* Farben */
.btn-play, .btn-primary { background-color: #007bff; color: white; }
.btn-play:hover { background-color: #0056b3; }

.btn-edit { background-color: #ffc107; color: #000; border-color: #ffc107; }
.btn-edit:hover { background-color: #e0a800; }

.btn-share { background-color: #d63384; color: white; }
.btn-share:hover { background-color: #a91e63; }

.btn-exists { background-color: #e6e9ed; color: #1e1f20; border: 1px solid #94a3b8; cursor: default; box-shadow: none; font-weight: bold; }

.btn-new, .btn-success { background-color: #28a745; color: white; width: auto; min-width: 140px; }
.btn-new:hover { background-color: #1e7e34; }

.btn-del, .btn-danger { background-color: #dc3545; color: white; }
.btn-del:hover { background-color: #c82333; }

.btn-back, .btn-secondary { background-color: #e9ecef; color: #495057; border-color: #dee2e6; }
.btn-back:hover { background-color: #dde2e6; color: #212529; }

/* ============================================================ */
/* 4. ICON BUTTONS (Minimal Style) */
/* ============================================================ */
.btn-minimal {
    background-color: transparent; color: #64748b; padding: 0;
    min-width: 38px !important; width: 38px !important; height: 38px; /* Reset */
    border-radius: 8px; display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid transparent; cursor: pointer;
}
.btn-minimal svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; }
.btn-minimal:hover { transform: translateY(-2px); background-color: #f1f5f9; color: #334155; }

/* Bunte Hover Effekte */
.btn-minimal.video:hover { background-color: #eff6ff; color: #3b82f6; border-color: #dbeafe; }
.btn-minimal.home:hover, .btn-minimal.list:hover { background-color: #f0fdfa; color: #14b8a6; border-color: #ccfbf1; }
.btn-minimal.import:hover, .btn-minimal.export:hover { background-color: #eef2ff; color: #6366f1; border-color: #e0e7ff; }
.btn-minimal.email:hover { background-color: #e0f2fe; color: #0ea5e9; border-color: #bae6fd; }
.btn-minimal.del:hover { background-color: #fee2e2; color: #ef4444; border-color: #fee2e2; }

/* ============================================================ */
/* 5. BADGES & STATISTIK (Wiederhergestellt aus Backup!) */
/* ============================================================ */
.badge {
    display: inline-flex; align-items: center;
    padding: 3px 5px; border-radius: 12px;
    font-size: 0.5rem; font-weight: bold; text-transform: uppercase;
    margin-left: 1px; vertical-align: middle; white-space: nowrap;
}
.badge-views { background: #f3f4f6; color: #374151; border: 1px solid #d1d5db; }
.badge-passed, .badge-perfect { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.badge-hs { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }

/* Lösch-Badge für Highscores */
.badge-del-hs { 
    background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; 
    cursor: pointer; transition: all 0.2s; padding: 2px 6px;
}
.badge-del-hs:hover { background-color: #ef4444; color: #ffffff; }
.badge-del-hs svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; }

/* Statistik Zusammenfassung (Pille) */
.stats-summary { 
    color: #64748b; font-size: 0.85rem; 
    background: #fff; padding: 5px 15px; border-radius: 20px; 
    box-shadow: 0 1px 3px rgba(0,0,0,0.1); display: inline-block;
}

/* Badge für Optionen (Zufall, Auto, etc.) */
.badge-option {
    background: #e0f2fe; color: #0369a1; border: 1px solid #bae6fd; font-weight: 600;
}

/* ============================================================ */
/* 6. FLASH MESSAGES */
/* ============================================================ */
.notice { 
    padding: 1rem; border-radius: 8px; margin-bottom: 1.5rem; 
    border: 1px solid transparent; display: flex; align-items: center; gap: 10px;
}
.notice.success { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.notice.error { background: #fee2e2; color: #991b1b; border-color: #fecaca; }

/* ============================================================ */
/* 7. UTILITIES & HELPER */
/* ============================================================ */
.hidden { display: none !important; }
.text-center { text-align: center; }
.highlight-blue { 
    color: #007bff; /* !important erzwingt die Farbe, falls was anderes stört */
    font-weight: bold; 
}

/* ============================================================ */
/* 8. APP-SPEZIFISCHE LAYOUTS (Blitzlesen etc.) */
/* ============================================================ */
#blitzlesenContainer {
    max-width: 850px; margin-top: 60px; text-align: center;
}
@media (max-width: 700px) {
    #blitzlesenContainer { max-width: 95%; margin-top: 20px; }
}

/* Spezial-Buttons im Spiel */
#startBtn { 
    font-size: 1.5rem; padding: 20px 40px; border-radius: 50px; 
    box-shadow: 0 5px 15px rgba(0, 123, 255, 0.4); transition: transform 0.2s;
    width: auto; min-width: 200px; /* Groß */
}
#startBtn:hover { transform: scale(1.05) translateY(-2px); }

#nextBtn { width: 100%; margin-top: 20px; font-size: 1.2rem; }

#restartBtn { 
    background-color: transparent; color: #64748b; border: 2px solid #cbd5e1; width: auto;
}

/* Wrapper für Titel & Anweisung */
.instruction-wrapper {
    display: flex; flex-direction: column; align-items: center;
    gap: 8px; margin-top: -10px; margin-bottom: 20px; width: 100%;
}
.instruction-text {
    font-size: 1.1em; color: #333; margin: 0; max-width: 80%; text-align: center;
}

/* Der Badge für das Bestenlisten-Ziel (Weiß/Blau) */
.hs-target-box, .hs-notice {
    display: inline-flex; align-items: center; padding: 5px 15px;
    background-color: rgba(255, 255, 255, 0.5); 
    border: 1px solid rgba(0, 0, 0, 0.1); border-radius: 12px;
    font-size: 0.9em; color: #555; margin-top: 5px;
    box-shadow: none;
}
.hs-target-number { font-weight: bold; color: #0284c7; }

/* ============================================================ */
/* 9. SPIELFELDER (FIX: Box-Sizing gegen Überlauf) */
/* ============================================================ */
#displayArea, #gameBoard, #sortingArea, #sentenceArea {
    min-height: 250px; width: 100%;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    margin: 20px 0; position: relative;
    
    background-color: #007bff; color: white;
    border-radius: 12px; padding: 40px 20px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1); text-align: center;

    box-sizing: border-box; /* FIX! */
}

/* Feedback Farben (95% Opacity) */
.field-correct, .exercise-correct { 
    background-color: rgba(34, 197, 94, 0.95) !important; 
    border: 2px solid #22c55e !important; color: #fff !important;
}
.field-incorrect, .exercise-error { 
    background-color: rgba(239, 68, 68, 0.95) !important; 
    border: 2px solid #ef4444 !important; color: #fff !important;
}

/* ============================================================ */
/* 10. HIGHSCORE TABELLE & LISTEN */
/* ============================================================ */
.highscore-wrapper { margin-top: 40px; padding-top: 20px; border-top: 1px solid rgba(0,0,0,0.1); }
.hs-table {
    width: 100%; table-layout: fixed; border-collapse: collapse; margin-top: 15px;
    background-color: rgba(255,255,255,0.5); border-radius: 8px; overflow: hidden;
}
.hs-table th { background-color: rgba(0,0,0,0.05); color: #475569; font-weight: 600; padding: 12px 8px; text-align: center; font-size: 0.75rem; text-transform: uppercase; }
.hs-table td { padding: 10px 8px; border-bottom: 1px solid rgba(0,0,0,0.05); color: #334155; font-size: 0.9rem; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Eingabe Box */
.hs-input-box {
    margin: 20px auto; padding: 20px; background-color: #f8fafc;
    border: 2px solid #e2e8f0; border-radius: 12px; text-align: center; max-width: 600px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05); animation: fadeIn 0.5s ease;
}
.hs-input-row { display: flex; gap: 10px; justify-content: center; margin-top: 15px; }
#central-hs-name { padding: 10px; border: 2px solid #cbd5e1; border-radius: 8px; text-align: center; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

/* Index Listen Design */
.exercise-list { list-style: none; padding: 0; margin-top: 20px; }
.exercise-item { 
    background: rgba(255, 255, 255, 0.8); border: 1px solid #e2e8f0; 
    padding: 15px; margin-bottom: 10px; border-radius: 8px; 
    display: flex; justify-content: space-between; align-items: center; 
    transition: transform 0.2s, box-shadow 0.2s;
}
.exercise-item:hover { transform: translateY(-2px); box-shadow: 0 4px 6px rgba(0,0,0,0.05); background: rgba(255, 255, 255, 0.95); }
.exercise-info { display: flex; flex-direction: column; text-align: left; }
.exercise-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 5px; color: #1e293b; text-decoration: none; }
.exercise-meta { font-size: 0.85rem; color: #64748b; }
.actions { display: flex; gap: 8px; align-items: center; }

/* Progress Bar */
#progressBar { height: 12px; background: #e5e7eb; border-radius: 6px; margin: 15px 0; overflow: hidden; }
#progressBarInner { height: 100%; background: #007bff; width: 0%; transition: width 0.3s ease; }


/* ============================================================ */
/* 11. ÜBERSICHTSSEITE SPEZIFISCH (uebersicht.php) */
/* ============================================================ */

/* Header Title */
.header-title {
    margin: 0;
    font-size: 1.8em;
}

/* Import Form */
.import-form {
    display: flex;
    align-items: center;
}

/* Verstecktes File Input */
.hidden-file-input {
    display: none;
}

/* Empty State (Keine Übungen) */
.empty-state {
    justify-content: center;
    color: #666;
}

/* Exercise List Reset */
.exercise-list-reset {
    padding: 0;
    margin: 0;
    list-style: none;
}

/* Exercise Title Container */
.exercise-title-container {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

/* Exercise Title Text */
.exercise-title-text {
    font-size: 1.1rem;
    font-weight: bold;
}

/* Exercise Date/Last Modified */
.exercise-date {
    font-size: 0.85em;
    font-weight: normal;
    color: #94a3b8;
}

/* Exercise Meta Container */
.exercise-meta-container {
    margin-top: 5px;
}

/* Meta String (Dauer, Zeit etc.) */
.meta-time {
    color: #64748b;
    margin-left: 5px;
    margin-right: 5px;
}

/* Disabled Button State */
.btn-disabled {
    opacity: 0.2;
    cursor: default;
}

/* Email Form */
.email-form {
    display: inline-flex;
}

/* ============================================================ */
/* 12. EDITOR STYLES (GLOBALE FORM STYLES) */
/* ============================================================ */

/* Editor Form Base Styles (für alle editors) */
.editor-form label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
    margin-top: 15px;
    font-size: 0.95rem;
}

.editor-form input,
.editor-form textarea,
.editor-form select {
    width: 100%;
    padding: 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 15px;
}

.editor-form textarea {
    min-height: 200px;
    font-family: monospace;
}

/* Checkbox Items (allgemein) */
.checkbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 0;
}

.checkbox-item label {
    margin: 0;
    font-weight: normal;
    cursor: pointer;
}

.checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}
/* ============================================================ */
/* NEU: SEGMENTIERTER FORTSCHRITTSBALKEN */
/* ============================================================ */
.progress-container {
    display: flex;
    gap: 4px; /* Abstand zwischen den Blöcken */
    height: 12px;
    width: 100%;
    margin-top: 10px;
}

.progress-segment {
    flex: 1; /* Alle Segmente gleich breit */
    background-color: #e2e8f0;
    border-radius: 3px;
    transition: background-color 0.3s;
}

.progress-segment.filled {
    background-color: #3b82f6; /* Blau */
}

.progress-segment.correct {
    background-color: #22c55e; /* Grün (optional für später) */
}

.progress-segment.wrong {
    background-color: #ef4444; /* Rot (optional für später) */
}