/* ==========================================================================
   Open English Interactive Videos Player - 100% Visual & Behavioral Parity
   Matches live_video_open.png
   ========================================================================== */

.iv-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: ivFadeIn 0.2s ease-out;
  box-sizing: border-box;
}

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

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

.iv-card {
  width: 600px;
  max-width: 95vw;
  max-height: 94vh;
  background: #ffffff;
  border-radius: 16px;
  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: ivSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Header matching live_video_open.png */
.iv-header {
  padding: 16px 20px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-sizing: border-box;
  flex-shrink: 0;
}

.iv-header-play-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid #0079ff;
  color: #0079ff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
  padding-left: 2px;
}

/* 4-segment mini progress pills */
.iv-progress-pills {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}

.iv-progress-pill {
  flex: 1;
  height: 6px;
  background-color: #e5e7eb;
  border-radius: 3px;
  transition: background-color 0.2s ease;
}

.iv-progress-pill.active {
  background-color: #0079ff;
}

.iv-progress-pill.completed {
  background-color: #10b981;
}

.iv-btn-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: #f1f5f9;
  color: #64748b;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  flex-shrink: 0;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.iv-btn-close:hover {
  background: #e2e8f0;
  color: #0f172a;
}

/* Instruction Prompt */
.iv-instruction {
  font-size: 17px;
  font-weight: 600;
  color: #374151;
  text-align: center;
  margin: 0 0 12px 0;
  padding: 0 20px;
}

/* Scrollable Container */
.iv-scroll-container {
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  padding-bottom: 16px;
}

/* 9:16 Vertical Video Frame matching live_video_open.png */
.iv-player-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 20px;
  box-sizing: border-box;
}

.iv-video-frame {
  width: 387px;
  max-width: 100%;
  height: 520px;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  background-color: #111827;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.iv-video-element {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.iv-video-poster-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  transition: opacity 0.3s ease;
}

/* Large Center White Play Button with Blue Triangle */
.iv-center-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  z-index: 10;
  transition: transform 0.15s ease, opacity 0.2s ease;
}

.iv-center-play-btn:hover {
  transform: translate(-50%, -50%) scale(1.08);
}

.iv-center-play-icon {
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 14px 0 14px 22px;
  border-color: transparent transparent transparent #0079ff;
  margin-left: 5px;
}

/* Top Right Audio Volume Toggle */
.iv-audio-toggle-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  border: none;
  color: #ffffff;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: background 0.15s ease;
}

.iv-audio-toggle-btn:hover {
  background: rgba(0, 0, 0, 0.75);
}

/* Subtitles Overlay on Video */
.iv-subtitles-overlay {
  position: absolute;
  bottom: 60px;
  left: 12px;
  right: 12px;
  text-align: center;
  pointer-events: none;
  z-index: 9;
}

.iv-subtitle-pill {
  display: inline-block;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  color: #ffffff;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* Bottom Controls Bar */
.iv-controls-bar {
  position: absolute;
  bottom: 12px;
  left: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  border-radius: 12px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #ffffff;
  z-index: 10;
}

.iv-btn-mini-play {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 16px;
  cursor: pointer;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.iv-scrubber {
  flex: 1;
  accent-color: #0079ff;
  cursor: pointer;
  height: 4px;
}

.iv-time-counter {
  font-size: 12px;
  font-weight: 600;
  color: #e2e8f0;
  white-space: nowrap;
}

.iv-badge-subtitles {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #ffffff;
  border-radius: 10px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  text-transform: lowercase;
}

.iv-badge-subtitles.active {
  background: #0079ff;
  border-color: #0079ff;
}

.iv-badge-speed {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #ffffff;
  border-radius: 10px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.iv-btn-fullscreen {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 14px;
  cursor: pointer;
  padding: 0 2px;
}

/* Synchronized Transcript Drawer */
.iv-transcript-drawer {
  width: 387px;
  max-width: 100%;
  margin-top: 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.iv-transcript-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13.5px;
  font-weight: 700;
  color: #0f172a;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 6px;
}

.iv-transcript-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 180px;
  overflow-y: auto;
}

.iv-transcript-line {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.4;
  color: #334155;
  cursor: pointer;
  transition: background 0.15s ease;
}

.iv-transcript-line:hover {
  background: #f1f5f9;
}

.iv-transcript-line.active {
  background: #e0f2fe;
  color: #0369a1;
  font-weight: 600;
  border-left: 3px solid #0079ff;
}

.iv-transcript-time {
  font-size: 11.5px;
  color: #64748b;
  font-family: monospace;
}

.iv-transcript-speaker {
  font-weight: 700;
  color: #0f172a;
}

.iv-btn-continue {
  margin-top: 16px;
  background-color: #0079ff;
  color: #ffffff;
  border: none;
  border-radius: 20px;
  padding: 10px 48px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 121, 255, 0.3);
  transition: background 0.15s ease;
}

.iv-btn-continue:hover {
  background-color: #0066d6;
}

/* Step 2: Comprehension Slide */
.iv-step-view {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.iv-quiz-title {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.iv-quiz-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.iv-quiz-opt {
  background: #ffffff;
  border: 1.5px solid #d1d5db;
  border-radius: 10px;
  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;
}

.iv-quiz-opt:hover:not(:disabled) {
  border-color: #0079ff;
  background-color: #f0f7ff;
}

.iv-quiz-opt.correct {
  border-color: #10b981;
  background-color: #ecfdf5;
  color: #065f46;
  font-weight: 600;
}

.iv-quiz-opt.incorrect {
  border-color: #ef4444;
  background-color: #fef2f2;
  color: #991b1b;
}

.iv-quiz-feedback {
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.45;
  display: none;
}

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

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

/* Step 3: Vocabulary Slide */
.iv-vocab-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.iv-vocab-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.iv-vocab-term {
  font-weight: 700;
  font-size: 15px;
  color: #0079ff;
}

.iv-vocab-ipa {
  font-size: 12px;
  color: #64748b;
  margin-left: 6px;
}

.iv-vocab-trans {
  font-size: 13.5px;
  color: #334155;
}

/* Step 4: Victory Slide */
.iv-victory-view {
  padding: 36px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.iv-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: 18px;
}

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

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

.iv-reward-row {
  display: flex;
  gap: 14px;
  margin-bottom: 28px;
}

.iv-reward-pill {
  background: #f0f7ff;
  border: 1px solid #bae6fd;
  border-radius: 20px;
  padding: 8px 20px;
  font-size: 14.5px;
  font-weight: 700;
  color: #0284c7;
}

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

.iv-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 0.15s ease;
}

.iv-btn-finish:hover {
  background-color: #0066d6;
}
