/* --- 1. Variables & Global Styles --- */
:root {
    --primary: #2563eb;
    --dark: #1e293b;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --bg: #f8fafc;
    --white: #ffffff;
    --border: #e2e8f0;
    --text-main: #1f2937;
    --text-muted: #64748b;
}

body { 
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif; 
    margin: 0; 
    background: var(--bg); 
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* --- 2. Dashboard / Subject Cards --- */
.container { max-width: 1100px; margin: 40px auto; padding: 20px; }
.row { display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 40px; }

.card { 
    flex: 1;
    min-width: 280px;
    padding: 30px;
    color: white !important; 
    text-decoration: none;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: all 0.2s ease-in-out;
    background-color: #334155; 
}

.card:hover { 
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(0,0,0,0.12);
    filter: brightness(1.05);
}

.card i { width: 35px; height: 35px; stroke-width: 2.5; }

/* Dashboard Colors */
.orange  { background-color: #f97316 !important; } 
.blue    { background-color: #3b82f6 !important; } 
.purple  { background-color: #a855f7 !important; } 
.orange2 { background-color: #fb923c !important; } 
.pink    { background-color: #ec4899 !important; } 
.blue2   { background-color: #0f172a !important; } 
.green   { background-color: #10b981 !important; } 
.grey    { background-color: #64748b !important; } 
.teal    { background-color: #0d9488 !important; } 

/* --- 3. Header & Navigation --- */
.topbar { 
    background: var(--dark); 
    color: white; 
    padding: 15px 40px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    position: sticky; 
    top: 0; 
    z-index: 1000;
}
.timer-display { font-size: 1.8rem; font-weight: bold; font-family: 'Courier New', monospace; }

/* --- 4. Test Interface Layout --- */
.container-test { 
    display: grid; 
    grid-template-columns: 1fr 340px; 
    gap: 30px; 
    padding: 30px; 
    max-width: 1400px; 
    margin: 0 auto; 
}

.container-test.review-layout {
    display: block; 
    max-width: 900px;
}

.question-box, .review-header-box, .result-card { 
    background: var(--white); 
    padding: 40px; 
    border-radius: 12px; 
    border: 1px solid var(--border); 
    margin-bottom: 25px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

/* --- 5. Questions & Options --- */
.ta-text, .en-text { 
    font-size: 1.3rem; 
    font-weight: 600; 
    line-height: 1.6; 
    margin-bottom: 15px; 
    white-space: pre-line; 
}
.en-text { color: var(--text-muted); font-style: italic; font-weight: 600; }
.paper-divider { border: 0; border-top: 1px dashed var(--border); margin: 25px 0; }

.opt-row { 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    padding: 15px; 
    cursor: pointer; 
    border-radius: 8px; 
    transition: 0.2s; 
    border: 1px solid transparent;
}
.opt-row:hover { background: #f1f5f9; }
.opt-row.selected { background: #eff6ff; color: var(--primary); font-weight: bold; border-color: #bfdbfe; }

/* --- 6. Review Mode Specifics --- */
.score-display { font-size: 3.5rem; font-weight: 800; color: var(--primary); margin: 10px 0; text-align: center; }

.result-card { border-left: 10px solid #cbd5e1; }
.correct-border { border-left-color: var(--success) !important; }
.incorrect-border { border-left-color: var(--danger) !important; }

.ans-comparison { 
    display: flex; 
    gap: 40px; 
    background: #f8fafc; 
    padding: 20px; 
    border-radius: 8px; 
    margin: 20px 0;
}
.ans-block { flex: 1; }
.ans-block strong { font-size: 0.8rem; color: var(--text-muted); display: block; text-transform: uppercase; margin-bottom: 5px; }

.explanation-box { 
    background: #f0f7ff; 
    padding: 20px; 
    border-radius: 8px; 
    border: 1px solid #dbeafe;
    font-size: 0.95rem;
}

/* --- 7. Sidebar Palette --- */
.sidebar { 
    background: var(--white); 
    padding: 25px; 
    border-radius: 12px; 
    border: 1px solid var(--border); 
    position: sticky; 
    top: 100px; 
    height: fit-content; 
}
.palette { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.pal-btn { 
    padding: 12px 0; 
    border: none; 
    background: #f1f5f9; 
    cursor: pointer; 
    border-radius: 6px; 
    font-weight: bold; 
}
.pal-btn.active { outline: 3px solid var(--primary); }
.pal-btn.answered { background: var(--success); color: white; }

/* --- 8. Buttons --- */
.btn { padding: 12px 30px; border-radius: 8px; border: none; cursor: pointer; font-weight: 600; font-size: 1rem; transition: 0.2s; }
.btn-primary { background: var(--primary); color: white; }
.btn-secondary { background: #e2e8f0; color: var(--dark); }
.btn-danger { background: var(--danger); color: white; }

/* --- 9. Responsive Queries --- */
@media (max-width: 900px) {
    .container-test { grid-template-columns: 1fr; padding: 15px; }
    .sidebar { order: -1; position: relative; top: 0; margin-bottom: 20px; }
    .topbar { padding: 10px 20px; }
    .logo { font-size: 1rem; }
    .timer-display { font-size: 1.4rem; }
    .ans-comparison { flex-direction: column; gap: 15px; }
}
@media (max-width: 600px) {
    .card { min-width: 100%; }
    .score-display { font-size: 2.5rem; }
}