:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #ec4899;
    --accent: #14b8a6;
    --danger: #ef4444;
    --success: #22c55e;
    --background: #f8fafc;
    --surface: #ffffff;
    --text: #1e293b;
    --text-light: #64748b;
    --border: #e2e8f0;
    --radius: 16px;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--background);
    color: var(--text);
    line-height: 1.5;
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

#app {
    width: 100%;
    max-width: 600px;
    background: var(--surface);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    box-shadow: 0 0 20px rgba(0,0,0,0.05);
}

/* Header */
.app-header {
    padding: 1rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.app-header h1 {
    font-size: 1.25rem;
    font-weight: 700;
}

.nav-btn {
    background: none;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    font-family: inherit;
    padding: 0.5rem;
}

/* Views */
.view {
    display: none;
    padding: 1.5rem;
    flex: 1;
    animation: fadeIn 0.3s ease;
}

.view.active {
    display: block;
}

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

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.stat-card {
    background: var(--background);
    padding: 1rem;
    border-radius: var(--radius);
    text-align: center;
    border: 1px solid var(--border);
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-light);
}

/* Buttons & Inputs */
.card-group {
    background: white;
    border: 1px solid var(--border);
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
}

.card-group h4 {
    margin-bottom: 0.75rem;
    color: var(--text-light);
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
}

.button-row {
    display: flex;
    gap: 0.5rem;
}

.mode-btn {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s, opacity 0.2s;
    font-family: inherit;
    font-size: 0.95rem;
}

.mode-btn:active {
    transform: scale(0.96);
}

.mode-btn.primary { background: var(--primary); color: white; }
.mode-btn.secondary { background: var(--secondary); color: white; }
.mode-btn.accent { background: var(--accent); color: white; }
.mode-btn.danger { background: var(--danger); color: white; }
.mode-btn.full-width { width: 100%; }

/* Game Area */
.progress-bar-container {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    margin-bottom: 2rem;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--success);
    width: 0%;
    transition: width 0.3s ease;
}

.card-display {
    text-align: center;
    margin: 2rem 0;
}

.question-text {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text);
}

.context-label {
    display: inline-block;
    background: var(--background);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 2rem;
    border: 1px solid var(--border);
}

/* Flashcard Specific */
.flashcard {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: var(--shadow);
    cursor: pointer;
    perspective: 1000px;
    transition: transform 0.3s;
}

.flashcard-content {
    width: 100%;
}

.flashcard-answer {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    animation: fadeIn 0.3s;
}

.answer-text {
    font-size: 1.5rem;
    color: var(--primary);
    font-weight: 600;
}

/* Inputs */
.input-area {
    margin-bottom: 2rem;
}

.answer-input {
    width: 100%;
    padding: 1rem;
    font-size: 1.2rem;
    border: 2px solid var(--border);
    border-radius: 12px;
    text-align: center;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.answer-input:focus {
    border-color: var(--primary);
}

/* QCM */
.qcm-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.qcm-btn {
    padding: 1.5rem 1rem;
    background: white;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.qcm-btn:hover {
    border-color: var(--primary-dark);
}

.qcm-btn.correct {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

.qcm-btn.wrong {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}

/* Feedback Section */
.feedback-container {
    margin-top: 2rem;
    padding: 1.5rem;
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    text-align: left;
    animation: slideUp 0.3s ease;
}

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

.feedback-container.correct-feedback {
    border-left: 5px solid var(--success);
}

.feedback-container.wrong-feedback {
    border-left: 5px solid var(--danger);
}

.example-sentence {
    font-style: italic;
    color: var(--text-light);
    margin-top: 0.5rem;
    display: block;
}

/* Utility */
.hidden { display: none !important; }
.margin-bottom { margin-bottom: 2rem; }

footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-light);
    font-size: 0.8rem;
    margin-top: auto;
}
