:root {
    --primary: #2563eb; --primary-hover: #1d4ed8;
    --bg-color: #f8fafc; --card-bg: #ffffff;
    --text-main: #0f172a; --text-muted: #64748b;
    --green: #16a34a; --amber: #d97706; --red: #dc2626;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }

body { background-color: var(--bg-color); display: flex; justify-content: center; min-height: 100vh; color: var(--text-main); }

#app-container {
    width: 100%; max-width: 480px; background: var(--card-bg); 
    box-shadow: 0 4px 20px rgba(0,0,0,0.05); position: relative; overflow: hidden;
}

.screen { display: none; padding: 24px; height: 100%; flex-direction: column; }
.screen.active { display: flex; animation: fadeIn 0.3s ease; }

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

/* Typography & Layout */
h1 { font-size: 1.8rem; margin-bottom: 8px; text-align: center; margin-top: 40px;}
h2 { font-size: 1.4rem; margin-bottom: 24px; line-height: 1.4; }
p { color: var(--text-muted); text-align: center; margin-bottom: 30px; }

/* Buttons */
button { width: 100%; padding: 16px; border-radius: 12px; font-size: 1.1rem; font-weight: 600; cursor: pointer; border: none; transition: all 0.2s; margin-bottom: 12px; }
.primary-btn { background: var(--primary); color: white; }
.primary-btn:active { background: var(--primary-hover); transform: scale(0.98); }
.secondary-btn { background: #f0e2e7; color: var(--text-main); }
.option-btn { background: white; border: 2px solid #e2e8f0; color: var(--text-main); text-align: left; }
.option-btn:active { border-color: var(--primary); background: #eff6ff; }

/* Header & Progress */
.header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
#cat-badge { background: #eff6ff; color: var(--primary); padding: 4px 12px; border-radius: 20px; font-size: 0.85rem; font-weight: bold; text-transform: uppercase;}
.progress-bar { height: 8px; background: #e2e8f0; border-radius: 4px; margin-bottom: 32px; overflow: hidden; }
#progress-fill { height: 100%; background: var(--primary); width: 0%; transition: width 0.3s ease; }

/* Summary & Review */
.score-display { font-size: 4rem; font-weight: 800; text-align: center; color: var(--primary); margin: 20px 0; }
.rag-row { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid #e2e8f0; font-weight: 500; }
.status-green { color: var(--green); } .status-amber { color: var(--amber); } .status-red { color: var(--red); }
.review-item { padding: 16px; border-left: 4px solid var(--red); background: #fef2f2; margin-bottom: 12px; border-radius: 0 8px 8px 0; }
.review-item strong { display: block; margin-bottom: 8px; }
/* Review Screen Specifics */
.review-item {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.review-q-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.review-question {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-main);
}

.review-answers {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wrong-ans, .correct-ans {
    padding: 12px;
    border-radius: 8px;
    font-size: 1rem;
}

.wrong-ans {
    background: #fef2f2;
    color: #991b1b;
    border-left: 4px solid var(--red);
}

.correct-ans {
    background: #f0fdf4;
    color: #166534;
    border-left: 4px solid var(--green);
}

.explanation-box {
    background: #eff6ff; /* Very light blue */
    border-left: 4px solid var(--primary); /* Deep blue accent line */
    padding: 12px 16px;
    margin-top: 16px;
    border-radius: 0 8px 8px 0;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-main);
}

.explanation-title {
    display: block;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 6px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}