/* Quiz Themes */

/* --- Common Wrappers --- */
.quiz-container-wrapper {
  transition: background 0.5s ease;
}

/* --- Mode: Detective (Grammar) --- */
.mode-detective {
  background: #2c241b
    url("https://www.transparenttextures.com/patterns/wood-pattern.png"); /* Fallback/Texture */
  font-family: "Courier New", Courier, monospace;
  color: #e0d8c8;
}

.mode-detective #question-container {
  background: #f4e9d9;
  color: #333;
  padding: 20px;
  border: 1px solid #8d7b68;
  box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.5);
  transform: rotate(-1deg);
  position: relative;
  max-width: 800px;
  margin: 0 auto 30px;
}

.mode-detective #question-container::before {
  content: "CASE FILE #";
  position: absolute;
  top: -15px;
  left: 20px;
  background: #8d7b68;
  color: #fff;
  padding: 5px 10px;
  font-weight: bold;
  transform: rotate(1deg);
}

.mode-detective .option-btn {
  background: #fffbf0;
  border: 1px dashed #8d7b68;
  color: #333;
  font-family: "Courier New", Courier, monospace;
  box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2);
}

.mode-detective .option-btn:hover {
  background: #fff;
  transform: scale(1.02);
}

.mode-detective .stamp-solved {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-15deg);
  font-size: 3rem;
  color: #d32f2f;
  border: 5px solid #d32f2f;
  padding: 10px 20px;
  text-transform: uppercase;
  opacity: 0;
  animation: stamp-in 0.3s forwards cubic-bezier(0.175, 0.885, 0.32, 1.275);
  pointer-events: none;
  z-index: 10;
}

@keyframes stamp-in {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(2) rotate(-15deg);
  }
  to {
    opacity: 0.8;
    transform: translate(-50%, -50%) scale(1) rotate(-15deg);
  }
}

.mode-detective #feedback {
  background: #3e2723;
  color: #fff;
  border-left: 5px solid #d32f2f;
}

/* --- Mode: Lab (Phonics) --- */
.mode-lab {
  background: #0d1117;
  color: #00f0ff;
  font-family: "Consolas", "Monaco", monospace;
}

.mode-lab #question-container {
  border: 1px solid #00f0ff;
  background: rgba(0, 20, 20, 0.8); /* Darker, sophisticated background */
  box-shadow: 0 0 25px rgba(0, 240, 255, 0.15);
  position: relative;
  overflow: hidden;
  max-width: 900px; /* Wider for sentences */
  margin: 0 auto 30px;
  padding: 40px;
  border-radius: 8px; /* Smooth corners */
}

/* Waveform Animation Placeholder */
.lab-waveform {
  height: 60px;
  width: 100%;
  background: linear-gradient(
    90deg,
    transparent 45%,
    rgba(0, 240, 255, 0.5) 50%,
    transparent 55%
  );
  background-size: 20px 100%; /* Wider pulse */
  opacity: 0.2;
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  z-index: 0;
  animation: pulse-wave 3s infinite ease-in-out;
  pointer-events: none;
}

@keyframes pulse-wave {
  0% { transform: translateY(-50%) scaleX(1); opacity: 0.1; }
  50% { transform: translateY(-50%) scaleX(2); opacity: 0.3; }
  100% { transform: translateY(-50%) scaleX(1); opacity: 0.1; }
}

.mode-lab .lab-question {
    position: relative;
    z-index: 1;
    margin-bottom: 30px;
    font-size: 1.4rem;
    text-align: center;
    color: #fff;
    text-shadow: 0 0 5px #00f0ff;
}

.mode-lab #options-container {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr; /* 1 Column for wide sentences */
    gap: 20px;
}

.mode-lab .option-btn {
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid #00f0ff;
  color: #00f0ff;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 25px 20px; /* Increased padding */
  transition: all 0.3s ease;
  font-weight: bold;
  font-size: 1.2rem; /* Larger text */
  min-height: 80px; /* Wider/Taller look */
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.mode-lab .option-btn:hover:not([disabled]) {
  background: rgba(0, 240, 255, 0.2);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.5);
  transform: translateY(-2px);
}

.mode-lab .option-btn.correct {
  background: #00f0ff;
  color: #000;
}

.option-spk {
    margin-left: 10px;
    opacity: 0.7;
    cursor: pointer;
    transition: transform 0.2s;
}
.option-spk:hover {
    transform: scale(1.2);
    opacity: 1;
}

/* --- Mode: Scenario (Oral) --- */
.mode-scenario {
  background: #f0f2f5; /* Chat App Gray */
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.mode-scenario #question-container {
  background: transparent;
  box-shadow: none;
  border: none;
  display: flex;
  flex-direction: column;
  padding: 0;
}

.chat-bubble {
  padding: 12px 18px;
  border-radius: 18px;
  margin-bottom: 10px;
  max-width: 80%;
  position: relative;
  animation: pop-in 0.3s ease-out;
}

@keyframes pop-in {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.chat-bubble.npc {
  background: #e4e6eb;
  color: #050505;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.chat-bubble.npc::before {
  content: "friend";
  position: absolute;
  top: -20px;
  left: 0;
  font-size: 0.75rem;
  color: #65676b;
}

.chat-bubble.player {
  background: #0084ff;
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.mode-scenario #options-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 20px;
}

.mode-scenario .option-btn {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 20px;
  color: #0084ff;
  padding: 8px 16px;
  font-size: 0.95rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.mode-scenario .option-btn:hover {
  background: #f0f8ff;
  border-color: #0084ff;
}


/* Utility */
.hide {
  display: none !important;
}

/* Explanation Box Styling */
.explanation-box {
    margin-top: 15px;
    padding: 15px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    border-left: 5px solid #2196F3; /* Blue accent */
    color: #333;
    font-size: 0.95rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    line-height: 1.5;
}

.mode-detective .explanation-box {
    background-color: #f4e9d9;
    border-left-color: #d32f2f;
    color: #3e2723;
    font-family: "Courier New", Courier, monospace;
}

.mode-lab .explanation-box {
    background-color: rgba(0, 20, 20, 0.9);
    border-left-color: #00f0ff;
    color: #00f0ff;
    border: 1px solid #00f0ff;
    border-left-width: 5px;
}
