:root {
    --bg: #0a0a0a;
    --card-bg: #111111;
    --primary: #00bcd4;
    --secondary: #009688;
    --success: #4caf50;
    --danger: #f44336;
    --text: #e0e0e0;
    --text-muted: #888;
    --border: #222;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter', sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; overflow-x: hidden; }

nav { border-bottom: 1px solid var(--border); padding: 1rem 2rem; display: flex; justify-content: space-between; align-items: center; background: rgba(10,10,10,0.9); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 100; }
.logo { font-weight: 800; font-size: 1.2rem; color: var(--primary); text-decoration: none; }
.nav-links { display: flex; gap: 1.5rem; }
.nav-links a { color: var(--text-muted); text-decoration: none; font-size: 0.9rem; transition: color 0.3s; }
.nav-links a:hover, .nav-links a.active { color: var(--primary); }
.exam-timer { font-family: monospace; font-size: 1.2rem; color: var(--danger); font-weight: bold; background: rgba(244,67,54,0.1); padding: 0.3rem 0.8rem; border-radius: 6px; border: 1px solid var(--danger); }

.container { max-width: 900px; margin: 2rem auto; padding: 0 1.5rem; }
.hero { text-align: center; padding: 4rem 1rem 2rem; }
.hero h1 { font-size: 2.8rem; font-weight: 800; color: #fff; margin-bottom: 0.5rem; }
.hero p { color: var(--text-muted); max-width: 500px; margin: 0 auto 2rem; }

.card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; padding: 1.5rem; margin-bottom: 1.5rem; transition: border-color 0.3s; position: relative; }
.card:hover { border-color: #333; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.5rem; }

.group-header { border-left: 3px solid var(--primary); padding-left: 1rem; margin: 2rem 0 1rem; }
.group-header h2 { font-size: 1.2rem; font-weight: 700; color: #fff; }
.group-header span { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; }

.stat-val { font-size: 2.5rem; font-weight: 800; color: var(--primary); }
.stat-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 0.5rem; }

.btn { display: inline-block; background: var(--primary); color: #000; border: none; padding: 0.6rem 1.2rem; border-radius: 8px; font-weight: 600; cursor: pointer; text-decoration: none; transition: opacity 0.3s; font-size: 0.9rem; }
.btn:hover { opacity: 0.85; }
.btn-outline { background: transparent; color: var(--primary); border: 1px solid var(--primary); }
.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.8rem; }

.filter-bar { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.filter-bar select { background: #1a1a1a; color: var(--text); border: 1px solid var(--border); padding: 0.5rem 0.75rem; border-radius: 8px; font-size: 0.85rem; }

.mcq-option { display: block; width: 100%; text-align: left; background: #1a1a1a; border: 1px solid var(--border); color: var(--text); padding: 0.8rem 1rem; border-radius: 8px; margin-bottom: 0.5rem; cursor: pointer; transition: all 0.2s; font-size: 0.95rem; }
.mcq-option:hover { border-color: var(--primary); background: #1f1f1f; }
.mcq-option.correct { border-color: var(--success); background: rgba(76,175,80,0.15); color: var(--success); }
.mcq-option.wrong { border-color: var(--danger); background: rgba(244,67,54,0.1); color: var(--danger); }
.mcq-option.disabled { pointer-events: none; opacity: 0.7; }
.mcq-option.correct-highlight { border-color: var(--success); background: rgba(76,175,80,0.15); }

.score-bar { display: flex; gap: 1.5rem; align-items: center; padding: 1rem; background: var(--card-bg); border: 1px solid var(--border); border-radius: 8px; margin-bottom: 1.5rem; }
.score-bar .score { font-size: 1.2rem; font-weight: 700; color: var(--primary); }

.q-meta { display: flex; gap: 0.75rem; margin-top: 0.5rem; font-size: 0.75rem; }
.q-meta span { background: #1a1a1a; padding: 0.2rem 0.5rem; border-radius: 4px; color: var(--text-muted); }

.pagination { display: flex; justify-content: center; gap: 0.5rem; margin-top: 2rem; }

.loader { width: 36px; height: 36px; border: 4px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 3rem auto; }
@keyframes spin { to { transform: rotate(360deg); } }

.mt { margin-top: 1rem; }
.hidden { display: none; }

.expand-btn { background: none; border: none; color: var(--primary); cursor: pointer; font-size: 0.85rem; padding: 0.3rem 0; }
.browse-answer { margin-top: 0.5rem; padding: 0.5rem; background: rgba(0,188,212,0.08); border-radius: 6px; font-size: 0.9rem; color: var(--primary); }

.log-container { background: #000; padding: 1rem; border-radius: 8px; font-family: 'Courier New', monospace; font-size: 0.85rem; height: 300px; overflow-y: auto; color: #0f0; margin-top: 1rem; }
.log-entry { margin-bottom: 0.5rem; }
.log-agent { color: var(--primary); font-weight: bold; }

/* KaTeX Premium Styling */
.katex-display { 
    overflow-x: auto; 
    overflow-y: hidden; 
    padding: 1.5rem 0; 
    margin: 1rem 0; 
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
    text-align: center;
}
.katex { font-size: 1.15em; color: #fff; }
.katex-html { font-family: 'Times New Roman', serif; }
