:root {
    --bg-main: #0f172a;
    --bg-card: #1e293b;
    --bg-accent: #334155;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --primary: #38bdf8;
    --primary-hover: #0ea5e9;
    --success: #10b981;
    --error: #ef4444;
    --border: #334155;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 5px;
    text-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}

header p {
    color: var(--text-muted);
    font-size: 1rem;
}

.container {
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media (min-width: 768px) {
    .container {
        grid-template-columns: 280px 1fr;
    }
}

/* Sidebar Categories */
.sidebar {
    background-color: var(--bg-card);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--border);
    height: fit-content;
}

.sidebar h2 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.category-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.category-item {
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.95rem;
    color: var(--text-muted);
    background-color: transparent;
    border: none;
    text-align: left;
    width: 100%;
}

.category-item:hover,
.category-item.active {
    background-color: var(--bg-accent);
    color: var(--text-main);
}

.category-item.active {
    border-left: 4px solid var(--primary);
    font-weight: 600;
}

/* Main Workspace */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Stats Dashboard */
.dashboard {
    background-color: var(--bg-card);
    border-radius: 12px;
    padding: 15px 20px;
    border: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.stat-box {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-main);
}

.stat-value.ratio {
    color: var(--primary);
}

/* Quiz Box */
.quiz-card {
    background-color: var(--bg-card);
    border-radius: 12px;
    padding: 30px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    position: relative;
}

.quiz-category-tag {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 0.75rem;
    background-color: var(--bg-accent);
    padding: 4px 10px;
    border-radius: 20px;
    color: var(--primary);
    font-weight: 600;
}

.question-text {
    font-size: 1.2rem;
    line-height: 1.6;
    margin-bottom: 25px;
    margin-top: 10px;
    font-weight: 500;
}

sub {
    font-size: 0.75em;
    bottom: -0.25em;
    position: relative;
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 25px;
}

.option-btn {
    background-color: var(--bg-accent);
    color: var(--text-main);
    border: 1px solid var(--border);
    padding: 14px 20px;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    font-size: 1rem;
    transition: all 0.2s ease;
    width: 100%;
}

.option-btn:hover:not(:disabled) {
    border-color: var(--primary);
    background-color: rgba(56, 189, 248, 0.05);
}

.option-btn.correct {
    background-color: rgba(16, 185, 129, 0.15) !important;
    border-color: var(--success) !important;
    color: var(--success);
    font-weight: bold;
}

.option-btn.wrong {
    background-color: rgba(239, 68, 68, 0.15) !important;
    border-color: var(--error) !important;
    color: var(--error);
}

.controls {
    display: flex;
    justify-content: flex-end;
}

.next-btn {
    background-color: var(--primary);
    color: #000;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: none;
}

.next-btn:hover {
    background-color: var(--primary-hover);
}

/* History Log */
.history-section {
    background-color: var(--bg-card);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--border);
}

.history-section h3 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: var(--text-main);
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 250px;
    overflow-y: auto;
}

.history-item {
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 0.9rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--bg-accent);
}

.history-item.correct-item {
    border-left: 4px solid var(--success);
}

.history-item.wrong-item {
    border-left: 4px solid var(--error);
}

.history-status {
    font-weight: bold;
    font-size: 0.8rem;
    text-transform: uppercase;
}

.history-status.correct {
    color: var(--success);
}

.history-status.wrong {
    color: var(--error);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-main);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}