/* === Shared variables & base === */
:root {
    --bg-main: #0f172a;
    --bg-card: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --success: #10b981;
    --danger: #ef4444;
}
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    line-height: 1.6;
}

/* === Layout === */
.container { max-width: 800px; width: 100%; }

/* === Header === */
.header { text-align: center; margin-bottom: 20px; }
.header h1 { margin-bottom: 5px; color: #fff; }
.header p { color: var(--text-muted); font-size: 0.95rem; }

/* === Language selector === */
.lang-selector { display: flex; justify-content: center; gap: 4px; margin-top: 12px; }
.lang-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.15);
    color: var(--text-muted);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.lang-btn:hover { color: var(--text-main); border-color: var(--accent); }
.lang-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* === Progress bar === */
.progress-bar { width: 100%; height: 8px; background-color: var(--bg-card); border-radius: 4px; margin-bottom: 20px; overflow: hidden; }
.progress-fill { height: 100%; background-color: var(--accent); width: 0%; transition: width 0.3s ease; }

/* === Cards === */
.card { background-color: var(--bg-card); border-radius: 12px; padding: 30px; box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); display: none; }
.card.active { display: block; animation: fadeIn 0.4s; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* === Quiz question elements === */
.category-badge { display: inline-block; background-color: rgba(59,130,246,0.2); color: #60a5fa; padding: 4px 10px; border-radius: 9999px; font-size: 0.8rem; font-weight: 600; margin-bottom: 15px; text-transform: uppercase; letter-spacing: 0.5px; }
.question-text { font-size: 1.25rem; font-weight: 600; margin-bottom: 20px; }
.options { display: flex; flex-direction: column; gap: 12px; }
.option-btn {
    background-color: rgba(255,255,255,0.05);
    border: 2px solid rgba(255,255,255,0.1);
    color: var(--text-main);
    padding: 15px 20px;
    border-radius: 8px;
    font-size: 1rem;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1.4;
}
.option-btn:hover:not(:disabled) { background-color: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.2); }
.option-btn.correct { background-color: rgba(16,185,129,0.2); border-color: var(--success); }
.option-btn.wrong { background-color: rgba(239,68,68,0.2); border-color: var(--danger); opacity: 0.7; }
.option-btn:disabled { cursor: default; }
.explanation { margin-top: 20px; padding: 15px; background-color: rgba(255,255,255,0.05); border-left: 4px solid var(--accent); border-radius: 4px; font-size: 0.95rem; display: none; }
.explanation.show { display: block; animation: fadeIn 0.4s; }

/* === Controls & buttons === */
.controls { margin-top: 25px; display: flex; justify-content: flex-end; }
.next-btn, .restart-btn { background-color: var(--accent); color: white; border: none; padding: 12px 24px; border-radius: 6px; font-size: 1rem; font-weight: 600; cursor: pointer; transition: background-color 0.2s; display: none; }
.next-btn.show, .restart-btn.show { display: block; }
.next-btn:hover, .restart-btn:hover { background-color: var(--accent-hover); }

/* === Score display === */
.score-display { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 0.9rem; color: var(--text-muted); }
#results-card { text-align: center; }
.final-score { font-size: 4rem; font-weight: 700; color: var(--accent); margin: 20px 0; }

/* === Setup card === */
#setup-card { text-align: center; }

/* === Navigation bar === */
.nav-bar { display: flex; justify-content: space-between; margin-bottom: 16px; }
.nav-btn {
    background: none;
    border: 1px solid rgba(255,255,255,0.15);
    color: var(--text-muted);
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.nav-btn:hover { color: var(--text-main); border-color: var(--accent); background-color: rgba(59,130,246,0.1); }

/* === Batch mode buttons === */
.batch-controls { display: flex; flex-direction: column; gap: 15px; margin: 30px 0; }
.batch-btn { background-color: rgba(255,255,255,0.05); border: 2px solid var(--accent); color: var(--text-main); padding: 15px; border-radius: 8px; font-size: 1.1rem; cursor: pointer; transition: all 0.2s; }
.batch-btn:hover { background-color: var(--accent); }

/* === Back link on setup screen === */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    margin-bottom: 16px;
    transition: color 0.2s;
}
.back-link:hover { color: var(--text-main); }

/* === Footer (injected by layout.js) === */
.footer { margin-top: 24px; text-align: center; color: var(--text-muted); font-size: 0.8rem; }
.footer a { color: var(--text-muted); text-decoration: none; transition: color 0.2s; }
.footer a:hover { color: var(--text-main); }
.footer .contacts { margin-top: 6px; display: flex; justify-content: center; gap: 16px; }

/* === Index page specifics === */
.top-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.subtitle { color: var(--text-muted); margin-bottom: 40px; }
.quiz-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 900px) {
    .quiz-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
    .quiz-grid { grid-template-columns: 1fr; }
    .top-bar { flex-direction: column; align-items: flex-start; gap: 12px; }
}
.quiz-link {
    display: flex;
    flex-direction: column;
    background-color: var(--bg-card);
    border: 2px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 14px 18px;
    text-decoration: none;
    color: var(--text-main);
    transition: all 0.2s;
}
.quiz-link:hover { border-color: var(--accent); background-color: rgba(59,130,246,0.1); }
.quiz-title { font-size: 1.1rem; font-weight: 600; margin-bottom: 6px; }
.quiz-meta { color: var(--text-muted); font-size: 0.85rem; }
