/* --- Quiz Modal Styles --- */
#nm-quiz-modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.8); z-index: 10000;
    display: flex; align-items: center; justify-content: center;
}
#nm-quiz-modal-content {
    background: #fff;
    color: #2c3e50; /* Set default text color for light mode */
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin-top: 40px;
    padding: 40px 30px 30px 30px;
}
#nm-quiz-close-btn {
    position: absolute; top: 10px; right: 15px; background: none;
    border: none; font-size: 24px; cursor: pointer; color: #888;
    z-index: 10002;
}

/* --- Pane Management --- */
.nm-quiz-pane { display: none; }
.nm-quiz-pane.active { display: block; animation: fadeIn 0.5s; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* --- Setup Form Styles --- */
#nm-quiz-setup-pane h2 { margin-top: 0; margin-bottom: 25px; }
.nm-form-group { margin-bottom: 20px; position: relative; }
.nm-form-group label { font-weight: bold; display: block; margin-bottom: 8px; }
.nm-form-group input { width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; }
#nm-generate-quiz-btn { width: 100%; padding: 12px; font-size: 16px; cursor: pointer; }
#nm-generate-quiz-btn:disabled { background: #999; cursor: not-allowed; }
#nm-topic-suggestions {
    position: absolute; background: #fff; border: 1px solid #ccc;
    border-top: none; width: 100%; z-index: 10001; box-sizing: border-box;
    color: #2c3e50;
}
#nm-topic-suggestions div { padding: 10px; cursor: pointer; }
#nm-topic-suggestions div:hover { background: #f0f0f0; }

/* --- Gameplay Pane Styles --- */
.nm-quiz-progress { font-size: 14px; color: #777; text-align: center; margin-bottom: 15px; }
.nm-quiz-timer {
    position: absolute;
    top: -33px;
    left: 50%;
    transform: translateX(-50%);
    width: 66px;
    height: 66px;
    font-size: 28px;
    font-weight: bold;
    color: #3498db;
    border: 3px solid #3498db;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
}
.nm-quiz-question-title { font-size: 1.2em; margin: 20px 0; text-align: center; }
.nm-quiz-options { list-style: none; padding: 0; margin: 0; }
.nm-quiz-options .quiz-option {
    border: 1px solid #ccc; padding: 12px; margin-bottom: 8px;
    border-radius: 5px; cursor: pointer; transition: all 0.2s ease;
}
.nm-quiz-options .quiz-option:hover { background-color: #f0f8ff; }
.nm-quiz-options .quiz-option.disabled { cursor: not-allowed; opacity: 0.7; }
.nm-quiz-options .quiz-option.correct {
    background-color: #d4edda; border-color: #c3e6cb; color: #155724; font-weight: bold;
}
.nm-quiz-options .quiz-option.wrong {
    background-color: #f8d7da; border-color: #f5c6cb; color: #721c24; text-decoration: line-through;
}

/* --- Results Pane Styles --- */
.nm-quiz-results-summary { text-align: center; margin: 20px 0; }
.nm-quiz-results-summary p { font-size: 18px; margin: 0; }
.nm-final-score { font-size: 48px; font-weight: bold; margin: 10px 0; }
.nm-final-percentage { font-size: 24px; color: #555; }
.nm-quiz-results-actions { 
    text-align: center; margin-top: 30px;
    display: flex; gap: 10px; justify-content: center;
}
.nm-quiz-results-actions button { 
    padding: 12px 20px; font-size: 16px; cursor: pointer;
    border-radius: 5px; color: #333;
}
#nm-quiz-share-results-btn {
    border: 1px solid #ccc;
    background: #f0f0f0;
}
#nm-quiz-share-results-btn:hover {
    background: #e0e0e0;
}
.nm-quiz-results-actions .button-primary {
    background: #2271b1; border-color: #2271b1; color: #fff;
}
.nm-share-container-results { margin-top: 20px; }


/* --- DARK MODE OVERRIDES FOR QUIZ MODAL --- */
body.dark-mode #nm-quiz-modal-content {
    background-color: var(--nm-bg-secondary);
    color: var(--nm-text-primary);
    border: 1px solid var(--nm-border-primary);
}
body.dark-mode #nm-quiz-modal-content .nm-form-group input {
    background-color: var(--nm-bg-tertiary);
    color: var(--nm-text-primary);
    border-color: var(--nm-border-secondary);
}
body.dark-mode #nm-quiz-modal-content .nm-quiz-options .quiz-option {
    border-color: var(--nm-border-secondary);
}
body.dark-mode #nm-quiz-modal-content .nm-quiz-question-title {
    color: var(--nm-text-primary);
}
body.dark-mode #nm-quiz-modal-content .nm-quiz-progress {
    color: var(--nm-text-action);
}
body.dark-mode #nm-quiz-modal-content #nm-quiz-close-btn {
    color: var(--nm-text-action);
}

