/* style.css - Das komplette Design (Layout & Komponenten) */

:root {
    /* Farben */
    --primary: #2563eb;       /* Das schöne Blau */
    --primary-hover: #1d4ed8;
    --text-dark: #0f172a;     /* Dunkle Schrift */
    --text-medium: #64748b;   /* Graue Schrift */
    --bg-page: #f8fafc;       /* Heller Hintergrund */
    --white: #ffffff;
    --border: #e2e8f0;        /* Feine graue Linien */
    
    /* Feedback Farben */
    --success: #16a34a;
    --success-bg: #dcfce7;
    --error: #ef4444;
    --error-bg: #fee2e2;
    
    /* Schatten für den "Karten-Look" */
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-active: 0 0 0 3px rgba(37, 99, 235, 0.3);
}

/* --- GRUNDLAGEN --- */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-page);
    color: var(--text-dark);
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
button, input { font-family: inherit; }

.page-wrapper {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    padding-bottom: 100px;
}

/* --- LAYOUT: HEADER --- */
.header-bar {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    padding-top: 15px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1000px;
    margin: 0 auto 15px auto;
    padding: 0 20px;
    gap: 20px;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    gap: 8px;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-dark);
}
.logo-icon { font-size: 26px; }
.logo-re { color: var(--primary); }
.logo-mint { color: #10b981; }

/* Suche */
.search-container {
    flex: 1;
    max-width: 400px;
    position: relative;
    display: none; 
}
@media (min-width: 600px) { .search-container { display: block; } }

.search-input {
    width: 100%;
    background: #f1f5f9;
    border: 1px solid transparent;
    padding: 10px 15px 10px 40px;
    border-radius: 12px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
}
.search-input:focus { 
    background: white; 
    border-color: var(--primary); 
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); 
}
.search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #94a3b8; }

/* User Actions */
.user-actions { display: flex; gap: 10px; }
.action-btn {
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-medium);
    padding: 8px 12px;
    border-radius: 8px;
    transition: background 0.2s;
}
.action-btn:hover { background: #f1f5f9; }
.btn-donate {
    background: #22c55e;
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 700;
    text-decoration: none;
}

/* --- LAYOUT: HAUPT-NAVIGATION (Tabs) --- */
.nav-row {
    display: flex;
    gap: 12px; /* Mehr Abstand */
    overflow-x: auto;
    padding: 0 20px 20px 20px;
    max-width: 1000px;
    margin: 0 auto;
    scrollbar-width: none;
}
.nav-row::-webkit-scrollbar { display: none; }

/* Die Tabs als weiße Karten */
.nav-pill {
    background: var(--white);
    border: 1px solid var(--border);
    padding: 10px 20px;
    border-radius: 12px;
    font-weight: 600;
    color: var(--text-dark);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-pill:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* Aktiver Tab (Blau) */
.nav-pill.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* --- LAYOUT: FILTER (A1, A2...) --- */
.nav-scroll-wrapper {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
    padding: 0 10px;
}

.nav-chip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;      
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 16px;     
    font-weight: 700;
    font-size: 15px;
    color: var(--text-medium);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
    min-width: 80px;         
}

.nav-chip:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    color: var(--primary);
    border-color: #cbd5e1;
}

.nav-chip.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.nav-break { flex-basis: 100%; height: 10px; }
.nav-divider { display: none; }

/* --- CONTENT GRID --- */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

/* --- TRAINER COMPONENTS --- */
.trainer-mode { padding-bottom: 15px; }
.back-btn {
    text-decoration: none;
    font-size: 24px;
    color: var(--text-medium);
    margin-right: 15px;
}
.trainer-info { display: flex; flex-direction: column; }
.badge-trainer {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--primary);
    letter-spacing: 1px;
}
#crumb-topic { font-weight: 700; color: var(--text-dark); }

/* Inputs & Choice Buttons */
.gap-input {
    font-family: inherit;
    font-size: 18px;
    font-weight: 600;
    color: var(--primary);
    background: #f1f5f9;
    border: 2px solid #cbd5e1;
    border-radius: 8px;
    padding: 6px 10px;
    text-align: center;
    outline: none;
    transition: all 0.2s;
    min-width: 60px;
    margin: 0 4px;
}
.gap-input:focus {
    background: var(--white);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.choice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 20px;
}
.choice-btn {
    background: var(--white);
    border: 2px solid var(--border);
    padding: 18px;
    border-radius: 14px;
    text-align: center;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-dark);
}
.choice-btn:hover { background: #f8fafc; border-color: #94a3b8; }
.choice-btn.selected {
    background: #eff6ff;
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.15);
}

.word-bank { font-family: monospace; letter-spacing: -0.5px; }

/* Buttons */
.btn-check {
    background: var(--primary);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.1s, background 0.2s;
    text-decoration: none;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.2);
}
.btn-check:hover { background: var(--primary-hover); transform: translateY(-1px); }
.btn-check:active { transform: scale(0.98); }

.btn-solve-mini {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-medium);
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn-solve-mini:hover { background: #f1f5f9; border-color: #cbd5e1; }

/* Keyboard */
#virtual-keyboard {
    background: #cbd5e1;
    padding: 10px 5px 25px 5px;
    border-top: 1px solid #94a3b8;
    user-select: none;
}
.kb-key {
    background: var(--white);
    border: none;
    border-radius: 6px;
    height: 48px;
    min-width: 32px;
    flex: 1;
    font-size: 18px;
    color: var(--text-dark);
    font-weight: 500;
    box-shadow: 0 2px 0 #94a3b8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.kb-key:active { transform: translateY(2px); box-shadow: none; }
.num-key { background: #e2e8f0; font-weight: 700; font-size: 16px; height: 38px; }
.action { background: #64748b; color: white; box-shadow: 0 2px 0 #334155; }
.bg-red { background: #ef4444; box-shadow: 0 2px 0 #b91c1c; color: white; }

/* --- FOOTER --- */
.footer {
    border-top: 1px solid var(--border);
    margin-top: 80px;
    padding: 40px 20px;
    text-align: center;
    color: #94a3b8;
    font-size: 14px;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}
.shake { animation: shake 0.3s ease-in-out; }

/* Mobile Anpassungen */
@media (max-width: 600px) {
    .header-top { flex-direction: column; align-items: flex-start; gap: 15px; }
    .user-actions { position: absolute; top: 15px; right: 20px; }
    .nav-row { padding-bottom: 15px; }
    .nav-pill { padding: 8px 16px; font-size: 14px; }
    .nav-chip { padding: 10px 18px; font-size: 14px; min-width: 60px; }
}