:root {
    --bg-color: #0f172a;
    --text-color: #f8fafc;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --correct: #10b981;
    --incorrect: #ef4444;
    --card-bg: rgba(30, 41, 59, 0.5);
    --btn-bg: rgba(255, 255, 255, 0.05);
}

.light-mode {
    --bg-color: #f8fafc;
    --text-color: #0f172a;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --glass-bg: #ffffff;
    --glass-border: #e2e8f0;
    --card-bg: #ffffff;
    --btn-bg: #f1f5f9;
}

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

html {
    font-size: 11.5px; /* Scaled down further */
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background 0.3s, color 0.3s;
}

.app-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem;
    width: 100%;
}

.minimal-header {
    background: transparent;
    border: none;
    padding: 1rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.logo {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 0.5rem; /* for scrollbar spacing */
    scrollbar-width: none; /* Firefox */
}

.nav-links::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.nav-btn {
    background: transparent;
    border: none;
    color: #64748b;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.2rem 0;
    white-space: nowrap;
    transition: color 0.2s;
    position: relative;
}

.nav-btn:hover {
    color: var(--text-color);
    background: transparent;
}

.nav-btn.active {
    color: var(--primary);
    background: transparent;
}

.nav-btn.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary);
    border-radius: 2px;
}

.theme-btn {
    background: transparent;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
}

.main-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.minimal-card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1rem;
    animation: fadeIn 0.4s ease;
}

.section-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.section-desc {
    color: #64748b;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.minimal-stmt {
    margin-bottom: 0.8rem;
}

.statement-text {
    font-size: 1.05rem;
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.q-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.question-text {
    font-weight: 600;
    font-size: 1.05rem;
}

.q-edit-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.q-edit-btn:hover {
    opacity: 1;
}

.q-edit-btn.active {
    opacity: 1;
    transform: scale(1.1);
}

.minimal-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.35rem;
}

.minimal-btn {
    background: var(--btn-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-color);
    padding: 0.8rem 1rem;
    border-radius: 6px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.95rem;
}

.minimal-btn:hover:not(:disabled) {
    border-color: var(--primary);
}

.minimal-btn.correct {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--correct);
    color: var(--correct);
}

.minimal-btn.incorrect {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--incorrect);
    color: var(--incorrect);
}

.minimal-btn.edit-active {
    border-color: #eab308;
    background: rgba(234, 179, 8, 0.05);
}

.minimal-btn:disabled {
    cursor: default;
    opacity: 0.7;
}

.next-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 0.5rem;
    transition: background 0.2s;
}

.next-btn:hover {
    background: var(--primary-hover);
}

/* Schreiben Styling */
.schreiben-situation {
    background: rgba(59, 130, 246, 0.05);
    border-left: 3px solid var(--primary);
    padding: 1rem;
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

.schreiben-stichpunkte {
    list-style-type: none;
    margin-bottom: 1.5rem;
}

.schreiben-stichpunkte li {
    margin-bottom: 0.5rem;
    padding-left: 1rem;
    position: relative;
}

.schreiben-stichpunkte li::before {
    content: "•";
    color: var(--primary);
    position: absolute;
    left: 0;
}

.schreiben-textarea {
    width: 100%;
    min-height: 200px;
    background: var(--btn-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-color);
    padding: 1rem;
    border-radius: 6px;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 1rem;
}

.schreiben-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.word-counter {
    text-align: right;
    font-size: 0.85rem;
    color: var(--text-color);
    margin-top: 0.2rem;
    margin-bottom: 1rem;
    font-weight: 500;
}

.schreiben-hints-btn {
    background: var(--btn-bg);
    color: var(--text-color);
    border: 1px solid var(--glass-border);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
}

.schreiben-hints {
    display: none;
    margin-top: 1rem;
    padding: 1rem;
    background: var(--btn-bg);
    border-radius: 6px;
}

.schreiben-hints.visible {
    display: block;
}

/* Sprachbausteine Styling */
.text-with-gaps {
    font-size: 1.05rem;
    line-height: 1.8;
    white-space: pre-wrap;
}

.minimal-select {
    background: var(--btn-bg);
    color: var(--text-color);
    border: 1px solid var(--glass-border);
    border-radius: 4px;
    padding: 0.2rem;
    font-size: 1rem;
    outline: none;
}

.minimal-select.correct {
    color: var(--correct);
    border-color: var(--correct);
}

.minimal-select.incorrect {
    color: var(--incorrect);
    border-color: var(--incorrect);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.ai-feedback {
    display: none;
    margin-top: 1rem;
    padding: 1rem;
    background: var(--btn-bg);
    border: 1px solid var(--primary);
    border-radius: 8px;
    animation: fadeIn 0.4s ease;
    line-height: 1.4;
    font-size: 0.9rem;
}

.ai-feedback.visible {
    display: block;
}

.ai-feedback h3 {
    color: var(--primary);
    margin-top: 1rem;
    margin-bottom: 0.3rem;
    font-size: 1rem;
}

.ai-feedback h3:first-child {
    margin-top: 0;
}

.ai-feedback p {
    margin-bottom: 0.8rem;
}

.ai-feedback ul {
    margin-left: 1.2rem;
    margin-bottom: 0.8rem;
}

.ai-feedback li {
    margin-bottom: 0.3rem;
}

@media (max-width: 640px) {
    .minimal-header {
        flex-wrap: wrap;
    }
    .nav-links {
        width: 100%;
        justify-content: flex-start;
        order: 3;
        margin-top: 0.5rem;
    }
    .app-container {
        padding: 0.5rem 1rem;
    }
}
