/* --- VARIABLES SCALAR (Scoped to Widget) --- */
.mm-profiler-container {
    /* LIGHT MODE DEFAULTS */
    --mm-font-head: 'Merriweather', serif;
    --mm-font-body: 'Inter', system-ui, sans-serif;
    
    --mm-bg: #ffffff;
    --mm-bg-soft: #f8fafc;       /* Used for badges/hover states */
    --mm-btn-bg: #ffffff;        /* Button background */
    --mm-text: #1e293b;          /* Slate 800 */
    --mm-text-muted: #64748b;    /* Slate 500 */
    --mm-border: #e2e8f0;        /* Slate 200 */
    
    --mm-primary: #475569;       /* Slate 600 */
    --mm-primary-hover: #334155; /* Slate 700 */
    --mm-primary-fg: #ffffff;    /* Text color on primary button */
    
    --mm-radius: 12px;
    --mm-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

/* --- DARK MODE OVERRIDES --- */

/* 1. System Preference: Dark */
@media (prefers-color-scheme: dark) {
    .mm-profiler-container {
        --mm-bg: #1e293b;        /* Slate 800 (Matches reference image card body) */
        --mm-bg-soft: #0f172a;   /* Slate 900 */
        --mm-btn-bg: #334155;    /* Slate 700 (Buttons lighter than bg to pop) */
        --mm-text: #f8fafc;      /* Slate 50 */
        --mm-text-muted: #94a3b8;/* Slate 400 */
        --mm-border: #475569;    /* Slate 600 (Visible border) */
        
        --mm-primary: #e2e8f0;   /* Light Slate */
        --mm-primary-hover: #ffffff;
        --mm-primary-fg: #0f172a; /* Dark text on button */
        
        --mm-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3); /* Stronger shadow for dark mode */
    }
}

/* 2. User Toggle: data-scheme="dark" (Overrides System) */
/* This targets the widget if a parent (like body or html) has the attribute */
[data-scheme="dark"] .mm-profiler-container,
.mm-profiler-container[data-scheme="dark"] {
    --mm-bg: #1e293b;
    --mm-bg-soft: #0f172a;
    --mm-btn-bg: #334155;
    --mm-text: #f8fafc;
    --mm-text-muted: #94a3b8;
    --mm-border: #475569;
    
    --mm-primary: #e2e8f0;
    --mm-primary-hover: #ffffff;
    --mm-primary-fg: #0f172a;
    
    --mm-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

/* --- LAYOUT & COMPONENTS --- */

.mm-profiler-container {
    background: var(--mm-bg);
    border: 1px solid var(--mm-border);
    border-radius: var(--mm-radius);
    padding: 1.5rem;
    margin: 0 0 2rem 0;
    box-shadow: var(--mm-shadow);
    font-family: var(--mm-font-body);
    max-width: 680px;
    position: relative;
    min-height: 220px;
    box-sizing: border-box;
    transition: background-color 0.3s ease, border-color 0.3s ease; /* Smooth toggle */
}

.mm-profiler-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.mm-badge {
    background: var(--mm-bg-soft);
    color: var(--mm-text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid var(--mm-border);
}

.mm-dismiss {
    background: transparent;
    border: none;
    color: var(--mm-text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
}

.mm-question-text {
    font-family: var(--mm-font-head);
    color: var(--mm-text);
    font-size: 1.25rem;
    line-height: 1.4;
    margin: 0 0 5px 0;
    font-weight: 700;
}

.mm-micro-copy {
    font-size: 0.85rem;
    color: var(--mm-text-muted);
    margin: 0 0 1.25rem 0;
    font-style: italic;
}

.mm-answers-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

@media (max-width: 600px) {
    .mm-answers-grid { grid-template-columns: 1fr; }
}

.mm-answer-btn {
    background: var(--mm-btn-bg); /* Uses specific button var now */
    border: 1px solid var(--mm-border);
    color: var(--mm-text);
    padding: 0.75rem 1rem;
    border-radius: 50px;
    text-align: left;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    font-family: var(--mm-font-body);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.mm-answer-btn:hover {
    border-color: var(--mm-primary);
    color: var(--mm-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.08);
    background: var(--mm-bg-soft);
}

.mm-profiler-success {
    text-align: center;
    padding: 1rem 0;
    animation: fadeIn 0.3s ease;
    margin-bottom: 1rem;
}

.mm-success-message {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: #10b981;
    font-weight: 700;
    margin-bottom: 1rem;
}

.mm-quiz-pitch {
    color: var(--mm-text);
    margin-bottom: 1.5rem;
}

.mm-quiz-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.mm-btn-primary {
    background: var(--mm-primary);
    color: var(--mm-primary-fg);
    border: none;
    padding: 0.6rem 1.25rem;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.mm-btn-primary:hover {
    background: var(--mm-primary-hover);
}

.mm-btn-text {
    background: transparent;
    color: var(--mm-text-muted);
    border: none;
    cursor: pointer;
    font-weight: 600;
    padding: 0.6rem 1.25rem;
}

.mm-btn-text:hover {
    color: var(--mm-text);
}

.mm-widget-footer {
    font-size: 0.75rem;
    color: var(--mm-text-muted);
    text-align: center;
    border-top: 1px solid var(--mm-border);
    padding-top: 0.75rem;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}