/* Main Wrapper */
.adv-quiz-wrapper {
    max-width: 800px;
    margin: 40px auto;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: #333;
}

/* Card Styling */
.quiz-setup, .quiz-question-card, .quiz-results {
    background: #ffffff;
    border: 0;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    overflow: hidden; /* Keeps children inside */
}

/* --- NEW HEADER (Timer & TTS) --- */
.quiz-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
    min-height: 45px;
}

.quiz-timer {
    font-size: 1.1rem;
    font-weight: bold;
    color: #2c3e50;
    background: #f8f9fa;
    padding: 6px 14px;
    border-radius: 20px;
    border: 2px solid #e0e0e0;
    white-space: nowrap;
}

.quiz-timer.danger {
    color: #e74c3c;
    border-color: #e74c3c;
    background: #fff5f5;
    animation: pulse 1s infinite;
}

.tts-btn {
    background: transparent;
    border: 1px solid #ccc;
    color: #666;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.tts-btn:hover { background: #f0f0f0; color: #333; border-color: #bbb; }

/* Setup Screen */
.quiz-setup h4 { font-size: 1.8rem; margin-bottom: 25px; color: #2c3e50; text-align: center; }
.qz-setting { background: #f8f9fa; padding: 15px; border-radius: 8px; margin-bottom: 15px; }

/* Circles */
.qz-circles { display: flex; gap: 12px; justify-content: center; margin: 20px 0; }
.qz-circle-btn {
    width: 45px; height: 45px; border-radius: 50%; background: #fff; border: 2px solid #e0e0e0;
    color: #555; font-weight: bold; display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.2s;
}
.qz-circle-btn:hover { border-color: #3498db; color: #3498db; }
.qz-circle-btn.active { background: #3498db; color: #fff; border-color: #3498db; transform: scale(1.1); }

/* Topics */
.qz-group-list { background: #fdfdfd; padding: 20px; border-radius: 8px; max-height: 250px; overflow-y: auto; border: 1px solid #eee; margin-bottom: 25px; }
.qz-subgroup-list { margin-inline-start: 28px; padding-inline-start: 12px; border-inline-start: 2px solid #e0e0e0; margin-top: 5px; }

/* Question Body */
.quiz-status {
    background: #e1f5fe; color: #0288d1; display: inline-block; padding: 5px 12px;
    border-radius: 20px; font-size: 0.85rem; font-weight: bold; margin-bottom: 10px;
}
.quiz-body { font-size: 1.4rem; line-height: 1.5; color: #2c3e50; margin: 10px 0 30px 0; font-weight: 500; }

/* Options */
.quiz-opt-btn {
    background: #fff; border: 2px solid #e9ecef; padding: 18px 20px; margin-bottom: 12px;
    border-radius: 10px; cursor: pointer; font-size: 1.1rem; transition: transform 0.1s, border-color 0.2s, background 0.2s;
}
.quiz-opt-btn:hover:not(.disabled) { border-color: #3498db; background: #f0f8ff; transform: translateX(5px); }
[dir="rtl"] .quiz-opt-btn:hover:not(.disabled) { transform: translateX(-5px); }

.quiz-opt-btn.correct { background: #d4edda; border-color: #28a745; color: #155724; }
.quiz-opt-btn.wrong { background: #f8d7da; border-color: #dc3545; color: #721c24; opacity: 0.9; }

/* Inputs */
.quiz-text-input { border: 2px solid #ddd; border-radius: 8px; font-size: 1.2rem; transition: border-color 0.3s; padding: 10px; width: 100%; box-sizing: border-box; }
.quiz-text-input:focus { border-color: #3498db; outline: none; }

/* Buttons */
.qz-start-btn, .qz-next-btn, .qz-submit-btn {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%); color: white; border: none;
    padding: 14px 40px; border-radius: 30px; cursor: pointer; font-size: 1.1rem; font-weight: bold;
    display: block; width: 100%; margin-top: 20px; transition: transform 0.1s, box-shadow 0.2s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.qz-start-btn:hover, .qz-next-btn:hover, .qz-submit-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 12px rgba(0,0,0,0.15); }
.qz-next-btn { display: none; background: linear-gradient(135deg, #27ae60 0%, #219150 100%); }

/* Feedback */
.feedback-msg { margin-top: 20px; padding: 15px; border-radius: 8px; text-align: center; font-weight: bold; font-size: 1.1rem; }
.feedback-msg.correct { background: #d4edda; color: #155724; }
.feedback-msg.wrong { background: #f8d7da; color: #721c24; }
.quiz-expl { margin-top: 15px; padding: 15px; background: #fff3cd; color: #856404; border-radius: 8px; border-inline-start: 5px solid #ffeeba; }

/* Results */
.quiz-results { text-align: center; }
.quiz-pass { border-top: 6px solid #2ecc71; }
.quiz-fail { border-top: 6px solid #e74c3c; }
@keyframes pulse { 0% { opacity: 1; } 50% { opacity: 0.5; } 100% { opacity: 1; } }
