/* ==========================================================================
   Open English Idioms Player - 100% Visual & Behavioral Parity with OE Production
   Matches live_idiom_screen1.png
   ========================================================================== */

.idioms-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.65);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100000;
  padding: 16px;
  animation: idiomsFadeIn 0.2s ease-out;
  box-sizing: border-box;
}

.idioms-modal-overlay.active {
  display: flex;
}

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

.idioms-card {
  width: 600px;
  max-width: 95vw;
  max-height: 92vh;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  animation: idiomsSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes idiomsSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Header: Solid bright blue bar with white close button */
.idioms-header {
  background-color: #0079ff;
  height: 38px;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 14px;
  box-sizing: border-box;
  flex-shrink: 0;
}

.idioms-btn-close {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: opacity 0.15s ease;
}

.idioms-btn-close:hover {
  opacity: 0.8;
}

/* Scrollable Container */
.idioms-scroll-container {
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

/* Screen 1: Intro Screen with Banner */
.idioms-banner-wrap {
  width: 100%;
  max-height: 240px;
  height: 240px;
  background-color: #f1f5f9;
  overflow: hidden;
  flex-shrink: 0;
}

.idioms-banner-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.idioms-intro-body {
  padding: 24px 28px 28px 28px;
  background: #ffffff;
  box-sizing: border-box;
}

.idioms-title {
  font-size: 22px;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 8px 0;
  line-height: 1.25;
}

.idioms-subtitle {
  font-size: 15px;
  color: #4b5563;
  margin: 0 0 16px 0;
  line-height: 1.45;
}

.idioms-narrative {
  font-size: 15px;
  color: #374151;
  line-height: 1.55;
  margin: 0 0 24px 0;
}

.idioms-btn-start {
  display: block;
  margin: 0 auto;
  background-color: #0079ff;
  color: #ffffff;
  border: none;
  border-radius: 24px;
  padding: 12px 64px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 121, 255, 0.3);
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.idioms-btn-start:hover {
  background-color: #0066d6;
  transform: translateY(-1px);
}

.idioms-btn-start:active {
  transform: translateY(0);
}

/* Screens 2-4: Question Flow */
.idioms-progress-bar-wrap {
  padding: 14px 24px 10px;
  background: #ffffff;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  gap: 16px;
}

.idioms-progress-track {
  flex: 1;
  height: 8px;
  background-color: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
}

.idioms-progress-fill {
  height: 100%;
  background-color: #0079ff;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.idioms-progress-text {
  font-size: 13.5px;
  font-weight: 700;
  color: #4b5563;
  white-space: nowrap;
}

.idioms-question-body {
  padding: 20px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Dialogue Card */
.idioms-dialogue-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.idioms-dialogue-line {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14.5px;
  line-height: 1.45;
  color: #334155;
}

.idioms-speaker-badge {
  font-weight: 700;
  color: #0f172a;
  min-width: 65px;
}

.idioms-dialogue-text {
  flex: 1;
}

.idioms-dialogue-audio-btn {
  background: #e0f2fe;
  border: none;
  color: #0284c7;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  flex-shrink: 0;
  transition: background 0.15s ease;
}

.idioms-dialogue-audio-btn:hover {
  background: #bae6fd;
}

/* Question Prompt */
.idioms-question-prompt {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.4;
  margin: 0;
}

/* Options */
.idioms-options-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.idioms-option-btn {
  background: #ffffff;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 14.5px;
  color: #1f2937;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.idioms-option-btn:hover:not(:disabled) {
  border-color: #0079ff;
  background-color: #f0f7ff;
}

.idioms-option-btn:disabled {
  cursor: default;
}

.idioms-option-btn.correct {
  border-color: #10b981;
  background-color: #ecfdf5;
  color: #065f46;
  font-weight: 600;
}

.idioms-option-btn.incorrect {
  border-color: #ef4444;
  background-color: #fef2f2;
  color: #991b1b;
}

/* Feedback Box */
.idioms-feedback-box {
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.45;
  display: none;
}

.idioms-feedback-box.correct {
  display: block;
  background-color: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
}

.idioms-feedback-box.incorrect {
  display: block;
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.idioms-btn-next {
  align-self: center;
  background-color: #0079ff;
  color: #ffffff;
  border: none;
  border-radius: 20px;
  padding: 10px 40px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 8px;
  transition: background 0.15s ease;
}

.idioms-btn-next:hover {
  background-color: #0066d6;
}

/* Screen 5: Victory Screen */
.idioms-victory-body {
  padding: 40px 32px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
}

.idioms-victory-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #ecfdf5;
  border: 3px solid #10b981;
  color: #10b981;
  font-size: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.idioms-victory-title {
  font-size: 24px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 8px 0;
}

.idioms-victory-subtitle {
  font-size: 15px;
  color: #64748b;
  margin: 0 0 24px 0;
  max-width: 420px;
  line-height: 1.45;
}

.idioms-reward-badges {
  display: flex;
  gap: 16px;
  margin-bottom: 30px;
}

.idioms-reward-pill {
  background: #f0f7ff;
  border: 1px solid #bae6fd;
  border-radius: 20px;
  padding: 8px 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14.5px;
  font-weight: 700;
  color: #0284c7;
}

.idioms-reward-pill.xp {
  background: #fefce8;
  border-color: #fef08a;
  color: #ca8a04;
}

.idioms-btn-finish {
  background-color: #0079ff;
  color: #ffffff;
  border: none;
  border-radius: 24px;
  padding: 12px 64px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 121, 255, 0.3);
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.idioms-btn-finish:hover {
  background-color: #0066d6;
  transform: translateY(-1px);
}
