﻿/*
 * COMBINED QUIZ CSS FILE
 * Combines 6 CSS files for better performance
 * Last Updated: 2026-01-19 12:54:42
 * Files Combined: quiz-animations.css, quiz-results.css, notifications.css, quiz-core.css, quiz-navigation.css, quiz-interface.css
 */

/* Quiz container full width structure - force 100vw to break out of theme containers */
.nammashale-quiz {
  width: 100vw !important;
  max-width: 100vw !important;
  margin-left: calc(-50vw + 50%) !important;
  box-sizing: border-box;
  overflow-x: hidden;
}

.quiz-container {
  width: 100% !important;
  max-width: 1200px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box;
}

/* Quiz Start Screen - centered block */
.quiz-start-screen {
  text-align: center;
  padding: 40px 20px;
}

/* Mobile: full width */
@media (max-width: 768px) {
  .quiz-container {
    max-width: 100% !important;
    padding-left: 10px;
    padding-right: 10px;
  }
  .quiz-start-screen {
    padding: 20px 10px;
  }
}

.template-classic {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* ================================================================================================
   SECTION 1: QUIZ ANIMATIONS (quiz-animations.css)
   ================================================================================================ *//* ========================================
   QUIZ ENGAGEMENT ANIMATIONS
   Feedback messages, streaks, and visual effects
   ======================================== */

/* ========================================
   FEEDBACK MESSAGE ANIMATIONS (0.5 seconds)
   ======================================== */

@keyframes feedbackBounceIn {
    0% {
        transform: scale(0.3) translateY(20px);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

@keyframes feedbackSlideIn {
    0% {
        transform: translateX(-100%);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes feedbackPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.08);
    }
}

@keyframes successGlow {
    0% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(76, 175, 80, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
    }
}

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

@keyframes feedbackFadeOut {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0.9);
    }
}

/* Feedback Container */
.feedback-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.feedback-container.show {
    opacity: 1;
    visibility: visible;
}

.feedback-message {
    padding: 20px 40px;
    border-radius: 15px;
    font-size: 1.4em;
    font-weight: bold;
    text-align: center;
    min-width: 300px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    animation: feedbackBounceIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.feedback-message.success {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    border: 2px solid #2E7D32;
    animation: feedbackBounceIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards,
              successGlow 1.5s ease-out 0.3s;
}

.feedback-message.error {
    background: linear-gradient(135deg, #f44336 0%, #da190b 100%);
    color: white;
    border: 2px solid #c62828;
    animation: feedbackBounceIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards,
              errorShake 0.4s ease-in-out;
}

.feedback-message.info {
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    color: white;
    border: 2px solid #1565C0;
    animation: feedbackSlideIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.feedback-message.warning {
    background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
    color: white;
    border: 2px solid #E65100;
    animation: feedbackBounceIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.feedback-message.hide {
    animation: feedbackFadeOut 0.3s ease-out forwards;
}

/* Correct/Wrong feedback message classes */
.feedback-message.correct {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    border: 2px solid #2E7D32;
    animation: feedbackBounceIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.feedback-message.wrong {
    background: linear-gradient(135deg, #f44336 0%, #da190b 100%);
    color: white;
    border: 2px solid #c62828;
    animation: feedbackBounceIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards,
              errorShake 0.4s ease-in-out;
}

/* Option visual feedback when selected */
.option.correct {
    background: rgba(76, 175, 80, 0.3) !important;
    border-color: #4CAF50 !important;
    border-width: 3px !important;
}

.option.wrong {
    background: rgba(244, 67, 54, 0.3) !important;
    border-color: #f44336 !important;
    border-width: 3px !important;
}

.option.correct::after {
    content: '✓';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #4CAF50;
    font-size: 1.5em;
    font-weight: bold;
}

.option.wrong::after {
    content: '✗';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #f44336;
    font-size: 1.5em;
    font-weight: bold;
}

/* ========================================
   STREAK CELEBRATION ANIMATIONS
   ======================================== */

@keyframes confettiPop {
    0% {
        transform: translate(0, 0) rotate(0deg) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(var(--tx), var(--ty)) rotate(360deg) scale(0);
        opacity: 0;
    }
}

@keyframes starBurst {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

@keyframes rainbowWave {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}

.streak-celebration {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 8000;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    pointer-events: none;
}

.confetti.red { background: #f44336; }
.confetti.green { background: #4CAF50; }
.confetti.blue { background: #2196F3; }
.confetti.yellow { background: #FFC107; }
.confetti.pink { background: #E91E63; }
.confetti.purple { background: #9C27B0; }

.star {
    position: absolute;
    font-size: 2em;
    animation: starBurst 1s ease-out forwards;
}

/* ========================================
   ANSWER HIGHLIGHTING ANIMATIONS
   ======================================== */

@keyframes correctPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(76, 175, 80, 0.2);
    }
}

@keyframes wrongShake {
    0%, 100% { transform: translateX(0) rotate(0deg); }
    25% { transform: translateX(-8px) rotate(-1deg); }
    75% { transform: translateX(8px) rotate(1deg); }
}

.option-item.correct-answer {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.3) 0%, rgba(76, 175, 80, 0.1) 100%);
    border: 2px solid #4CAF50;
    animation: correctPulse 0.6s ease-out;
}

.option-item.wrong-answer {
    background: linear-gradient(135deg, rgba(244, 67, 54, 0.3) 0%, rgba(244, 67, 54, 0.1) 100%);
    border: 2px solid #f44336;
    animation: wrongShake 0.4s ease-in-out;
}

/* ========================================
   QUESTION TRANSITION ANIMATIONS
   ======================================== */

@keyframes questionSlideIn {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes questionSlideOut {
    0% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-30px);
    }
}

.question.entering {
    animation: questionSlideIn 0.4s ease-out forwards;
}

.question.leaving {
    animation: questionSlideOut 0.3s ease-in forwards;
}

/* ========================================
   PROGRESS BAR ANIMATIONS
   ======================================== */

@keyframes progressPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(33, 150, 243, 0.7);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(33, 150, 243, 0);
    }
}

@keyframes progressFill {
    0% {
        width: 0%;
    }
    100% {
        width: var(--progress-width);
    }
}

.quiz-progress {
    animation: progressPulse 2s infinite;
}

.progress-fill {
    animation: progressFill 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

/* ========================================
   STREAK INDICATOR ANIMATIONS
   ======================================== */

@keyframes streakFlash {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.15);
        opacity: 0.8;
    }
}

@keyframes streakRise {
    0% {
        transform: translateY(20px);
        opacity: 0;
    }
    100% {
        transform: translateY(-30px);
        opacity: 0;
    }
}

.streak-indicator {
    position: fixed;
    font-size: 2em;
    font-weight: bold;
    animation: streakRise 1.5s ease-out forwards;
    pointer-events: none;
    z-index: 5000;
}

.streak-indicator.fire {
    color: #FF6F00;
    text-shadow: 0 0 20px rgba(255, 111, 0, 0.8);
}

.streak-indicator.lightning {
    color: #FFD700;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
}

.streak-badge {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 20px;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #333;
    font-weight: bold;
    font-size: 1.1em;
    animation: streakFlash 1s ease-in-out;
    box-shadow: 0 4px 15px rgba(255, 165, 0, 0.4);
}

/* ========================================
   BUTTON PRESS ANIMATIONS
   ======================================== */

@keyframes buttonPress {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(0.95);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes buttonGlow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(33, 150, 243, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(33, 150, 243, 0.8);
    }
}

.start-quiz-btn:active,
.next-button:active,
.prev-button:active,
.submit-button:active {
    animation: buttonPress 0.2s ease-out;
}

.start-quiz-btn {
    animation: buttonGlow 2s ease-in-out infinite;
}

/* ========================================
   MILESTONE CELEBRATION ANIMATIONS
   ======================================== */

@keyframes milestonePop {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }
    70% {
        transform: scale(1.2) rotate(10deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

@keyframes milestoneGlow {
    0%, 100% {
        filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.5));
    }
    50% {
        filter: drop-shadow(0 0 20px rgba(255, 215, 0, 1));
    }
}

.milestone-badge {
    display: inline-block;
    padding: 15px 30px;
    border-radius: 50px;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 50%, #FF6F00 100%);
    color: white;
    font-weight: bold;
    font-size: 1.2em;
    text-align: center;
    animation: milestonePop 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) forwards,
              milestoneGlow 1.5s ease-in-out infinite 0.7s;
    box-shadow: 0 8px 25px rgba(255, 165, 0, 0.4);
}

/* ========================================
   RESULT SCREEN ANIMATIONS
   ======================================== */

@keyframes resultSlideDown {
    0% {
        opacity: 0;
        transform: translateY(-50px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scoreCounter {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes ribbonWave {
    0%, 100% {
        transform: rotateZ(-1deg);
    }
    50% {
        transform: rotateZ(1deg);
    }
}

.quiz-results {
    animation: resultSlideDown 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.result-score {
    animation: scoreCounter 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.result-ribbon {
    animation: ribbonWave 1.5s ease-in-out infinite;
}

/* ========================================
   ENGAGEMENT PULSES
   ======================================== */

@keyframes subtlePulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

@keyframes counterPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.question-counter {
    animation: counterPulse 0.3s ease-out;
}

.quiz-progress-indicator {
    animation: subtlePulse 1s ease-in-out;
}

/* ========================================
   TIMER WARNING ANIMATIONS
   ======================================== */

@keyframes timerWarning {
    0%, 100% {
        color: #FF9800;
    }
    50% {
        color: #FF5722;
        text-shadow: 0 0 10px rgba(255, 87, 34, 0.6);
    }
}

@keyframes timerCritical {
    0%, 100% {
        color: #f44336;
        text-shadow: 0 0 10px rgba(244, 67, 54, 0.6);
    }
    50% {
        color: #d32f2f;
        text-shadow: 0 0 20px rgba(244, 67, 54, 1);
    }
}

.quiz-timer.warning {
    animation: timerWarning 0.8s ease-in-out infinite;
}

.quiz-timer.critical {
    animation: timerCritical 0.4s ease-in-out infinite;
}

/* ========================================
   RESPONSIVE ADJUSTMENTS
   ======================================== */

@media (max-width: 768px) {
    .feedback-message {
        min-width: 250px;
        padding: 15px 30px;
        font-size: 1.1em;
    }

    .milestone-badge {
        padding: 12px 24px;
        font-size: 1em;
    }

    .confetti {
        width: 8px;
        height: 8px;
    }

    .star {
        font-size: 1.5em;
    }
}

@media (max-width: 480px) {
    .feedback-message {
        min-width: 90vw;
        padding: 12px 20px;
        font-size: 0.95em;
    }

    .streak-indicator {
        font-size: 1.5em;
    }
}


/* ================================================================================================
   SECTION 2: QUIZ RESULTS (quiz-results.css)
   ================================================================================================ */

/* Quiz Results Page Styling */
.quiz-results {
  max-width: 800px;
  margin: 0 auto;
  padding: var(--quiz-spacing-lg);
  background-color: white;
  border-radius: var(--quiz-border-radius-lg);
  box-shadow: var(--quiz-shadow-md);
}

/* Results Header */
.results-header {
  text-align: center;
  margin-bottom: var(--quiz-spacing-lg);
}

.results-header h2 {
  font-size: var(--quiz-font-size-xl);
  color: var(--quiz-primary-color);
  margin-bottom: var(--quiz-spacing-md);
}

/* Results Summary Blocks */
.results-summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--quiz-spacing-md);
  margin-bottom: var(--quiz-spacing-lg);
}

.result-block {
  background-color: var(--quiz-background-light);
  padding: var(--quiz-spacing-md);
  border-radius: var(--quiz-border-radius-md);
  text-align: center;
  box-shadow: var(--quiz-shadow-sm);
  transition: all var(--quiz-transition-fast);
}

.result-block:hover {
  transform: translateY(-3px);
  box-shadow: var(--quiz-shadow-md);
}

/* Pass/Fail Status */
.result-status {
  padding: var(--quiz-spacing-md);
  border-radius: var(--quiz-border-radius-md);
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: var(--quiz-spacing-md);
  grid-column: 1 / -1;
}

.status-passed {
  background: linear-gradient(135deg, #27ae60, #2ecc71);
  color: white;
}

.status-failed {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  color: white;
}

/* Result Values */
.result-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--quiz-primary-color);
  margin-bottom: var(--quiz-spacing-xs);
}

.result-label {
  font-size: var(--quiz-font-size-sm);
  color: #666;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Score Circle */
.score-circle-wrapper {
  position: relative;
  width: 130px;
  height: 130px;
  margin: 20px auto;
}

.score-ring {
  display: block;
}

.score-ring-progress {
  transition: stroke-dashoffset 1s ease-out;
}

.score-circle-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  line-height: 1.2;
}

.score-circle-value {
  display: block;
  font-size: 1.8rem;
  font-weight: 800;
  color: #333;
}

.score-circle-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.score-circle-label.passed {
  color: #27ae60;
}

.score-circle-label.failed {
  color: #e74c3c;
}

/* Result row icons */
.result-row-label i {
  margin-right: 8px;
  color: var(--quiz-primary-color, #2a5298);
  width: 16px;
  text-align: center;
}

/* Results Rows - Line by Line Layout */
.results-rows {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: var(--quiz-spacing-lg);
  border-radius: var(--quiz-border-radius-md);
  overflow: hidden;
  border: 1px solid #e0e0e0;
}

.result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background: #ffffff;
  border-bottom: 1px solid #e8e8e8;
  transition: background 0.2s ease;
}

.result-row:nth-child(odd) {
  background: #f8f9ff;
}

.result-row:last-child {
  border-bottom: none;
}

.result-row:hover {
  background: #eef2ff;
}

.result-row-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.result-row-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--quiz-primary-color, #2a5298);
}

.result-row-highlight {
  background: linear-gradient(135deg, #f0f4ff, #e8eeff) !important;
  border-left: 4px solid var(--quiz-primary-color, #2a5298);
}

.result-row-highlight .result-row-value {
  color: #27ae60;
}

/* Mobile results rows */
@media (max-width: 480px) {
  .result-row {
    padding: 12px 15px;
  }
  .result-row-label {
    font-size: 0.85rem;
  }
  .result-row-value {
    font-size: 1rem;
  }
}

/* Performance Message */
.performance-message {
  font-size: var(--quiz-font-size-lg);
  text-align: center;
  padding: 16px 20px;
  margin: 20px 0;
  background: linear-gradient(135deg, #f0f4ff, #e8eeff);
  border-radius: 12px;
  border-left: 4px solid var(--quiz-primary-color, #2a5298);
  font-weight: 500;
  color: #444;
}

/* Social Sharing Section */
.social-share {
  display: flex;
  justify-content: center;
  gap: var(--quiz-spacing-md);
  margin: var(--quiz-spacing-lg) 0;
}

.social-share-title {
  width: 100%;
  text-align: center;
  margin-bottom: var(--quiz-spacing-md);
  color: #666;
}

.share-button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
  transition: all var(--quiz-transition-fast);
}

.share-button:hover {
  transform: translateY(-3px);
}

.share-whatsapp { background-color: #25D366; }
.share-facebook { background-color: #3b5998; }
.share-telegram { background-color: #0088cc; }
.share-twitter { background-color: #1DA1F2; }

/* Review Toggle Button */
.review-toggle {
  display: block;
  width: 100%;
  padding: var(--quiz-spacing-md);
  background-color: var(--quiz-background-light);
  border: none;
  border-radius: var(--quiz-border-radius-md);
  font-size: var(--quiz-font-size-md);
  font-weight: 600;
  text-align: left;
  color: var(--quiz-text-dark);
  cursor: pointer;
  margin: var(--quiz-spacing-lg) 0;
  position: relative;
}

.review-toggle:after {
  content: "+";
  position: absolute;
  right: var(--quiz-spacing-md);
  font-size: 1.5rem;
  transition: transform 0.3s;
}

.review-toggle.active:after {
  transform: rotate(45deg);
}

/* Questions Review */
.questions-review {
  margin-top: var(--quiz-spacing-md);
  display: none;
}

.questions-review.visible {
  display: block;
}

.question-item {
  background-color: white;
  border: 1px solid #eee;
  border-radius: var(--quiz-border-radius-md);
  padding: var(--quiz-spacing-md);
  margin-bottom: var(--quiz-spacing-md);
}

.question-item.correct {
  border-left: 4px solid #2ecc71;
}

.question-item.incorrect {
  border-left: 4px solid #e74c3c;
}

.question-number {
  font-weight: 600;
  color: var(--quiz-text-dark);
}

.question-status.correct {
  color: #2ecc71;
}

.question-status.incorrect {
  color: #e74c3c;
}

/* Action Buttons */
.result-actions {
  display: flex;
  justify-content: center;
  flex-wrap: nowrap;
  gap: var(--quiz-spacing-md);
  margin-top: var(--quiz-spacing-lg);
}

.try-again-btn,
.study-flashcards-btn,
.back-home-btn {
  padding: 0.75rem 1.5rem;
  border-radius: var(--quiz-border-radius-md);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--quiz-transition-fast);
  border: none;
  font-size: var(--quiz-font-size-md);
}

.try-again-btn {
  background-color: var(--quiz-primary-color);
  color: white;
}

.study-flashcards-btn {
  background-color: #f39c12;
  color: white;
}

.back-home-btn {
  background-color: #95a5a6;
  color: white;
}

.try-again-btn:hover,
.study-flashcards-btn:hover,
.back-home-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--quiz-shadow-sm);
}

/* Animation for result blocks */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.result-block {
  animation: fadeInUp 0.5s ease-out forwards;
}

.result-block:nth-child(2) {
  animation-delay: 0.1s;
}

.result-block:nth-child(3) {
  animation-delay: 0.2s;
}

/* Responsive design */
@media (max-width: 768px) {
  .results-summary {
    grid-template-columns: 1fr;
  }
  
  .result-actions {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 8px;
  }

  .result-actions button {
    padding: 10px 12px;
    font-size: 13px;
  }
  
  .try-again-btn,
  .study-flashcards-btn,
  .back-home-btn {
    width: 100%;
  }
}

/* ================================================================================================
   SECTION 3: NOTIFICATIONS (notifications.css)
   ================================================================================================ */

/**
 * Profile Notification Styles for Nammashale Plugin
 * Handles notification messages for profile actions
 * Version: 1.0.0
 */

.nammashale-notice {
    padding: 10px 15px;
    margin: 10px 0;
    border-radius: 4px;
    text-align: center;
}

.nammashale-notice.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.nammashale-notice.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.nammashale-notice.warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.nammashale-notice.info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}


/* ================================================================================================
   SECTION 4: QUIZ CORE (quiz-core.css)
   ================================================================================================ */

:root {
  /* Color variables - White & Black Theme */
  --quiz-primary-color: #000000;
  --quiz-secondary-color: #ffffff;
  --quiz-accent-color: #333333;
  --quiz-text-dark: #000000;
  --quiz-text-light: #ffffff;
  --quiz-background-light: #ffffff;
  --quiz-background-dark: #000000;
  --quiz-success: #000000;
  --quiz-error: #333333;
  --quiz-warning: #666666;
  --quiz-info: #000000;
  
  /* Button color variables - White & Black Theme */
  --button-retry: #000000;
  --button-retry-hover: #333333;
  --button-view: #000000;
  --button-view-hover: #333333;
  --button-flashcards: #333333;
  --button-flashcards-hover: #000000;
  --button-progress: #000000;
  --button-progress-hover: #333333;
  --button-points: #333333;
  --button-points-hover: #000000;
  --button-home: #666666;
  --button-home-hover: #333333;
  
  /* Spacing variables */
  --quiz-spacing-xs: 0.25rem;
  --quiz-spacing-sm: 0.5rem;
  --quiz-spacing-md: 1rem;
  --quiz-spacing-lg: 1.5rem;
  --quiz-spacing-xl: 2rem;
  
  /* Font variables */
  --quiz-font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  --quiz-font-size-sm: 0.875rem;
  --quiz-font-size-md: 1rem;
  --quiz-font-size-lg: 1.125rem;
  --quiz-font-size-xl: 1.25rem;
  
  /* Border radius */
  --quiz-border-radius-sm: 4px;
  --quiz-border-radius-md: 8px;
  --quiz-border-radius-lg: 16px;
  
  /* Shadows */
  --quiz-shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
  --quiz-shadow-md: 0 4px 8px rgba(0, 0, 0, 0.1);
  --quiz-shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.1);
  
  /* Transitions */
  --quiz-transition-fast: 0.2s ease;
  --quiz-transition-medium: 0.3s ease;
  --quiz-transition-slow: 0.5s ease;
}

/* ============================================
   SINGLE LAYER STRUCTURE
   Clean, simple quiz container
   ============================================ */

.layer-1 {
  width: 100%;
  max-width: 1200px;
  margin: 20px auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-sizing: border-box;
  background: white;
  border-radius: 8px;
}

/* ============================================
   QUESTION STYLES - Replacing Inline Styles
   All inline styles have been moved to CSS
   ============================================ */

/* Question container */
.question {
  background-color: rgba(13, 36, 82, 0.85);
  color: #ffffff;
  padding: 30px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.question-content {
  width: 100%;
}

.question-text {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 20px;
  color: #ffffff;
}

/* Image Question Styles */
.image-question-display {
  margin: 20px 0;
  text-align: center;
}

.question-image {
  max-width: 100%;
  max-height: 400px;
  border-radius: 8px;
  display: block;
  margin: 0 auto;
}

/* Match Pairs Styles */
.pair-matching-display {
  display: flex;
  gap: 30px;
  margin-top: 20px;
  flex-wrap: nowrap;
  align-items: stretch;
}

.left-column,
.right-column {
  flex: 1;
  min-width: 200px;
  display: flex;
  flex-direction: column;
}

.match-column-title {
  text-align: center;
  margin-bottom: 15px;
  font-size: 28px;
  font-weight: 600;
  color: #ffffff;
}

.left-items,
.right-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  flex: 1;
}

.match-item {
  padding: 16px 18px;
  background: #ffffff;
  color: #333333;
  border-radius: 4px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.3s;
  font-weight: 600;
  /* Font size increased 1.5x for better readability */
  font-size: clamp(27px, 6vw, 48px);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  word-wrap: break-word;
  overflow-wrap: break-word;
  flex: 1;
  display: flex;
  align-items: center;
}

.match-item:hover {
  border-color: #007cba;
  background: #f0f8ff;
}

.match-item.selected {
  border-color: #4caf50;
  background: #e8f5e9;
}

/* Drag and Drop Styles */
.drag-drop-container {
  margin-top: 20px;
}

.sentence-builder {
  background: rgba(255, 255, 255, 0.1);
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  min-height: 80px;
}

.sentence-text {
  font-size: 24px; /* 1.5x increase from 16px */
  line-height: 2.2;
  word-spacing: 4px;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-end;
}

.blank-slot {
  display: inline-block;
  position: relative;
  flex: 1 1 auto;
  min-width: 80px;
  max-width: 200px;
  height: auto;
  padding: 6px 4px;
  background: transparent;
  border: none;
  border-bottom: 3px solid #666;
  border-radius: 0;
  margin: 2px;
  vertical-align: bottom;
  text-align: center;
  line-height: 1.6;
  font-weight: bold;
  color: #333;
  font-size: 20px; /* 1.5x increase for better readability */
  transition: all 0.3s;
}

.blank-slot.filled {
  border-bottom: 2px solid #4caf50;
  background: #e8f5e9;
  border-radius: 2px;
}

/* Filled blank slot - clickable to remove word */
.blank-slot:not(:empty) {
  cursor: pointer;
  position: relative;
  background: #fff3cd !important;
  border-bottom: 3px solid #ffc107 !important;
  border-radius: 4px;
  padding: 6px 28px 6px 10px !important;
}

/* Remove indicator (X) on filled blanks */
.blank-slot:not(:empty)::after {
  content: '×';
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  color: #999;
  font-size: 18px;
  font-weight: bold;
  opacity: 0.5;
  transition: all 0.2s;
}

/* Hover effect on filled blanks - shows removal hint */
.blank-slot:not(:empty):hover {
  background: rgba(244, 67, 54, 0.2) !important;
  border-color: #f44336 !important;
}

.blank-slot:not(:empty):hover::after {
  color: #f44336;
  opacity: 1;
  transform: translateY(-50%) scale(1.2);
}

/* Touch device - show X more prominently */
@media (hover: none) {
  .blank-slot:not(:empty)::after {
    opacity: 0.8;
    font-size: 20px;
  }
}

.drag-drop-options {
  background: #f9f9f9;
  padding: 15px;
  border-radius: 8px;
  border: 1px solid #ddd;
}

.drag-instruction {
  margin: 0 0 10px 0;
  font-weight: bold;
  color: #333333;
}

.word-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.draggable-word {
  padding: 10px 16px;
  background: #007cba;
  color: white;
  border-radius: 20px;
  cursor: move;
  user-select: none;
  transition: all 0.3s;
  font-weight: 500;
  font-size: 20px; /* 1.5x increase for better readability */
}

.draggable-word:hover {
  background: #005a87;
  transform: scale(1.05);
}

.draggable-word.dragging {
  opacity: 0.5;
}

/* Text Input Styles */
.text-input-container {
  margin-top: 20px;
}

.text-input-wrapper {
  background: rgba(255, 255, 255, 0.1);
  padding: 20px;
  border-radius: 8px;
}

.text-input-label {
  display: block;
  margin-bottom: 10px;
  font-weight: bold;
  color: #ffffff;
}

.text-input-field {
  width: 100%;
  padding: 10px;
  font-size: 16px;
  border: 2px solid #ddd;
  border-radius: 4px;
  box-sizing: border-box;
  transition: border-color 0.3s;
}

.text-input-field:focus {
  border-color: #007cba;
  outline: none;
}

.text-input-hint {
  display: block;
  margin-top: 5px;
  color: #cccccc;
  font-size: 14px;
}

/* Regular MCQ Options */
.options {
  background-color: rgba(255, 255, 255, 0.1);
  padding: 20px;
  border-radius: 8px;
  margin-top: 15px;
}

/* Hidden elements by default */
.question-feedback,
.submit-button,
.feedback-container,
.quiz-results,
.registration-prompt {
  display: none;
}

/* Show elements when needed */
.question-feedback.show,
.submit-button.show,
.feedback-container.show,
.quiz-results.show,
.registration-prompt.show {
  display: block;
}

/* Reset and base styles */
.quiz-container, 
.quiz-grid,
.flashcard-sets,
.level-card {
  font-family: var(--quiz-font-family);
  line-height: 1.5;
  color: var(--quiz-text-dark);
}

/* Common button styles */
.quiz-btn,
.level-button,
.join-button,
.submit-button,
.next-button,
.prev-button,
.study-button,
.retry-quiz-btn,
.view-answers-btn,
.study-flashcards-btn,
.my-progress-btn,
.points-table-btn,
.back-home-btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: var(--quiz-border-radius-md);
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: all var(--quiz-transition-fast);
  border: none;
  background-color: var(--quiz-primary-color);
  color: var(--quiz-text-light);
  text-decoration: none;
  box-shadow: var(--quiz-shadow-sm);
  min-width: 140px;
}

.quiz-btn:hover,
.level-button:hover,
.join-button:hover,
.submit-button:hover,
.next-button:hover,
.prev-button:hover,
.study-button:hover {
  transform: translateY(-2px);
  box-shadow: var(--quiz-shadow-md);
  background-color: #333333;
}

/* Card component */
.quiz-card,
.flashcard-item,
.level-card {
  background: white;
  border-radius: var(--quiz-border-radius-md);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: transform var(--quiz-transition-fast);
  overflow: hidden;
  border: 1px solid #000000;
}

.quiz-card:hover,
.flashcard-item:hover,
.level-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--quiz-shadow-md);
}

/* Grid layouts - 3 columns for desktop */
.quiz-grid,
.level-progress-grid,
.flashcard-sets-grid {
  display: grid;
  grid-template-columns: repeat(3, 2rem);
  gap: 10px;
  margin: var(--quiz-spacing-lg) 0;
}

/* Quiz card compact styling - reduced height by 30% */
.quiz-card {
  display: flex;
  flex-direction: row;
  padding: 1px;
  min-height: 30px;
}

.quiz-card-thumbnail,
.quiz-card-qr {
  width: 80px;
  height: 80px;
  min-width: 80px;
  flex-shrink: 0;
  margin-right: 12px;
}

.quiz-card-qr img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.quiz-card-content {
  flex: 1;
  min-width: 0;
}

.quiz-card-title {
  font-size: 0.9rem;
  margin: 0 0 6px 0;
  line-height: 1.2;
}

.quiz-card-title a {
  color: inherit;
  text-decoration: none;
}

.quiz-card-description {
  font-size: 0.72rem;
  color: #666;
  margin: 0 0 8px 0;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.quiz-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  font-size: 0.68rem;
  color: #555;
  margin-bottom: 8px;
}

.quiz-meta-item {
  display: flex;
  align-items: center;
  gap: 3px;
}

.quiz-meta-item .dashicons {
  font-size: 12px;
  width: 12px;
  height: 12px;
}

.quiz-card-actions {
  margin-top: auto;
}

.quiz-start-btn {
  display: inline-block;
  padding: 5px 12px;
  font-size: 0.72rem;
  background: var(--quiz-primary-color, #000);
  color: #fff;
  border-radius: 4px;
  text-decoration: none;
}

/* Category color badges for quiz cards */
.quiz-category-tag {
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.65rem;
  font-weight: 600;
}

.category-color-0 { background: #e3f2fd; color: #1565c0; }
.category-color-1 { background: #f3e5f5; color: #7b1fa2; }
.category-color-2 { background: #e8f5e9; color: #2e7d32; }
.category-color-3 { background: #fff3e0; color: #ef6c00; }
.category-color-4 { background: #fce4ec; color: #c2185b; }
.category-color-5 { background: #e0f7fa; color: #00838f; }
.category-color-6 { background: #fff8e1; color: #f9a825; }
.category-color-7 { background: #f1f8e9; color: #558b2f; }
.category-color-8 { background: #ede7f6; color: #5e35b1; }
.category-color-9 { background: #e8eaf6; color: #3949ab; }
.category-color-10 { background: #fbe9e7; color: #d84315; }
.category-color-11 { background: #eceff1; color: #455a64; }

/* Category color applied to card border */
.quiz-card.category-color-0 { border-left: 4px solid #1565c0; }
.quiz-card.category-color-1 { border-left: 4px solid #7b1fa2; }
.quiz-card.category-color-2 { border-left: 4px solid #2e7d32; }
.quiz-card.category-color-3 { border-left: 4px solid #ef6c00; }
.quiz-card.category-color-4 { border-left: 4px solid #c2185b; }
.quiz-card.category-color-5 { border-left: 4px solid #00838f; }
.quiz-card.category-color-6 { border-left: 4px solid #f9a825; }
.quiz-card.category-color-7 { border-left: 4px solid #558b2f; }
.quiz-card.category-color-8 { border-left: 4px solid #5e35b1; }
.quiz-card.category-color-9 { border-left: 4px solid #3949ab; }
.quiz-card.category-color-10 { border-left: 4px solid #d84315; }
.quiz-card.category-color-11 { border-left: 4px solid #455a64; }

/* Tablet: 2 columns */
@media (max-width: 1024px) {
  .quiz-grid,
  .level-progress-grid,
  .flashcard-sets-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile: 1 column, 100% width, QR visible */
@media (max-width: 768px) {
  .quiz-grid,
  .level-progress-grid,
  .flashcard-sets-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .quiz-card {
    flex-direction: row;
    width: 100%;
    padding: 10px;
  }

  .quiz-card-thumbnail,
  .quiz-card-qr {
    width: 70px;
    height: 70px;
    min-width: 70px;
    margin-right: 10px;
  }

  .quiz-card-title {
    font-size: 0.95rem;
  }

  .quiz-card-meta {
    font-size: 0.7rem;
  }

  .quiz-start-btn {
    font-size: 0.75rem;
    padding: 6px 14px;
  }
}

/* Status badges */
.status-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
  font-size: var(--quiz-font-size-sm);
  font-weight: 600;
}

.status-badge.success {
  background-color: #000000;
  color: white;
}

.status-badge.warning {
  background-color: #333333;
  color: white;
}

.status-badge.error {
  background-color: #000000;
  color: white;
}

/* Container layouts */
.quiz-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--quiz-spacing-lg);
}

/* Loading spinner */
.quiz-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--quiz-spacing-xl);
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 5px solid rgba(0, 0, 0, 0.1);
  border-top-color: var(--quiz-primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Option styles - improved contrast */
.option {
  background-color: transparent;
  margin-bottom: 8px;
  border-radius: 5px;
  padding: 10px;
  transition: background-color var(--quiz-transition-fast);
}
.music-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 100;
    background: #fff;
    border: 2px solid #007bff;
    color: #007bff;
    padding: 8px 15px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 3px 6px rgba(0,0,0,0.1);
}

.music-toggle:hover {
    background: #007bff;
    color: #fff;
}
.option:hover {
  background-color: #ffcccc;
}

.option-text {
  color: #ffffff;
  display: inline-block;
  vertical-align: middle;
  margin-left: 8px;
  font-weight: 500;
}

.option-marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: white;
  font-weight: bold;
}

/* Quiz Results Actions Styling */
.results-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 25px 0;
  padding: 0 10px;
}

.results-actions button {
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 13px;
  border: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  text-align: center;
  white-space: nowrap;
}

.results-actions button:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 10px rgba(0,0,0,0.2);
}

/* Button-specific styles */
.retake-quiz-btn {
  background: var(--button-retry);
  color: white;
}

.retake-quiz-btn:hover {
  background: var(--button-retry-hover);
}

.save-pdf-btn {
  background: #e74c3c;
  color: white;
}

.save-pdf-btn:hover {
  background: #c0392b;
}

.save-pdf-btn i {
  margin-right: 5px;
}

.view-answers-btn {
  background: var(--button-view);
  color: white;
}

.view-answers-btn:hover {
  background: var(--button-view-hover);
}

.study-flashcards-btn {
  background: var(--button-flashcards);
  color: white;
}

.study-flashcards-btn:hover {
  background: var(--button-flashcards-hover);
}

.my-progress-btn {
  background: var(--button-progress);
  color: white;
}

.my-progress-btn:hover {
  background: var(--button-progress-hover);
}

.points-table-btn {
  background: var(--button-points);
  color: white;
}

.points-table-btn:hover {
  background: var(--button-points-hover);
}

.back-home-btn {
  background: var(--button-home);
  color: white;
}

.back-home-btn:hover {
  background: var(--button-home-hover);
}

/* Review Quiz Toggle Button */
.review-toggle {
  background: #3f51b5;
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  cursor: pointer;
  margin: 20px auto;
  display: block;
  font-weight: 600;
  transition: all 0.2s ease;
}

.review-toggle:hover {
  background: #303f9f;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.review-toggle.active {
  background: #000000;
}

.review-toggle.active:hover {
  background: #333333;
}

/* Questions Review Section */
.questions-review {
  display: none;
  margin: 20px 0;
  border-top: 1px solid #ddd;
  padding-top: 20px;
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.questions-review.visible {
  display: block;
}

/* Social Share Styling */
.social-share {
  text-align: center;
  margin: 20px 0;
  padding: 15px;
  background: #f8f8f8;
  border-radius: 8px;
}

.social-share-title {
  display: block;
  margin-bottom: 12px;
  font-weight: 500;
  color: #444;
  font-size: 1.1rem;
}

.share-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 45px;
  height: 45px;
  margin: 0 8px;
  border-radius: 50%;
  color: white;
  font-size: 20px;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.share-button:hover {
  transform: translateY(-3px) scale(1.1);
  box-shadow: 0 5px 10px rgba(0,0,0,0.25);
}

.share-whatsapp {
  background: #25d366;
}

.share-whatsapp:hover {
  background: #20bd5c;
}

.share-facebook {
  background: #1877f2;
}

.share-facebook:hover {
  background: #166bda;
}

.share-telegram {
  background: #0088cc;
}

.share-telegram:hover {
  background: #0077b3;
}

.share-twitter {
  background: #1da1f2;
}

.share-twitter:hover {
  background: #1a94da;
}

/* Quiz results card styling */
.quiz-results {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  max-width: 800px;
  margin: 0 auto;
}

.results-summary {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 30px 20px;
  background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
  color: white;
}

.score-display {
  text-align: center;
  margin-bottom: 20px;
}

.score-value {
  font-size: 4rem;
  font-weight: 700;
  line-height: 1;
  text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.score-label {
  font-size: 1.5rem;
  margin-top: 10px;
  font-weight: 600;
  text-transform: uppercase;
}

.score-excellent {
  color: #000000;
}

.score-good {
  color: #000000;
}

.score-average {
  color: #333333;
}

.score-poor {
  color: #000000;
}

.result-remark {
  font-size: 1.5rem;
  margin: 20px 0;
  text-align: center;
  font-weight: 500;
}

.score-breakdown {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-top: 20px;
}

.correct-answers,
.wrong-answers,
.total-questions {
  text-align: center;
  padding: 10px 15px;
  background: rgba(255,255,255,0.2);
  border-radius: 8px;
  min-width: 100px;
}

.count {
  display: block;
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1;
}

.label {
  display: block;
  margin-top: 5px;
  font-size: 0.9rem;
  opacity: 0.9;
}

/* Media queries for responsive design */
@media (max-width: 768px) {
  .quiz-grid,
  .level-progress-grid,
  .flashcard-sets-grid {
    grid-template-columns: 1fr;
  }
  
  .quiz-btn,
  .level-button,
  .join-button {
    display: block;
    width: 100%;
    margin-bottom: var(--quiz-spacing-md);
  }

  .results-actions button {
    display: inline-block;
    width: fit-content;
    min-width: auto;
    padding: 10px 12px;
    font-size: 13px;
  }

  .results-actions {
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 8px;
  }
  
  .score-value {
    font-size: 3rem;
  }
  
  .score-breakdown {
    flex-direction: column;
    gap: 10px;
  }
  
  .correct-answers,
  .wrong-answers,
  .total-questions {
    width: 100%;
  }
  
  .results-summary {
    padding: 20px 15px;
  }
}

/* Additional animations for better UX */
.results-actions button {
  position: relative;
  overflow: hidden;
}

.results-actions button::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255,255,255,0.1);
  transform: translateX(-100%);
  transition: transform 0.3s ease;
}

.results-actions button:hover::after {
  transform: translateX(0);
}

/* Style for detailed results section */
.detailed-results {
  padding: 20px;
}

.result-item {
  margin-bottom: 20px;
  padding: 15px;
  border-radius: 8px;
  background: #f9f9f9;
  border-left: 5px solid #ddd;
}

.result-item.correct {
  border-left-color: var(--button-retry);
  background: rgba(76, 175, 80, 0.1);
}

.result-item.incorrect {
  border-left-color: var(--button-points);
  background: rgba(244, 67, 54, 0.1);
}

.result-explanation {
  margin-top: 10px;
  border-top: 1px solid #eee;
  padding-top: 10px;
}

.explanation-toggle {
  color: var(--quiz-primary-color);
  cursor: pointer;
  font-weight: 500;
  display: inline-block;
  padding: 5px 10px;
  background: rgba(58, 86, 228, 0.1);
  border-radius: 4px;
  transition: all 0.2s ease;
}

.explanation-toggle:hover {
  background: rgba(58, 86, 228, 0.2);
}

.explanation-content {
  margin-top: 10px;
  padding: 10px;
  background: white;
  border-radius: 4px;
  border: 1px solid #eee;
}

/* Remove dark blue background from question container */
.question {
  background-color: transparent !important;
  background: transparent !important;
}

.options {
  background-color: transparent !important;
  background: transparent !important;
}

.question-item {
  background-color: transparent !important;
  background: transparent !important;
}

.options-container {
  background-color: transparent !important;
  background: transparent !important;
}

/* ============================================
   NAVIGATION - IMPROVED
   ============================================ */

.quiz-navigation {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 15px;
  background: transparent;
  margin-top: 20px;
  flex-wrap: nowrap;
  width: 100%;
  max-width: 100%;
}

.nav-button {
  padding: 6px 10px;
  font-size: clamp(14px, 3vw, 24px);
  font-weight: 600;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  min-width: auto;
  width: auto;
  height: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 1;
  white-space: nowrap;
  overflow: visible;
}

.nav-button:hover:not(:disabled) {
  background: #333;
  color: white;
  transform: scale(1.05);
}

.nav-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.nav-prev, .nav-next {
  font-size: clamp(14px, 3vw, 18px);
  flex: 0 0 auto;
}

.question-counter {
  font-size: clamp(12px, 3vw, 16px);
  font-weight: 700;
  padding: 6px 10px;
  background: transparent;
  border: none;
  border-radius: 0;
  width: auto;
  min-width: auto;
  text-align: center;
  color: #333;
  white-space: nowrap;
  flex: 1 0 auto;
  min-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================
   MATCH PAIR QUESTIONS - FIXED LAYOUT
   ============================================ */

.match-pair-container {
  display: flex;
  gap: clamp(10px, 2vw, 20px);
  width: 100%;
  overflow-x: auto;
}

.match-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 2vw, 10px);
  min-width: auto;
  width: 100%;
}

.match-item {
  padding: clamp(8px, 2vw, 12px);
  background: white;
  border: 1px solid #333;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.3s ease;
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
  font-size: clamp(15px, 2.5vw, 25px);
  line-height: 1.3;
  min-height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  hyphens: auto;
}

.match-item:hover {
  background: #f0f0f0;
  border-color: #000;
  transform: scale(1.02);
}

.match-item.selected {
  background: #333;
  color: white;
}

.match-item.matched {
  opacity: 0.5;
  pointer-events: none;
}

/* ============================================
   DRAG & DROP QUESTIONS - IMPROVED
   ============================================ */

.drag-drop-container {
  display: flex;
  flex-direction: column;
  gap: clamp(15px, 3vw, 20px);
  width: 100%;
}

.word-pool {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(8px, 2vw, 10px);
  padding: clamp(12px, 2vw, 15px);
  background: #f9f9f9;
  border: 2px dashed #333;
  border-radius: 6px;
  min-height: auto;
}

.draggable-word {
  padding: clamp(8px, 2vw, 10px) clamp(12px, 2vw, 15px);
  background: #333;
  color: white;
  border-radius: 6px;
  cursor: grab;
  font-weight: 600;
  font-size: clamp(12px, 2.5vw, 14px);
  transition: all 0.3s ease;
  white-space: normal;
  word-break: break-word;
  user-select: none;
}

.draggable-word:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.draggable-word:active {
  cursor: grabbing;
  opacity: 0.8;
}

.draggable-word.dragging {
  opacity: 0.5;
  transform: scale(0.95);
}

.answer-boxes {
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 2vw, 15px);
  width: 100%;
}

.answer-box {
  min-height: auto;
  padding: clamp(10px, 2vw, 12px);
  border: 2px solid #ddd;
  border-radius: 6px;
  background: white;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: clamp(8px, 2vw, 10px);
  transition: all 0.3s ease;
  flex-wrap: wrap;
}

.answer-box:hover {
  border-color: #333;
  background: #f9f9f9;
}

.answer-box.drop-target {
  border: 2px dashed #333;
}

.answer-box.drag-over {
  background: #e8f4f8;
  border-color: #333;
  box-shadow: inset 0 0 10px rgba(51, 51, 51, 0.1);
}

.answer-word {
  padding: clamp(6px, 1.5vw, 8px) clamp(10px, 2vw, 12px);
  background: #333;
  color: white;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: clamp(6px, 1.5vw, 8px);
  font-weight: 600;
  font-size: clamp(12px, 2.5vw, 14px);
}

.remove-word-btn {
  background: red;
  color: white;
  border: none;
  border-radius: 50%;
  width: clamp(18px, 4vw, 24px);
  height: clamp(18px, 4vw, 24px);
  padding: 0;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.remove-word-btn:hover {
  background: darkred;
  transform: scale(1.1);
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

@media (max-width: 768px) {
  .match-pair-container {
    flex-direction: column;
  }

  .match-column {
    min-width: 100%;
  }

  /* Match the pair: single column on mobile, large font */
  .pair-matching-display {
    flex-direction: column;
    gap: 20px;
  }

  .left-column,
  .right-column {
    min-width: 100%;
  }

  .match-column-title {
    font-size: 24px;
  }

  .match-item {
    font-size: clamp(18px, 5vw, 28px);
    padding: 14px 16px;
  }

  /* Drag-and-drop blanks: single row underlines on mobile */
  .sentence-text {
    flex-wrap: wrap;
    gap: 4px;
  }

  .blank-slot {
    min-width: 50px;
    max-width: 140px;
    flex: 1 1 auto;
  }

  .quiz-navigation {
    gap: 10px;
    flex-wrap: nowrap;
    justify-content: center;
  }

  .nav-button {
    font-size: 20px;
    padding: 6px 8px;
    min-width: auto;
  }

  .question-counter {
    font-size: 14px;
    padding: 6px 8px;
    min-width: auto;
    width: auto;
  }

  .word-pool {
    flex-direction: column;
  }

  .draggable-word {
    width: 100%;
    text-align: center;
  }

  .answer-box {
    flex-wrap: wrap;
  }
}

/* ================================================================================================
   SECTION 5: QUIZ NAVIGATION (quiz-navigation.css)
   ================================================================================================ */

/* Combining level-buttons.css and level-lock.css */

/* Level Button Styles */
.level-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--quiz-spacing-md);
  margin-top: var(--quiz-spacing-md);
}

.level-button {
  padding: 0.6rem 1.2rem;
  background-color: var(--quiz-primary-color);
  color: white;
  border-radius: var(--quiz-border-radius-md);
  text-decoration: none;
  font-weight: 600;
  transition: all var(--quiz-transition-fast);
}

.level-button:hover {
  background-color: #2a45d0;
  transform: translateY(-2px);
  box-shadow: var(--quiz-shadow-md);
}

.level-button.disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

.next-level-button {
  background-color: var(--quiz-success);
}

.next-level-button:hover {
  background-color: #218838;
}

.study-button {
  background-color: var(--quiz-info);
}

.study-button:hover {
  background-color: #138496;
}

/* Level Card Styles */
.level-card {
  position: relative;
  display: flex;
  align-items: center;
  padding: var(--quiz-spacing-md);
  border-radius: var(--quiz-border-radius-md);
  box-shadow: var(--quiz-shadow-sm);
  background-color: white;
  transition: all var(--quiz-transition-fast);
  overflow: hidden;
}

.level-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--quiz-shadow-md);
}

.level-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: var(--quiz-primary-color);
  color: white;
  font-size: 1.5rem;
  font-weight: bold;
  margin-right: var(--quiz-spacing-lg);
  flex-shrink: 0;
}

.level-content {
  flex-grow: 1;
}

.level-content h3 {
  margin-top: 0;
  margin-bottom: var(--quiz-spacing-xs);
}

.level-status {
  font-weight: 600;
  margin-bottom: var(--quiz-spacing-xs);
}

.level-score {
  color: #666;
  margin-bottom: var(--quiz-spacing-md);
}

/* State-specific styles */
.level-card.completed .level-number {
  background-color: var(--quiz-success);
}

.level-card.completed .level-status {
  color: var(--quiz-success);
}

.level-card.unlocked .level-number {
  background-color: var(--quiz-primary-color);
}

.level-card.unlocked .level-status {
  color: var(--quiz-primary-color);
}

.level-card.locked {
  opacity: 0.7;
}

.level-card.locked .level-number {
  background-color: #888;
}

.level-card.locked .level-status {
  color: #888;
}

.level-card.locked:before {
  content: "??";
  position: absolute;
  top: 15px;
  right: 15px;
  font-size: 1.5rem;
}

.level-message {
  font-size: var(--quiz-font-size-sm);
  color: #888;
  font-style: italic;
}

/* Level progress bar */
.level-progress {
  height: 8px;
  background-color: #eee;
  border-radius: 4px;
  margin: var(--quiz-spacing-sm) 0;
  overflow: hidden;
}

.level-progress-fill {
  height: 100%;
  background-color: var(--quiz-primary-color);
  border-radius: 4px;
  transition: width var(--quiz-transition-medium);
}

/* Quiz sequence navigation */
.quiz-sequence-nav {
  display: flex;
  justify-content: space-between;
  padding: var(--quiz-spacing-md);
  background-color: #f5f5f5;
  border-radius: var(--quiz-border-radius-md);
  margin-bottom: var(--quiz-spacing-lg);
}

.quiz-sequence-item {
  flex: 1;
  text-align: center;
  padding: var(--quiz-spacing-sm);
  position: relative;
}

.quiz-sequence-item:not(:last-child):after {
  content: "";
  position: absolute;
  top: 50%;
  right: -10px;
  width: 20px;
  height: 2px;
  background-color: #ddd;
}

.quiz-sequence-item.active {
  font-weight: bold;
  color: var(--quiz-primary-color);
}

.quiz-sequence-item.completed {
  color: var(--quiz-success);
}

/* Responsive design */
@media (max-width: 768px) {
  .level-card {
    flex-direction: column;
    text-align: center;
  }

  .level-number {
    margin-right: 0;
    margin-bottom: var(--quiz-spacing-md);
  }

  .level-buttons {
    justify-content: center;
  }
}

/* ================================================================================================
   SECTION 6: QUIZ INTERFACE (quiz-interface.css)
   ================================================================================================ */

/* Combining quiz-display.css, modern-quiz.css, and render-quiz-styles.css */

/* Quiz Display Section */
.quiz-dashboard {
  background-color: var(--quiz-background-light);
  border-radius: var(--quiz-border-radius-lg);
  padding: var(--quiz-spacing-lg);
}

.quiz-dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--quiz-spacing-lg);
  flex-wrap: wrap;
}

.quiz-dashboard-header h2 {
  margin: 0;
  color: var(--quiz-primary-color);
}
.music-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 100;
    background: #fff;
    border: 2px solid #007bff;
    color: #007bff;
    padding: 8px 15px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 3px 6px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.music-toggle:hover {
    background: #007bff;
    color: #fff;
}
.quiz-filters {
  display: flex;
  gap: var(--quiz-spacing-md);
  flex-wrap: wrap;
  margin: var(--quiz-spacing-md) 0;
}

.filter-group {
  display: flex;
  flex-direction: column;
}

.filter-group label {
  font-size: var(--quiz-font-size-sm);
  margin-bottom: var(--quiz-spacing-xs);
  font-weight: 600;
}

.filter-group select,
.filter-group input {
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: var(--quiz-border-radius-sm);
}

/* Questions & Options Display */
.questions-container {
  margin-top: var(--quiz-spacing-lg);
}

.question {
  background-color: white;
  border-radius: var(--quiz-border-radius-md);
  padding: var(--quiz-spacing-lg);
  margin-bottom: var(--quiz-spacing-lg);
  box-shadow: var(--quiz-shadow-sm);
}

.question h3 {
  margin-top: 0;
  color: var(--quiz-primary-color);
  font-size: var(--quiz-font-size-lg);
  border-bottom: 1px solid #eee;
  padding-bottom: var(--quiz-spacing-sm);
}

.question-content {
  margin-top: var(--quiz-spacing-md);
}

.options {
  margin-top: var(--quiz-spacing-md);
}

.option {
  display: block;
  padding: var(--quiz-spacing-md);
  margin-bottom: var(--quiz-spacing-sm);
  border: 1px solid #eee;
  border-radius: var(--quiz-border-radius-sm);
  cursor: pointer;
  transition: all var(--quiz-transition-fast);
}

.option:hover {
  background-color: rgba(58, 86, 228, 0.05);
  border-color: var(--quiz-primary-color);
}

.option input[type="radio"] {
  margin-right: var(--quiz-spacing-sm);
}

/* Quiz Navigation */
.quiz-navigation {
  display: flex;
  justify-content: space-between;
  margin-top: var(--quiz-spacing-lg);
}

/* Quiz Timer in Navigation */
.quiz-navigation .quiz-timer {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: #000000;
  background: #ffffff;
  padding: 10px 20px;
  border-radius: 6px;
  border: 2px solid #000000;
  min-width: 100px;
  text-align: center;
  white-space: nowrap;
}

.quiz-navigation .quiz-timer.warning {
  color: #ff9800;
  border-color: #ff9800;
  animation: timerWarning 0.8s ease-in-out infinite;
}

.quiz-navigation .quiz-timer.critical {
  color: #f44336;
  border-color: #f44336;
  animation: timerCritical 0.4s ease-in-out infinite;
}

/* Responsive timer in navigation */
@media (max-width: 480px) {
  .quiz-navigation .quiz-timer {
    font-size: 14px;
    padding: 8px 12px;
    min-width: 80px;
  }
}

/* Quiz Results Display */
.quiz-results {
  background-color: white;
  border-radius: var(--quiz-border-radius-md);
  padding: var(--quiz-spacing-lg);
  margin-top: var(--quiz-spacing-lg);
  box-shadow: var(--quiz-shadow-md);
}

.result-summary {
  text-align: center;
  margin-bottom: var(--quiz-spacing-lg);
}

.result-score {
  font-size: 2.5rem;
  font-weight: bold;
  color: var(--quiz-primary-color);
}

.result-grade {
  display: inline-block;
  font-size: 1.5rem;
  font-weight: bold;
  margin: var(--quiz-spacing-md);
  padding: var(--quiz-spacing-sm) var(--quiz-spacing-md);
  border-radius: 50%;
  background-color: var(--quiz-accent-color);
  color: white;
}

.result-message {
  font-size: var(--quiz-font-size-lg);
  margin: var(--quiz-spacing-md) 0;
}

/* Modern Quiz Elements */
.question-progress {
  display: flex;
  margin-bottom: var(--quiz-spacing-lg);
}

.progress-step {
  flex: 1;
  height: 4px;
  background-color: #eee;
  margin: 0 2px;
}

.progress-step.active {
  background-color: var(--quiz-primary-color);
}

.progress-step.correct {
  background-color: var(--quiz-success);
}

.progress-step.incorrect {
  background-color: var(--quiz-error);
}

/* Feedback animation */
@keyframes fadeInOut {
  0% { opacity: 0; transform: translateY(-20px); }
  20% { opacity: 1; transform: translateY(0); }
  80% { opacity: 1; }
  100% { opacity: 0; }
}

.feedback-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
}

.feedback-message {
  padding: var(--quiz-spacing-md) var(--quiz-spacing-lg);
  border-radius: var(--quiz-border-radius-md);
  background-color: white;
  box-shadow: var(--quiz-shadow-lg);
  animation: fadeInOut 2s forwards;
}

/* Quiz Navigation Spacing */
.quiz-navigation,
.quiz-nav,
.quiz-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--quiz-spacing-lg) var(--quiz-spacing-md);
  margin-top: var(--quiz-spacing-xl);
  background-color: #f5f5f5;
  border-radius: var(--quiz-border-radius-md);
  gap: var(--quiz-spacing-md);
}

.quiz-navigation button,
.quiz-nav button,
.quiz-controls button {
  flex: 0 0 auto;
  width: fit-content;
  min-width: auto;
  padding: 0.6rem 1.2rem;
  background-color: var(--quiz-primary-color);
  color: white;
  border: none;
  border-radius: var(--quiz-border-radius-md);
  cursor: pointer;
  font-weight: 600;
  white-space: nowrap;
  transition: all var(--quiz-transition-fast);
}

.quiz-navigation button:hover,
.quiz-nav button:hover,
.quiz-controls button:hover {
  background-color: #333;
  transform: translateY(-2px);
  box-shadow: var(--quiz-shadow-md);
}

.quiz-navigation button:disabled,
.quiz-nav button:disabled,
.quiz-controls button:disabled {
  background-color: #ccc;
  cursor: not-allowed;
  transform: none;
}

.feedback-incorrect {
  border-left: 4px solid var(--quiz-error);
}

/* ========== COMPREHENSIVE QUESTION STYLING - 4 LAYERS ========== */

/* LAYER 1: Question Container */
.question-wrapper,
.quiz-question {
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  border: 2px solid #e0e0e0;
  border-radius: var(--quiz-border-radius-lg);
  padding: var(--quiz-spacing-xl);
  margin-bottom: var(--quiz-spacing-xl);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
}

.question-wrapper:hover {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  border-color: #333;
}

/* LAYER 2: Question Text */
.question-text,
.quiz-question-text,
.question h3,
.question-title {
  font-size: var(--quiz-font-size-xl);
  font-weight: 700;
  color: var(--quiz-text-dark);
  margin: 0 0 var(--quiz-spacing-lg) 0;
  padding: var(--quiz-spacing-md);
  border-bottom: 3px solid #333;
  line-height: 1.6;
}

.question-number,
.question-counter {
  display: inline-block;
  background-color: var(--quiz-primary-color);
  color: var(--quiz-text-light);
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
  font-size: var(--quiz-font-size-sm);
  margin-bottom: var(--quiz-spacing-md);
  font-weight: 600;
}

/* LAYER 3: Answer Options - Generic fallback (overridden by specific types) */
.options-container {
  display: flex;
  flex-direction: column;
  gap: var(--quiz-spacing-md);
}

/* Old fallback rules - superseded by question-type-specific styling */
/*
.option,
.quiz-option,
.answer-option {
  display: flex;
  align-items: center;
  padding: var(--quiz-spacing-md) var(--quiz-spacing-lg);
  border: 2px solid #ddd;
  border-radius: var(--quiz-border-radius-md);
  cursor: pointer;
  background-color: white;
  transition: all 0.2s ease;
}

.option:hover,
.quiz-option:hover,
.answer-option:hover {
  border-color: #333;
  background-color: #f0f0f0;
  transform: translateX(5px);
}

.option input[type="radio"],
.option input[type="checkbox"],
.quiz-option input,
.answer-option input {
  margin-right: var(--quiz-spacing-md);
  width: 20px;
  height: 20px;
  cursor: pointer;
}

.option-text,
.option-label,
.quiz-option-text {
  flex: 1;
  font-size: var(--quiz-font-size-md);
  color: var(--quiz-text-dark);
  line-height: 1.5;
}

.option.selected,
.quiz-option.selected,
.option input:checked + .option-text {
  background-color: #e3f2fd;
  border-color: #333;
  font-weight: 600;
}
*/

/* LAYER 4: Feedback & Results */
.feedback-section,
.answer-feedback,
.result-feedback {
  margin-top: var(--quiz-spacing-lg);
  padding: var(--quiz-spacing-lg);
  border-radius: var(--quiz-border-radius-md);
  border-left: 5px solid;
}

.feedback-correct,
.answer-correct,
.feedback-success {
  background-color: #e8f5e9;
  border-left-color: #4caf50;
  color: #2e7d32;
}

.feedback-incorrect,
.answer-incorrect,
.feedback-error {
  background-color: #ffebee;
  border-left-color: #f44336;
  color: #c62828;
}

.feedback-explanation,
.feedback-text {
  margin-top: var(--quiz-spacing-md);
  font-size: var(--quiz-font-size-md);
  line-height: 1.6;
}

.correct-answer,
.user-answer,
.selected-answer {
  padding: var(--quiz-spacing-md);
  margin: var(--quiz-spacing-sm) 0;
  border-radius: var(--quiz-border-radius-sm);
  background-color: rgba(255, 255, 255, 0.5);
  border: 1px solid currentColor;
}

/* Correct answer indicator */
.correct-answer {
  background-color: #c8e6c9;
  color: #2e7d32;
  font-weight: 600;
}

/* User's wrong answer */
.user-answer {
  background-color: #ffcccc;
  color: #c62828;
  font-weight: 600;
}

/* ========== QUESTION TYPES - COMPREHENSIVE 4-LAYER STYLING ========== */

/* ===== MULTIPLE CHOICE (MCQ) ===== */
.multiple-choice-question {
  display: flex;
  flex-direction: column;
}

/* MCQ Layer 1: Container */
.multiple-choice-question {
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  border: 2px solid #e0e0e0;
  border-radius: var(--quiz-border-radius-lg);
  padding: var(--quiz-spacing-lg);
  margin-bottom: var(--quiz-spacing-xl);
}

/* MCQ Layer 2: Question Text */
.multiple-choice-question .question-text,
.multiple-choice-question h4 {
  border-bottom: 3px solid #1976d2;
  color: #1976d2;
  margin: 0 0 var(--quiz-spacing-lg) 0;
  padding-bottom: var(--quiz-spacing-md);
  font-size: var(--quiz-font-size-lg);
}

/* MCQ Layer 3: Options with boxes and hover - Column layout with spacing */
.multiple-choice-question .options-container {
  display: flex;
  flex-direction: column;
  gap: var(--quiz-spacing-lg);
  margin: var(--quiz-spacing-lg) 0 var(--quiz-spacing-xl) 0;
  padding: 0;
  background-color: transparent;
  border-radius: 0;
  border: none;
}

.multiple-choice-question .option-item {
  display: flex;
  align-items: flex-start;
  padding: clamp(8px, 3vw, 16px) clamp(12px, 3vw, 20px);
  border: 3px solid #d0d7e8;
  border-radius: var(--quiz-border-radius-lg);
  background-color: #ffffff;
  cursor: pointer;
  transition: all 0.3s ease;
  min-height: auto;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  width: 100%;
  box-sizing: border-box;
  gap: clamp(8px, 2vw, 12px);
  flex-wrap: wrap;
}

.multiple-choice-question .option-item:hover {
  border-color: #ff6b6b;
  background-color: #fff5f5;
  transform: translateX(2px);
  box-shadow: 0 6px 16px rgba(255, 107, 107, 0.3);
}

.multiple-choice-question .option-item.selected {
  background-color: #e3f2fd;
  border-color: #1976d2;
  font-weight: 600;
  box-shadow: 0 6px 16px rgba(25, 118, 210, 0.3);
}

/* Glow effect for correct answers (Green) */
.multiple-choice-question .option-item.correct-answer {
  border-color: #4caf50;
  background-color: #f1f8e9;
  animation: correctGlow 0.6s ease-out;
  box-shadow: 0 0 20px rgba(76, 175, 80, 0.6), 0 0 40px rgba(76, 175, 80, 0.3);
}

/* Glow effect for wrong answers (Red) */
.multiple-choice-question .option-item.wrong-answer {
  border-color: #f44336;
  background-color: #ffebee;
  animation: wrongGlow 0.6s ease-out;
  box-shadow: 0 0 20px rgba(244, 67, 54, 0.6), 0 0 40px rgba(244, 67, 54, 0.3);
}

/* Animations for glow effects */
@keyframes correctGlow {
  0% {
    box-shadow: 0 0 0px rgba(76, 175, 80, 0);
  }
  50% {
    box-shadow: 0 0 30px rgba(76, 175, 80, 0.8), 0 0 50px rgba(76, 175, 80, 0.4);
  }
  100% {
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.6), 0 0 40px rgba(76, 175, 80, 0.3);
  }
}

@keyframes wrongGlow {
  0% {
    box-shadow: 0 0 0px rgba(244, 67, 54, 0);
  }
  50% {
    box-shadow: 0 0 30px rgba(244, 67, 54, 0.8), 0 0 50px rgba(244, 67, 54, 0.4);
  }
  100% {
    box-shadow: 0 0 20px rgba(244, 67, 54, 0.6), 0 0 40px rgba(244, 67, 54, 0.3);
  }
}

.multiple-choice-question .option-item input[type="radio"] {
  width: clamp(16px, 5vw, 24px);
  height: clamp(16px, 5vw, 24px);
  margin-right: clamp(8px, 2vw, 12px);
  cursor: pointer;
  accent-color: #1976d2;
  flex-shrink: 0;
  margin-top: 2px;
}

.multiple-choice-question .option-item label {
  font-size: clamp(12px, 3vw, 16px);
  color: #333;
  line-height: 1.5;
  cursor: pointer;
  flex: 1;
  margin: 0;
  font-weight: 500;
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
}

/* MCQ Layer 4: Feedback */
.multiple-choice-question .feedback-section {
  margin-top: var(--quiz-spacing-lg);
  padding: var(--quiz-spacing-lg);
  border-radius: var(--quiz-border-radius-md);
  border-left: 5px solid;
}

.multiple-choice-question .feedback-correct {
  background-color: #e8f5e9;
  border-left-color: #4caf50;
  color: #2e7d32;
}

.multiple-choice-question .feedback-incorrect {
  background-color: #ffebee;
  border-left-color: #f44336;
  color: #c62828;
}

/* ===== TRUE/FALSE ===== */
.true-false-question {
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, #ffffff 0%, #f9f9f9 100%);
  border: 2px solid #e0e0e0;
  border-radius: var(--quiz-border-radius-lg);
  padding: var(--quiz-spacing-lg);
  margin-bottom: var(--quiz-spacing-xl);
}

/* True/False Layer 2: Question Text */
.true-false-question .question-text,
.true-false-question h4 {
  border-bottom: 3px solid #ff9800;
  color: #ff9800;
  margin: 0 0 var(--quiz-spacing-lg) 0;
  padding-bottom: var(--quiz-spacing-md);
  font-size: var(--quiz-font-size-lg);
}

/* True/False Layer 3: Options (Column layout with boxes and hover) */
.true-false-question .options-container {
  display: flex;
  flex-direction: column;
  gap: var(--quiz-spacing-lg);
  margin: var(--quiz-spacing-lg) 0 var(--quiz-spacing-xl) 0;
  padding: 0;
  background-color: transparent;
  border-radius: 0;
  border: none;
}

.true-false-question .option-item {
  display: flex;
  align-items: flex-start;
  padding: clamp(8px, 3vw, 16px) clamp(12px, 3vw, 20px);
  border: 3px solid #ffb366;
  border-radius: var(--quiz-border-radius-lg);
  background-color: #ffffff;
  cursor: pointer;
  transition: all 0.3s ease;
  min-height: auto;
  box-shadow: 0 2px 8px rgba(255, 152, 0, 0.1);
  width: 100%;
  box-sizing: border-box;
  gap: clamp(8px, 2vw, 12px);
  flex-wrap: wrap;
}

.true-false-question .option-item:hover {
  border-color: #ff6b6b;
  background-color: #fff5f5;
  transform: translateX(2px);
  box-shadow: 0 6px 16px rgba(255, 107, 107, 0.3);
}

/* Glow effect for correct answers (Green) */
.true-false-question .option-item.correct-answer {
  border-color: #2b922e;
  background-color: #f1f8e9;
  animation: correctGlow 0.6s ease-out;
  box-shadow: 0 0 20px rgba(76, 175, 80, 0.6), 0 0 40px rgba(76, 175, 80, 0.3);
}

/* Glow effect for wrong answers (Red) */
.true-false-question .option-item.wrong-answer {
  border-color: #f44336;
  background-color: #ffebee;
  animation: wrongGlow 0.6s ease-out;
  box-shadow: 0 0 20px rgba(244, 67, 54, 0.6), 0 0 40px rgba(244, 67, 54, 0.3);
}

.true-false-question .option-item.selected {
  background-color: #fff8e1;
  border-color: #ff9800;
  font-weight: 600;
  box-shadow: 0 6px 16px rgba(255, 152, 0, 0.3);
}

.true-false-question .option-item input[type="radio"] {
  width: clamp(16px, 5vw, 24px);
  height: clamp(16px, 5vw, 24px);
  margin-right: clamp(8px, 2vw, 12px);
  cursor: pointer;
  accent-color: #ff9800;
  flex-shrink: 0;
  margin-top: 2px;
}

.true-false-question .option-item label {
  font-size: clamp(12px, 3vw, 18px);
  font-weight: 600;
  color: #333;
  cursor: pointer;
  margin: 0;
  flex: 1;
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
}

/* True/False Layer 4: Feedback */
.true-false-question .feedback-section {
  margin-top: var(--quiz-spacing-lg);
  padding: var(--quiz-spacing-lg);
  border-radius: var(--quiz-border-radius-md);
  border-left: 5px solid;
}

.true-false-question .feedback-correct {
  background-color: #e8f5e9;
  border-left-color: #4caf50;
  color: #2e7d32;
}

.true-false-question .feedback-incorrect {
  background-color: #ffebee;
  border-left-color: #f44336;
  color: #c62828;
}

/* ===== MULTIPLE SELECT ===== */
.multiple-select-question {
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, #ffffff 0%, #f5f5f5 100%);
  border: 2px solid #e0e0e0;
  border-radius: var(--quiz-border-radius-lg);
  padding: var(--quiz-spacing-lg);
  margin-bottom: var(--quiz-spacing-xl);
}

/* Multiple Select Layer 2: Question Text */
.multiple-select-question .question-text,
.multiple-select-question h4 {
  border-bottom: 3px solid #7b1fa2;
  color: #7b1fa2;
  margin: 0 0 var(--quiz-spacing-lg) 0;
  padding-bottom: var(--quiz-spacing-md);
  font-size: var(--quiz-font-size-lg);
}

/* Multiple Select Layer 3: Checkboxes */
.multiple-select-question .options-container {
  display: flex;
  flex-direction: column;
  gap: var(--quiz-spacing-md);
  margin: var(--quiz-spacing-lg) 0 var(--quiz-spacing-xl) 0;
  padding: var(--quiz-spacing-lg);
  background-color: #f9f5fe;
  border-radius: var(--quiz-border-radius-md);
  border: 1px solid #e6d9f5;
}

.multiple-select-question .option-item {
  display: flex;
  align-items: center;
  padding: var(--quiz-spacing-md) var(--quiz-spacing-lg);
  border: 2px solid #d0c4e4;
  border-radius: var(--quiz-border-radius-md);
  background-color: white;
  cursor: pointer;
  transition: all 0.3s ease;
}

.multiple-select-question .option-item:hover {
  border-color: #7b1fa2;
  background-color: #f3e5f5;
  transform: translateX(8px);
  box-shadow: 0 4px 12px rgba(123, 31, 162, 0.15);
}

.multiple-select-question .option-item.selected {
  background-color: #f3e5f5;
  border-color: #7b1fa2;
  font-weight: 600;
}

.multiple-select-question .option-item input[type="checkbox"] {
  width: 22px;
  height: 22px;
  margin-right: var(--quiz-spacing-lg);
  cursor: pointer;
  accent-color: #7b1fa2;
}

.multiple-select-question .option-item label {
  font-size: var(--quiz-font-size-md);
  color: #333;
  line-height: 1.5;
  cursor: pointer;
  flex: 1;
  margin: 0;
}

/* Multiple Select Layer 4: Feedback */
.multiple-select-question .feedback-section {
  margin-top: var(--quiz-spacing-lg);
  padding: var(--quiz-spacing-lg);
  border-radius: var(--quiz-border-radius-md);
  border-left: 5px solid;
}

.multiple-select-question .feedback-correct {
  background-color: #e8f5e9;
  border-left-color: #4caf50;
  color: #2e7d32;
}

.multiple-select-question .feedback-incorrect {
  background-color: #ffebee;
  border-left-color: #f44336;
  color: #c62828;
}

/* ===== MATCHING/PAIRS ===== */
/* === MATCH PAIRS SECTION MOVED TO classic-template.php ===*/


/* === DRAG & DROP SECTION MOVED TO classic-template.php ===*/


/* === ANSWER FILLING (TEXT INPUT) SECTION MOVED TO classic-template.php ===*/


/* ========== RESPONSIVE DESIGN - ALL QUESTION TYPES ========== */
@media (max-width: 768px) {
  /* General responsive adjustments */
  .question-item,
  .multiple-choice-question,
  .true-false-question,
  .multiple-select-question,
  .match-pair-question,
  .dragdrop-question,
  .fill-blanks-question,
  .short-answer-question,
  .text-input-question {
    padding: var(--quiz-spacing-lg);
    margin-bottom: var(--quiz-spacing-lg);
  }
  
  .question-text,
  .question-item h4 {
    font-size: var(--quiz-font-size-lg);
  }
  
  .option-item {
    padding: var(--quiz-spacing-md) var(--quiz-spacing-lg);
    flex-direction: row;
  }
  
  /* MCQ responsive */
  .multiple-choice-question .options-container {
    padding: var(--quiz-spacing-md);
  }
  
  /* True/False responsive - stack on mobile */
  .true-false-question .options-container {
    grid-template-columns: 1fr;
    gap: var(--quiz-spacing-md);
  }
  
  .true-false-question .option-item {
    min-height: 60px;
  }
  
  /* Multiple Select responsive */
  .multiple-select-question .options-container {
    padding: var(--quiz-spacing-md);
  }
  
  /* Matching responsive - stack on mobile */
  .match-pair-question .match-pairs-container {
    padding: var(--quiz-spacing-md);
    flex-direction: column;
  }
  
  .match-pair-question .left-items,
  .match-pair-question .right-items {
    gap: var(--quiz-spacing-md);
    width: 100%;
  }
  
  .match-pair-question .match-item {
    padding: var(--quiz-spacing-md);
    min-height: 50px;
    font-size: clamp(18px, 5vw, 28px);
    flex: 1;
  }
  
  .match-pair-question .user-matches {
    width: 100%;
    padding: var(--quiz-spacing-md);
  }
  
  .match-pair-question .user-match {
    padding: var(--quiz-spacing-md);
    font-size: var(--quiz-font-size-base);
    flex-direction: row;
    flex-wrap: wrap;
    gap: var(--quiz-spacing-sm);
  }
  
  /* Drag & Drop responsive - stack on mobile */
  .dragdrop-question .dragdrop-container {
    padding: var(--quiz-spacing-md);
  }
  
  .dragdrop-question .dragdrop-items {
    grid-template-columns: 1fr;
    gap: var(--quiz-spacing-md);
  }
  
  .dragdrop-question .dragdrop-item {
    min-height: 60px;
  }
  
  /* Answer filling responsive */
  .fill-blanks-question .answer-input-container,
  .short-answer-question .answer-input-container,
  .text-input-question .answer-input-container {
    padding: var(--quiz-spacing-md);
  }
  
  .answer-input {
    padding: var(--quiz-spacing-md);
    font-size: var(--quiz-font-size-base);
  }
  
  /* Navigation responsive - keep in one row */
  .quiz-navigation,
  .quiz-nav,
  .quiz-controls {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 8px;
    padding: var(--quiz-spacing-sm);
    justify-content: space-between;
  }

  .quiz-navigation button,
  .quiz-nav button,
  .quiz-controls button {
    width: fit-content;
    min-width: auto;
    padding: 0.5rem 0.8rem;
    font-size: 13px;
  }
  
  .quiz-dashboard-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .quiz-filters {
    width: 100%;
    margin-top: var(--quiz-spacing-md);
  }
  
  .filter-group {
    width: 100%;
  }
}

/* Extra Small Screens (Phones - under 480px) */
@media (max-width: 480px) {
  /* Match pairs - optimize for small phone screens */
  .match-pair-question {
    padding: var(--quiz-spacing-md);
  }
  
  .match-pair-question .match-pairs-container {
    grid-template-columns: 1fr;
    gap: var(--quiz-spacing-md);
    padding: var(--quiz-spacing-md);
  }
  
  .match-pair-question .left-items,
  .match-pair-question .right-items {
    width: 100%;
  }
  
  .match-pair-question .match-item {
    padding: var(--quiz-spacing-md);
    min-height: 45px;
    font-size: clamp(16px, 5vw, 24px);
    flex: 1;
  }
  
  .match-pair-question .user-match {
    flex-direction: column;
    padding: var(--quiz-spacing-md);
    gap: var(--quiz-spacing-sm);
  }
  
  .match-pair-question .user-match .match-left,
  .match-pair-question .user-match .match-right {
    width: 100%;
  }
  
  .match-pair-question .user-match .remove-match {
    width: 100%;
    padding: 8px;
  }
  
  /* Drag & Drop - optimize for small screens */
  .dragdrop-question {
    padding: var(--quiz-spacing-md);
  }
  
  .dragdrop-question .dragdrop-items {
    grid-template-columns: 1fr;
    gap: var(--quiz-spacing-md);
  }
  
  /* Question text sizing */
  .question-text,
  .question-item h4 {
    font-size: var(--quiz-font-size-md);
  }
}

/* ===== FOUR-LAYER ARCHITECTURE VISUAL DESIGN ===== */

/* Outer Container - Layer 4: Outer Shell */
.four-layer-architecture {
  max-width: 1000px;
  margin: 40px auto;
  font-family: var(--quiz-font-family, 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif);
}

/* Layer 4: Outer Shell (White) */
.layer-4-outer {
  width: 100%;
  max-width: 100%;
  background-color: #FFFFFF;
  border: 3px solid #CCCCCC;
  border-radius: 15px;
  padding: 30px;
  gap: 20px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.layer-4-label {
  font-size: 14px;
  font-weight: bold;
  color: #000000;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Layer 3: Database/Storage (White) */
.layer-3-database {
  width: 100%;
  max-width: 100%;
  background-color: #FFFFFF;
  border: 3px solid #CCCCCC;
  border-radius: 12px;
  padding: 25px;
  margin-bottom: 20px;
  gap: 15px;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
}

.layer-3-label {
  font-size: 13px;
  font-weight: bold;
  color: #000000;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.layer-3-content {
  font-size: 12px;
  line-height: 1.8;
  color: #000000;
}

/* Layer 2: JavaScript/Frontend (White) */
.layer-2-frontend {
  width: 100%;
  max-width: 100%;
  background-color: #FFFFFF;
  border: 3px solid #CCCCCC;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 15px;
  gap: 12px;
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.1);
}

.layer-2-label {
  font-size: 12px;
  font-weight: bold;
  color: #000000;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.layer-2-content {
  font-size: 11px;
  line-height: 1.7;
  color: #000000;
}

/* Layer 1: CSS/Styling (White) */
.layer-1-styling {
  width: 100%;
  max-width: 100%;
  background-color: #FFFFFF;
  border: 3px solid #CCCCCC;
  border-radius: 8px;
  padding: 15px;
  gap: 10px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.layer-1-label {
  font-size: 11px;
  font-weight: bold;
  color: #000000;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.layer-1-content {
  font-size: 10px;
  line-height: 1.6;
  color: #000000;
}

/* ===== HORIZONTAL 4-LAYER DESIGN ===== */

.four-layer-horizontal {
  display: flex;
  gap: 25px;
  max-width: 1400px;
  margin: 40px auto;
  flex-wrap: wrap;
}

.layer-card {
  flex: 1;
  min-width: 200px;
  border-radius: 12px;
  padding: 25px;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.layer-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.layer-card-title {
  font-size: 14px;
  font-weight: bold;
  margin-bottom: 15px;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 2px solid;
  padding-bottom: 10px;
}

.layer-card-content {
  font-size: 12px;
  line-height: 1.8;
}

.layer-card-item {
  margin-bottom: 10px;
  padding: 8px 0;
  border-bottom: 1px dotted rgba(0, 0, 0, 0.1);
}

.layer-card-item:last-child {
  border-bottom: none;
}

/* Layer 4 Horizontal Card */
.layer-4-card {
  background-color: #FFF8DC;
  border: 3px solid #FFD700;
  color: #8B6914;
}

.layer-4-card .layer-card-title {
  color: #B8860B;
  border-bottom-color: #FFD700;
}

.layer-4-card .layer-card-content {
  color: #654321;
}

/* Layer 3 Horizontal Card */
.layer-3-card {
  background-color: #E6F3FF;
  border: 3px solid #0066CC;
  color: #003366;
}

.layer-3-card .layer-card-title {
  color: #003399;
  border-bottom-color: #0066CC;
}

.layer-3-card .layer-card-content {
  color: #003366;
}

/* Layer 2 Horizontal Card */
.layer-2-card {
  background-color: #E6F9F0;
  border: 3px solid #00A86B;
  color: #004D2C;
}

.layer-2-card .layer-card-title {
  color: #006B3F;
  border-bottom-color: #00A86B;
}

.layer-2-card .layer-card-content {
  color: #004D2C;
}

/* Layer 1 Horizontal Card */
.layer-1-card {
  background-color: #FFE6F0;
  border: 3px solid #FF1493;
  color: #8B0A50;
}

.layer-1-card .layer-card-title {
  color: #C71585;
  border-bottom-color: #FF1493;
}

.layer-1-card .layer-card-content {
  color: #8B0A50;
}

/* ===== STACKED 4-LAYER DESIGN (Full Width) ===== */

.four-layer-stacked {
  max-width: 100%;
  margin: 40px auto;
}

.layer-stacked {
  padding: 20px;
  margin-bottom: 18px;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.layer-stacked-title {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  display: flex;
  align-items: center;
}

.layer-stacked-number {
  display: inline-block;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: white;
  margin-right: 12px;
  font-size: 18px;
}

.layer-stacked-content {
  font-size: 13px;
  line-height: 1.9;
  margin-left: 47px;
}

/* Layer 4 Stacked */
.layer-stacked-4 {
  background-color: #FFF8DC;
  border-left: 5px solid #FFD700;
  color: #654321;
}

.layer-stacked-4 .layer-stacked-number {
  background-color: #FFD700;
  color: #8B6914;
}

.layer-stacked-4 .layer-stacked-title {
  color: #8B6914;
}

/* Layer 3 Stacked */
.layer-stacked-3 {
  background-color: #E6F3FF;
  border-left: 5px solid #0066CC;
  color: #003366;
}

.layer-stacked-3 .layer-stacked-number {
  background-color: #0066CC;
}

.layer-stacked-3 .layer-stacked-title {
  color: #003399;
}

/* Layer 2 Stacked */
.layer-stacked-2 {
  background-color: #E6F9F0;
  border-left: 5px solid #00A86B;
  color: #004D2C;
}

.layer-stacked-2 .layer-stacked-number {
  background-color: #00A86B;
}

.layer-stacked-2 .layer-stacked-title {
  color: #006B3F;
}

/* Layer 1 Stacked */
.layer-stacked-1 {
  background-color: #FFE6F0;
  border-left: 5px solid #FF1493;
  color: #8B0A50;
}

.layer-stacked-1 .layer-stacked-number {
  background-color: #FF1493;
}

.layer-stacked-1 .layer-stacked-title {
  color: #C71585;
}

/* ===== RESPONSIVE 4-LAYER DESIGN ===== */

@media (max-width: 768px) {
  .four-layer-horizontal {
    flex-direction: column;
    gap: 15px;
  }

  .layer-card {
    min-width: 100%;
  }

  .layer-card-title {
    font-size: 13px;
  }

  .layer-card-content {
    font-size: 11px;
  }

  .layer-4-outer {
    padding: 20px;
  }

  .layer-3-database {
    padding: 18px;
    margin-bottom: 15px;
  }

  .layer-2-frontend {
    padding: 15px;
    margin-bottom: 12px;
  }

  .layer-1-styling {
    padding: 12px;
  }
}

@media (max-width: 480px) {
  .four-layer-architecture,
  .four-layer-stacked {
    margin: 20px 10px;
  }

  .layer-4-outer {
    padding: 15px;
    border-width: 2px;
  }

  .layer-3-database {
    padding: 12px;
    border-width: 2px;
    margin-bottom: 10px;
  }

  .layer-2-frontend {
    padding: 10px;
    border-width: 2px;
    margin-bottom: 8px;
  }

  .layer-1-styling {
    padding: 8px;
    border-width: 2px;
  }

  .layer-4-label,
  .layer-3-label,
  .layer-2-label,
  .layer-1-label {
    font-size: 10px;
  }

  .layer-3-content,
  .layer-2-content,
  .layer-1-content {
    font-size: 10px;
  }

  .layer-stacked-number {
    width: 28px;
    height: 28px;
    font-size: 14px;
    margin-right: 8px;
  }

  .layer-stacked-content {
    margin-left: 36px;
    font-size: 11px;
  }
}

/* ========================================
   RESPONSIVE QUIZ DISPLAY FIXES
   Mobile First - Flexible Layouts
   ======================================== */

/* Tablets (768px - 1024px) */
@media (max-width: 1024px) and (min-width: 768px) {
  /* Navigation - single row layout on tablet */
  .quiz-navigation {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 8px;
  }

  .nav-button {
    width: auto;
    flex-shrink: 1;
  }

  .question-counter {
    width: auto;
    flex: 0 0 auto;
    min-width: 100px;
  }

  /* Options - better spacing on tablet */
  .multiple-choice-question .option-item,
  .true-false-question .option-item {
    padding: clamp(10px, 2.5vw, 14px) clamp(12px, 2.5vw, 18px);
    gap: clamp(8px, 2vw, 10px);
  }

  .multiple-choice-question .option-item input[type="radio"],
  .true-false-question .option-item input[type="radio"] {
    width: clamp(18px, 4vw, 22px);
    height: clamp(18px, 4vw, 22px);
  }

  .multiple-choice-question .option-item label,
  .true-false-question .option-item label {
    font-size: clamp(13px, 2.8vw, 15px);
  }
}

/* Small Tablets & Large Phones (480px - 768px) */
@media (max-width: 768px) {
  /* Ensure layers are 100% width on mobile */
  .layer-1 {
    width: 100% !important;
    max-width: 100% !important;
    margin: 15px auto !important;
    padding: 15px !important;
    box-sizing: border-box !important;
  }

  /* Navigation - single row layout on mobile/tablet */
  .quiz-navigation {
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 6px;
  }

  .nav-button {
    width: auto;
    padding: 8px 12px;
    font-size: 14px;
    flex-shrink: 1;
  }

  .question-counter {
    width: 100%;
    font-size: 13px;
    padding: 8px 12px;
  }

  .nav-prev, .nav-next {
    font-size: 14px;
  }

  /* Options - flexible sizing */
  .multiple-choice-question .option-item,
  .true-false-question .option-item {
    padding: 10px 12px;
    gap: 10px;
    min-height: auto;
  }

  .multiple-choice-question .option-item input[type="radio"],
  .true-false-question .option-item input[type="radio"],
  .multiple-select-question .option-item input[type="checkbox"] {
    width: clamp(16px, 4vw, 20px);
    height: clamp(16px, 4vw, 20px);
    margin-right: 8px;
  }

  .multiple-choice-question .option-item label,
  .true-false-question .option-item label {
    font-size: clamp(12px, 3vw, 14px);
    line-height: 1.4;
    word-break: break-word;
  }

  /* Question text - responsive */
  .question-text {
    font-size: clamp(14px, 3.5vw, 16px);
    line-height: 1.4;
    word-break: break-word;
  }

  /* Match pair - mobile friendly */
  .match-pair-container {
    flex-direction: column;
  }

  .match-column {
    min-width: 100%;
  }

  /* Drag & drop - stack vertically */
  .drag-drop-container {
    flex-direction: column;
  }

  .word-pool {
    min-height: auto;
    padding: 10px;
  }

  .answer-boxes {
    width: 100%;
  }
}

/* Extra Small Screens (Phones - under 480px) */
@media (max-width: 480px) {
  /* Ensure layers are 100% width on small phones */
  .layer-1 {
    width: 100% !important;
    max-width: 100% !important;
    margin: 10px auto !important;
    padding: 10px !important;
    box-sizing: border-box !important;
  }

  /* Navigation - single row layout on small phones */
  .quiz-navigation {
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 4px;
    padding: 12px 8px;
  }

  .nav-button {
    width: auto;
    padding: 6px 10px;
    font-size: 12px;
    min-width: auto;
    flex-shrink: 1;
  }

  .question-counter {
    width: 100%;
    font-size: 11px;
    padding: 6px 10px;
  }

  .nav-prev, .nav-next {
    font-size: 12px;
  }

  /* Options - maximum flexibility */
  .multiple-choice-question .option-item,
  .true-false-question .option-item,
  .multiple-select-question .option-item {
    padding: 8px 10px;
    gap: 8px;
    flex-direction: column;
  }

  .multiple-choice-question .option-item input[type="radio"],
  .true-false-question .option-item input[type="radio"],
  .multiple-select-question .option-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin-right: 0;
    margin-bottom: 4px;
  }

  .multiple-choice-question .option-item label,
  .true-false-question .option-item label {
    font-size: 12px;
    line-height: 1.3;
  }

  /* Question text - small phone */
  .question-text {
    font-size: 13px;
    line-height: 1.3;
    word-break: break-word;
  }

  /* Drag & drop - mobile optimized */
  .draggable-word {
    font-size: 12px;
    padding: 8px 12px;
  }

  .answer-box {
    min-height: 40px;
    padding: 8px;
    gap: 6px;
  }

  .answer-word {
    font-size: 12px;
    padding: 6px 10px;
  }

  .remove-word-btn {
    width: 20px;
    height: 20px;
  }

  /* Match pairs - full width, large font on mobile */
  .match-item {
    font-size: clamp(16px, 5vw, 24px);
    min-height: 35px;
    padding: 8px;
  }

  /* Result displays */
  .score-value {
    font-size: 2.5rem;
  }

  .score-label {
    font-size: 1rem;
  }

  .result-remark {
    font-size: 1rem;
  }

  .score-breakdown {
    flex-direction: column;
    gap: 8px;
  }

  .correct-answers,
  .wrong-answers,
  .total-questions {
    width: 100%;
    min-width: auto;
    padding: 8px 10px;
  }
}

/* ===== QUIZ JOIN PAGE METABOX STYLING ===== */

.nammashale-quiz-join-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  min-height: 100vh;
}

.nammashale-quiz-join-page h2 {
  font-size: 2.5rem;
  color: #333;
  margin-bottom: 10px;
  text-align: center;
  font-weight: 700;
}

.quiz-join-subtitle {
  text-align: center;
  color: #666;
  font-size: 16px;
  margin-bottom: 30px;
  font-style: italic;
}

/* ===== SEARCH AND FILTER SECTION ===== */
.quiz-filters-wrapper {
  background: white;
  border-radius: 12px;
  padding: 25px;
  margin-bottom: 30px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Search Bar */
.quiz-search-bar {
  position: relative;
  width: 100%;
}

.quiz-search-input {
  width: 100%;
  padding: 14px 45px 14px 18px;
  font-size: 15px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  transition: all 0.3s ease;
  background-color: #f9f9f9;
  font-family: inherit;
}

.quiz-search-input:focus {
  outline: none;
  border-color: #007cba;
  background-color: white;
  box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.quiz-search-input::placeholder {
  color: #999;
}

.search-icon {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  pointer-events: none;
  color: #999;
}

/* Filter Controls */
.quiz-filter-controls {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  align-items: center;
}

.quiz-filter-select {
  flex: 1;
  min-width: 200px;
  padding: 12px 15px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  background-color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
}

.quiz-filter-select:hover {
  border-color: #007cba;
}

.quiz-filter-select:focus {
  outline: none;
  border-color: #007cba;
  box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.quiz-reset-btn {
  padding: 12px 24px;
  background: linear-gradient(135deg, #95a5a6, #7f8c8d);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.quiz-reset-btn:hover {
  background: linear-gradient(135deg, #7f8c8d, #6c7a7b);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Results Info */
.quiz-results-info {
  text-align: center;
  margin-bottom: 20px;
  font-size: 15px;
  color: #666;
  font-weight: 500;
}

.quiz-count {
  display: inline-block;
  padding: 8px 16px;
  background: #e3f2fd;
  color: #007cba;
  border-radius: 20px;
  font-weight: 600;
}

/* Quiz List Container */
.quiz-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding: 0;
  list-style: none;
  margin: 0;
}

/* ===== QUIZ METABOX CARD STYLING ===== */

.quiz-metabox-item {
  list-style: none;
}

.quiz-metabox {
  background: white;
  border: 1px solid #000;
  border-radius: 8px;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  height: auto;
  min-height: 196px; /* Reduced by 30% from 280px for compact layout */
  font-family: 'Times New Roman', Times, serif, 'Calibri', sans-serif;
  font-weight: bold;
}

.quiz-metabox:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Category Badge */
.quiz-category-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  color: white;
  text-transform: uppercase;
  margin-bottom: 10px;
}

/* Metabox Header */
.quiz-metabox-header {
  padding: 15px;
  border-bottom: none;
  background: white;
}

.quiz-metabox-title {
  margin: 0;
  font-size: clamp(14px, 2vw, 16px);
  font-weight: 700;
  font-family: 'Times New Roman', Times, serif;
  color: #333;
  line-height: 1.4;
  word-wrap: break-word;
}

/* Metabox Body - Quiz Information */
.quiz-metabox-body {
  flex-grow: 1;
  padding: 15px;
}

.quiz-meta-item {
  display: flex;
  align-items: center;
  margin: 8px 0;
  padding: 0;
  background-color: transparent;
  border-radius: 0;
  font-size: clamp(12px, 1.5vw, 14px);
  font-weight: bold;
  font-family: 'Calibri', 'Trebuchet MS', sans-serif;
  transition: all 0.2s ease;
}

.quiz-meta-item:hover {
  background-color: transparent;
  padding-left: 0;
}

.quiz-meta-icon {
  width: 24px;
  height: 24px;
  margin-right: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.quiz-meta-label {
  font-weight: 500;
  color: #666;
  min-width: 80px;
  margin-right: 8px;
}

.quiz-meta-value {
  color: #333;
  font-weight: 700;
  font-family: 'Times New Roman', Times, serif;
  flex-grow: 1;
  text-align: right;
  font-size: clamp(12px, 1.5vw, 14px);
}

/* Passing Score Badge */
.quiz-passing-score {
  display: inline-block;
  background: #2ecc71;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  box-shadow: none;
}

/* WebSocket Code Badge */
.quiz-websocket-code {
  background-color: #f5f5f5;
  padding: 10px;
  border-radius: 4px;
  font-family: 'Times New Roman', Times, serif;
  font-size: clamp(11px, 1.2vw, 12px);
  font-weight: bold;
  color: #333;
  word-break: break-all;
  border: 1px solid #ddd;
  margin-top: 8px;
  border-left: none;
  transition: all 0.2s ease;
}

.quiz-websocket-code:hover {
  background-color: #f5f5f5;
  border-left-color: transparent;
}

/* Metabox Footer - Buttons */
.quiz-metabox-footer {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 15px;
  border-top: 1px solid #eee;
  margin-top: auto;
}

.quiz-metabox-btn {
  flex: 1;
  min-width: 100px;
  padding: 10px 15px;
  color: white;
  text-decoration: none;
  border-radius: 6px;
  text-align: center;
  font-size: clamp(11px, 1.3vw, 12px);
  font-weight: 700;
  font-family: 'Calibri', 'Trebuchet MS', sans-serif;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  letter-spacing: none;
  text-transform: none;
}

.quiz-metabox-btn:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

.quiz-metabox-btn:active {
  transform: translateY(0);
}

.quiz-metabox-btn.secondary {
  background: #6c757d;
  box-shadow: 0 2px 4px rgba(108, 117, 125, 0.1);
}

.quiz-metabox-btn.secondary:hover {
  background: #5a6268;
  box-shadow: 0 4px 8px rgba(108, 117, 125, 0.15);
}

/* Empty State */
.no-quizzes-available {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 20px;
  color: #666;
  font-size: 16px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.no-quizzes-available-icon {
  font-size: 64px;
  margin-bottom: 20px;
  opacity: 0.6;
}

.no-quizzes-available p {
  margin: 0;
  font-size: 15px;
  color: #999;
}

/* ===== RESPONSIVE DESIGN ===== */

@media (max-width: 768px) {
  .nammashale-quiz-join-page {
    padding: 25px 15px;
  }

  .nammashale-quiz-join-page h2 {
    font-size: clamp(1.5rem, 4vw, 2rem);
  }

  .quiz-filters-wrapper {
    padding: 18px;
    gap: 15px;
  }

  .quiz-filter-controls {
    flex-direction: column;
  }

  .quiz-filter-select {
    min-width: auto;
    width: 100%;
  }

  .quiz-reset-btn {
    width: 100%;
  }

  .quiz-list {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .quiz-metabox {
    border-radius: 8px;
    min-height: auto;
  }

  .quiz-metabox-header {
    padding: clamp(12px, 3vw, 15px);
  }

  .quiz-metabox-title {
    font-size: clamp(13px, 3vw, 15px);
  }

  .quiz-metabox-body {
    padding: clamp(12px, 3vw, 15px);
  }

  .quiz-meta-item {
    margin: 6px 0;
    padding: 0;
    font-size: clamp(11px, 2.5vw, 13px);
  }

  .quiz-meta-value {
    font-size: clamp(11px, 2.5vw, 13px);
  }

  .quiz-metabox-footer {
    padding: clamp(12px, 3vw, 15px);
    gap: 8px;
  }

  .quiz-metabox-btn {
    padding: 10px 12px;
    font-size: clamp(10px, 2.5vw, 11px);
    min-width: 90px;
  }
}

@media (max-width: 480px) {
  .nammashale-quiz-join-page {
    padding: 15px 10px;
  }

  .nammashale-quiz-join-page h2 {
    font-size: clamp(1.25rem, 5vw, 1.75rem);
    margin-bottom: 8px;
  }

  .quiz-join-subtitle {
    font-size: clamp(12px, 3vw, 14px);
    margin-bottom: 15px;
  }

  .quiz-filters-wrapper {
    padding: 12px;
    gap: 10px;
  }

  .quiz-search-input {
    padding: 10px 35px 10px 12px;
    font-size: clamp(13px, 3vw, 14px);
  }

  .quiz-list {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .quiz-metabox {
    border-left-width: none !important;
    min-height: auto;
    width: 100%;
  }

  .quiz-metabox-header {
    padding: clamp(10px, 3vw, 14px);
  }

  .quiz-metabox-title {
    font-size: clamp(13px, 3.5vw, 15px);
  }

  .quiz-category-badge {
    font-size: clamp(9px, 2.5vw, 11px);
    padding: 3px 6px;
  }

  .quiz-metabox-body {
    padding: clamp(10px, 3vw, 14px);
  }

  .quiz-meta-item {
    margin: 6px 0;
    padding: 0;
    font-size: clamp(11px, 2.8vw, 12px);
  }

  .quiz-meta-value {
    font-size: clamp(11px, 2.8vw, 12px);
  }

  .quiz-meta-icon {
    width: 20px;
    height: 20px;
    font-size: clamp(13px, 3vw, 15px);
    margin-right: 6px;
  }

  .quiz-meta-label {
    min-width: 65px;
    font-size: clamp(10px, 2.5vw, 12px);
  }

  .quiz-websocket-code {
    padding: 8px;
    font-size: clamp(10px, 2.5vw, 11px);
  }

  .quiz-metabox-footer {
    flex-direction: column;
    padding: clamp(10px, 3vw, 14px);
    gap: 8px;
  }

  .quiz-metabox-btn,
  .quiz-metabox-btn.secondary {
    width: 100%;
    flex: none;
    padding: 8px 10px;
    font-size: clamp(10px, 2.5vw, 12px);
  }

  .no-quizzes-available {
    padding: 40px 12px;
  }

  .no-quizzes-available-icon {
    font-size: clamp(36px, 10vw, 48px);
    margin-bottom: 12px;
  }
}

/* ===== MOBILE ORIENTATION DETECTION MODAL ===== */
.mobile-orientation-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
}

.mobile-orientation-modal .modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  animation: fadeIn 0.3s ease-in-out;
}

.mobile-orientation-modal .modal-content {
  position: relative;
  background: white;
  border-radius: 16px;
  max-width: 90%;
  width: 100%;
  max-width: 450px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.4s ease-out;
  overflow: hidden;
}

.modal-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 25px 20px;
  text-align: center;
  font-size: 1.3rem;
  font-weight: bold;
}

.modal-header h3 {
  margin: 0;
  padding: 0;
  font-size: 1.3rem;
}

.modal-body {
  padding: 30px 20px;
  text-align: center;
}

.modal-message {
  font-size: 1rem;
  color: #333;
  margin: 0 0 20px 0;
  line-height: 1.5;
}

.orientation-icon {
  font-size: 3.5rem;
  margin: 20px 0;
  animation: rotate 2s infinite linear;
}

.orientation-hint {
  font-size: 0.95rem;
  color: #666;
  margin: 15px 0 0 0;
  font-style: italic;
}

.modal-footer {
  padding: 0 20px 20px 20px;
  display: flex;
  gap: 12px;
  justify-content: center;
}

.modal-footer .btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  flex: 1;
  max-width: 200px;
}

.modal-footer .btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.modal-footer .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.modal-footer .btn-primary:active {
  transform: translateY(0);
}

.modal-footer .btn-secondary {
  background: #f0f0f0;
  color: #333;
  border: 2px solid #ddd;
}

.modal-footer .btn-secondary:hover {
  background: #e8e8e8;
  border-color: #999;
}

.modal-footer .btn-secondary:active {
  background: #ddd;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Mobile responsiveness for modal */
@media (max-width: 480px) {
  .mobile-orientation-modal .modal-content {
    border-radius: 12px;
    max-width: 95%;
  }

  .modal-header {
    padding: 20px 15px;
    font-size: 1.1rem;
  }

  .modal-header h3 {
    font-size: 1.1rem;
  }

  .modal-body {
    padding: 25px 15px;
  }

  .modal-message {
    font-size: 0.95rem;
  }

  .orientation-icon {
    font-size: 3rem;
  }

  .orientation-hint {
    font-size: 0.9rem;
  }

  .modal-footer {
    padding: 0 15px 15px 15px;
    flex-direction: column;
    gap: 10px;
  }

  .modal-footer .btn {
    max-width: 100%;
    width: 100%;
  }
}

/* ============================================
   WORDPRESS THEME CONTAINER OVERRIDES
   Forces quiz to break out of any theme wrapper
   ============================================ */
.entry-content .nammashale-quiz,
.site-content .nammashale-quiz,
.content-area .nammashale-quiz,
.post-content .nammashale-quiz,
.page-content .nammashale-quiz,
.wp-block-post-content .nammashale-quiz,
article .nammashale-quiz,
main .nammashale-quiz,
#content .nammashale-quiz,
#primary .nammashale-quiz,
.container .nammashale-quiz {
  width: 100vw !important;
  max-width: 100vw !important;
  margin-left: calc(-50vw + 50%) !important;
}

.entry-content {
  width: 100%;
  height: auto;
  display: flex;
  flex-direction: column;
}

/* ============================================
   TIMER WARNING/CRITICAL STATES
   ============================================ */
.quiz-timer-display.warning {
  background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
  color: #333;
  animation: pulseTimer 1s ease-in-out infinite;
}

.quiz-timer-display.critical {
  background: linear-gradient(135deg, #ff6b6b 0%, #ff0000 100%);
  color: white;
  animation: criticalPulse 0.5s ease-in-out infinite;
}

@keyframes pulseTimer {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes criticalPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.1); opacity: 0.8; }
}

/* ============================================
   QUESTION SLIDE-IN ANIMATION
   ============================================ */
@keyframes slideInQuestion {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   FANCY QUESTION TEMPLATES (Subject Themes)
   ============================================ */

/* Science Template */
.question[data-template="science"] {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-color: #764ba2;
  color: white;
}
.question[data-template="science"]::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle at 20% 50%, rgba(255,255,255,0.1) 0%, transparent 50%),
              radial-gradient(circle at 80% 80%, rgba(255,255,255,0.15) 0%, transparent 50%);
  animation: floatParticles 6s ease-in-out infinite;
  pointer-events: none;
}

/* Math Template */
.question[data-template="math"] {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  border-color: #f5576c;
  color: white;
}
.question[data-template="math"]::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background-image: repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(255,255,255,0.1) 10px, rgba(255,255,255,0.1) 20px),
                     repeating-linear-gradient(-45deg, transparent, transparent 10px, rgba(255,255,255,0.1) 10px, rgba(255,255,255,0.1) 20px);
  animation: rotatePattern 20s linear infinite;
  pointer-events: none;
}

/* Biology Template */
.question[data-template="biology"] {
  background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
  border-color: #38ef7d;
  color: white;
}
.question[data-template="biology"]::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle, rgba(255,255,255,0.2) 2px, transparent 2px);
  background-size: 30px 30px;
  animation: pulseWave 3s ease-in-out infinite;
  pointer-events: none;
}

/* Physics Template */
.question[data-template="physics"] {
  background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
  border-color: #fee140;
  color: #333;
}
.question[data-template="physics"]::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle, rgba(255,255,255,0.3) 1px, transparent 1px);
  background-size: 15px 15px;
  animation: energyPulse 2s ease-in-out infinite;
  pointer-events: none;
}

/* Engineering Template */
.question[data-template="engineering"] {
  background: linear-gradient(135deg, #f5f5f5 0%, #ffffff 100%);
  border-color: #000000;
  color: #000000;
}
.question[data-template="engineering"]::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: repeating-linear-gradient(0deg, transparent, transparent 10px, rgba(255,255,255,0.05) 10px, rgba(255,255,255,0.05) 20px),
              repeating-linear-gradient(90deg, transparent, transparent 10px, rgba(255,255,255,0.05) 10px, rgba(255,255,255,0.05) 20px);
  animation: gridShift 15s linear infinite;
  pointer-events: none;
}

/* Electronics Template */
.question[data-template="electronics"] {
  background: linear-gradient(135deg, #00d4ff 0%, #0099ff 100%);
  border-color: #0099ff;
  color: white;
}
.question[data-template="electronics"]::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(90deg, transparent 24%, rgba(255,255,255,0.2) 25%, rgba(255,255,255,0.2) 26%, transparent 27%),
              linear-gradient(0deg, transparent 24%, rgba(255,255,255,0.2) 25%, rgba(255,255,255,0.2) 26%, transparent 27%);
  background-size: 50px 50px;
  animation: circuitFlow 4s linear infinite;
  pointer-events: none;
}

/* Fun Template */
.question[data-template="fun"] {
  background: linear-gradient(135deg, #ff6b6b 0%, #ffd93d 50%, #6bcf7f 100%);
  border-color: #ff6b6b;
  color: white;
}
.question[data-template="fun"]::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle at 20% 30%, rgba(255,255,255,0.3) 0%, transparent 40%),
              radial-gradient(circle at 80% 70%, rgba(255,255,255,0.3) 0%, transparent 40%);
  animation: bounce 2s ease-in-out infinite;
  pointer-events: none;
}

/* Gamification Template */
.question[data-template="gamification"] {
  background: linear-gradient(135deg, #ffd700 0%, #ffed4e 50%, #ff6b35 100%);
  border-color: #ff6b35;
  color: #333;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.5), 0 8px 25px rgba(0,0,0,0.1);
}
.question[data-template="gamification"]::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle, rgba(255,255,255,0.4) 2px, transparent 2px);
  background-size: 25px 25px;
  animation: starTwinkle 1.5s ease-in-out infinite;
  pointer-events: none;
}

/* Literature Template */
.question[data-template="literature"] {
  background: linear-gradient(135deg, #8b4513 0%, #cd853f 100%);
  border-color: #cd853f;
  color: white;
}
.question[data-template="literature"]::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: repeating-linear-gradient(90deg, transparent, transparent 5px, rgba(255,255,255,0.1) 5px, rgba(255,255,255,0.1) 10px);
  animation: pageFlip 4s ease-in-out infinite;
  pointer-events: none;
}

/* History Template */
.question[data-template="history"] {
  background: linear-gradient(135deg, #8b7355 0%, #d4a574 100%);
  border-color: #d4a574;
  color: white;
}
.question[data-template="history"]::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  opacity: 0.5;
  background: radial-gradient(circle, rgba(255,255,255,0.2) 1px, transparent 1px);
  background-size: 40px 40px;
  animation: fadeInOut 3s ease-in-out infinite;
  pointer-events: none;
}

/* Geography Template */
.question[data-template="geography"] {
  background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #00d084 100%);
  border-color: #00d084;
  color: white;
}
.question[data-template="geography"]::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle at 30% 40%, rgba(255,255,255,0.2) 0%, transparent 50%),
              radial-gradient(circle at 70% 60%, rgba(255,255,255,0.2) 0%, transparent 50%);
  animation: globeRotate 8s linear infinite;
  pointer-events: none;
}

/* Art Template */
.question[data-template="art"] {
  background: linear-gradient(135deg, #ff00ff 0%, #00ffff 50%, #ffff00 100%);
  border-color: #ff00ff;
  color: #000;
}
.question[data-template="art"]::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle, rgba(255,255,255,0.3) 2px, transparent 2px);
  background-size: 35px 35px;
  animation: colorShift 4s ease-in-out infinite;
  pointer-events: none;
}

/* Music Template */
.question[data-template="music"] {
  background: linear-gradient(135deg, #1e1e2e 0%, #ff006e 50%, #8338ec 100%);
  border-color: #ff006e;
  color: white;
}
.question[data-template="music"]::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(90deg, transparent 20%, rgba(255,255,255,0.2) 20%, rgba(255,255,255,0.2) 21%, transparent 21%),
              linear-gradient(90deg, transparent 40%, rgba(255,255,255,0.2) 40%, rgba(255,255,255,0.2) 41%, transparent 41%),
              linear-gradient(90deg, transparent 60%, rgba(255,255,255,0.2) 60%, rgba(255,255,255,0.2) 61%, transparent 61%),
              linear-gradient(90deg, transparent 80%, rgba(255,255,255,0.2) 80%, rgba(255,255,255,0.2) 81%, transparent 81%);
  animation: musicBars 1s ease-in-out infinite;
  pointer-events: none;
}

/* Sports Template */
.question[data-template="sports"] {
  background: linear-gradient(135deg, #ff4655 0%, #ffb627 100%);
  border-color: #ff4655;
  color: #fff;
}
.question[data-template="sports"]::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle, rgba(255,255,255,0.3) 3px, transparent 3px);
  background-size: 20px 20px;
  animation: sportsBounce 1.2s ease-in-out infinite;
  pointer-events: none;
}

/* ============================================
   TEMPLATE ANIMATION KEYFRAMES
   ============================================ */
@keyframes floatParticles {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}
@keyframes rotatePattern {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
@keyframes pulseWave {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
@keyframes energyPulse {
  0%, 100% { opacity: 0.8; }
  50% { opacity: 1; }
}
@keyframes gridShift {
  0% { transform: translate(0, 0); }
  100% { transform: translate(20px, 20px); }
}
@keyframes circuitFlow {
  0% { opacity: 0.3; }
  50% { opacity: 0.8; }
  100% { opacity: 0.3; }
}
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
@keyframes starTwinkle {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.1); }
}
@keyframes pageFlip {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}
@keyframes fadeInOut {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}
@keyframes globeRotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
@keyframes colorShift {
  0%, 100% { filter: hue-rotate(0deg); }
  50% { filter: hue-rotate(180deg); }
}
@keyframes musicBars {
  0%, 100% { transform: scaleY(0.5); }
  50% { transform: scaleY(1); }
}
@keyframes sportsBounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}
