/* --- 1. CORE COLOR VARIABLES --- */
:root {
    --bg-color: #f4f7f9;
    --container-bg: #ffffff;
    --text-main: #333333;
    --text-muted: #666666;
    --primary-blue: #004a99;
    --accent-blue: #007bff;
    --border-color: #e0e4e8;
    
    /* Missing Variables defined here */
    --white: #ffffff;
    --light-gray: #eef2f3;
    --success-green: #2e7d32;
    --error-red: #d32f2f;
}

/* --- 2. DARK MODE (NIGHT SHIFT) OVERRIDES --- */
body.dark-mode {
    --bg-color: #0f172a; 
    --container-bg: #1e293b; 
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --primary-blue: #38bdf8; 
    --accent-blue: #7dd3fc;
    --border-color: #334155;
    --white: #1e293b;
    --light-gray: #0f172a;
    --success-green: #4ade80;
}

/* --- 3. GLOBAL STYLES --- */
body { 
    font-family: 'Helvetica Neue', Arial, sans-serif; 
    background-color: var(--bg-color); 
    color: var(--text-main);
    margin: 0; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    padding: 0 0 20px 0; 
    font-size: 18px; 
    transition: background-color 0.3s, color 0.3s;
}

/* Discreet utility banner */
.ad-banner {
    width: 100%;
    background-color: var(--container-bg);
    color: var(--text-muted);
    text-align: center;
    padding: 8px 0;
    font-size: 13px;
    border-bottom: 1px solid var(--border-color);
    letter-spacing: 0.5px;
}

.ad-banner a {
    color: var(--accent-blue);
    text-decoration: none;
    font-weight: bold;
}

#quiz-container { 
    margin-top: 30px; 
    background-color: var(--container-bg); 
    max-width: 800px; 
    width: 95%; 
    padding: 30px; 
    border-radius: 12px; 
    box-shadow: 0 4px 20px rgba(0,0,0,0.1); 
    border: 1px solid var(--border-color);
}

h1 { color: var(--primary-blue); text-align: center; margin-bottom: 5px;}
.subtitle { text-align: center; color: var(--text-muted); font-size: 1rem; margin-bottom: 20px; }

/* --- 4. UI COMPONENTS --- */
#slider-box { 
    background: var(--light-gray); 
    padding: 15px; 
    border-radius: 8px; 
    text-align: center; 
    margin-bottom: 20px; 
    color: var(--text-main);
}

#question-count-label { 
    font-weight: bold; 
    color: var(--accent-blue); 
    font-size: 1.5rem; 
}

.mode-btn { 
    background: var(--primary-blue); 
    color: #fff; 
    padding: 15px; 
    border: none; 
    border-radius: 8px; 
    width: 100%; 
    font-size: 1.1rem; 
    cursor: pointer; 
    transition: 0.3s; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    gap: 10px; 
}

.mode-btn:hover { background: var(--accent-blue); }

#progress { margin-bottom: 10px; font-weight: bold; color: var(--text-muted); }
#question-text { font-size: 1.3rem; margin-bottom: 20px; color: var(--primary-blue); }

.option-item { 
    border: 2px solid var(--border-color); 
    padding: 15px; 
    border-radius: 8px; 
    margin-bottom: 10px; 
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    background-color: var(--container-bg);
}

.option-item:hover { 
    background: var(--light-gray); 
    border-color: var(--accent-blue); 
}

#action-btn { 
    background: var(--success-green); 
    color: white; 
    padding: 15px; 
    border: none; 
    border-radius: 8px; 
    width: 100%; 
    font-size: 1.1rem; 
    cursor: pointer; 
    margin-top: 10px; 
}

#feedback { 
    margin-top: 15px; 
    padding: 15px; 
    border-radius: 8px; 
    background: var(--light-gray); 
    border: 1px solid var(--border-color); 
    line-height: 1.5;
    color: var(--text-main);
}

#timer-container {
    text-align: right;
    font-weight: bold;
    color: var(--error-red);
    margin-bottom: 10px;
}

/* --- 5. PERFORMANCE & MATRIX --- */
.matrix-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    background-color: var(--container-bg);
    color: var(--text-main);
}

.matrix-table th, .matrix-table td {
    border: 1px solid var(--border-color);
    padding: 12px 8px;
    text-align: center;
}

.matrix-table th {
    background-color: var(--light-gray);
    color: var(--primary-blue);
}

.matrix-row-label {
    text-align: left !important;
    font-weight: bold;
    background-color: var(--light-gray);
}

/* --- 6. MODAL STYLES --- */
.modal {
    display: none; 
    position: fixed; 
    z-index: 1000; 
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.7); 
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: var(--container-bg);
    color: var(--text-main);
    margin: 10% auto;
    padding: 25px;
    border-left: 8px solid var(--accent-blue);
    width: 85%;
    max-width: 500px;
    border-radius: 12px;
    position: relative;
}

/* --- 7. SPECIAL BUTTONS --- */
#missed-drill-btn {
    display: none;
    margin: 25px auto;
    padding: 18px 32px;
    font-size: 1.2rem;
    font-weight: 800;
    text-transform: uppercase;
    color: white;
    background-color: var(--error-red);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

#new-session-btn {
    display: block; width: 90%; max-width: 450px; margin: 40px auto 20px;
    padding: 20px; background-color: var(--accent-blue); color: white;
    font-size: 1.2rem; font-weight: bold; text-transform: uppercase;
    border: none; border-radius: 12px; cursor: pointer;
}
.field-notes-banner {
    text-align: center;
    margin-top: 50px; /* Pushes the banner away from the quiz content */
    margin-bottom: 20px;
    padding: 20px;
    border-top: 1px solid var(--border-color);
    color: var(--text-main);
    font-size: 0.85rem;
    opacity: 0.7; /* Makes it subtle so it doesn't distract from the quiz */
}
