/* ==========================================================================
   Open English Daily News Player - 100% Visual & Behavioral Parity with OE Production
   Matches live_news_open.png
   ========================================================================== */

.daily-news-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: dnFadeIn 0.2s ease-out;
  box-sizing: border-box;
}

.daily-news-modal-overlay.active {
  display: flex;
}

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

.daily-news-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: dnSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dnSlideUp {
  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 */
.dn-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;
}

.dn-header-title {
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dn-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;
  margin-left: auto;
}

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

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

/* --------------------------------------------------------------------------
   VIEW 1: DAY'S EDITION MODAL (Grid matching live_news_open.png)
   -------------------------------------------------------------------------- */
.dn-edition-view {
  padding: 16px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-sizing: border-box;
}

/* Progress bar at top of edition */
.dn-edition-progress-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
}

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

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

.dn-edition-progress-text {
  font-size: 14px;
  font-weight: 600;
  color: #4b5563;
  white-space: nowrap;
}

/* 3-Stories Grid: 2 columns top row, 1 full-width bottom row */
.dn-stories-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dn-stories-top-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.dn-story-card {
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  flex-direction: column;
  text-align: left;
  border: 1px solid transparent;
}

.dn-story-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

.dn-story-thumb-wrap {
  width: 100%;
  height: 135px;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  background-color: #f1f5f9;
}

.dn-story-card.wide .dn-story-thumb-wrap {
  height: 250px;
}

.dn-story-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.dn-story-badge-done {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #10b981;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.dn-story-meta {
  padding: 10px 4px 4px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dn-story-title {
  font-size: 16px;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
  line-height: 1.3;
}

.dn-story-card.wide .dn-story-title {
  font-size: 17px;
}

.dn-story-subtitle {
  font-size: 13.5px;
  color: #4b5563;
  line-height: 1.35;
  margin: 0;
}

/* --------------------------------------------------------------------------
   VIEW 2: FULL INTERACTIVE ARTICLE READER
   -------------------------------------------------------------------------- */
.dn-reader-view {
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* Reader top sub-bar */
.dn-reader-subnav {
  padding: 10px 20px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dn-btn-back {
  background: transparent;
  border: none;
  color: #0079ff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  transition: opacity 0.15s ease;
}

.dn-btn-back:hover {
  opacity: 0.8;
}

.dn-reader-date-badge {
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
}

/* Audio Scrubber Bar */
.dn-audio-bar {
  background: #f0f7ff;
  border-bottom: 1px solid #bae6fd;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.dn-btn-play {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #0079ff;
  border: none;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  font-size: 16px;
  box-shadow: 0 2px 8px rgba(0, 121, 255, 0.3);
  transition: background 0.15s ease;
}

.dn-btn-play:hover {
  background: #0066d6;
}

.dn-scrubber-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dn-scrubber {
  width: 100%;
  accent-color: #0079ff;
  cursor: pointer;
}

.dn-time-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #475569;
  font-weight: 600;
}

.dn-speed-btn {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s ease;
}

.dn-speed-btn:hover {
  border-color: #0079ff;
  color: #0079ff;
}

/* Reader Content Body */
.dn-reader-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.dn-reader-headline {
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.25;
  margin: 0;
}

.dn-reader-summary {
  font-size: 15px;
  color: #475569;
  line-height: 1.5;
  margin: 0;
  font-style: italic;
}

.dn-reader-hero-wrap {
  width: 100%;
  max-height: 240px;
  border-radius: 10px;
  overflow: hidden;
}

.dn-reader-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.dn-reader-paragraphs {
  font-size: 15.5px;
  color: #334155;
  line-height: 1.65;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Interactive Oxford Dictionary Vocabulary Words */
.dn-word-interactive {
  color: #0079ff;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 2.5px;
  cursor: pointer;
  position: relative;
  display: inline-block;
  transition: background 0.15s ease, color 0.15s ease;
  border-radius: 2px;
  padding: 0 2px;
}

.dn-word-interactive:hover {
  background-color: #e0f2fe;
  color: #0369a1;
}

/* Oxford Dictionary Popover */
.dn-oxford-popover {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  transform: none;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  padding: 14px 16px;
  z-index: 100010;
  width: 260px;
  text-align: left;
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.4;
  color: #1e293b;
  cursor: default;
  animation: dnPopoverIn 0.18s ease-out;
}

@keyframes dnPopoverIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.dn-oxford-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid #f1f5f9;
}

.dn-oxford-term {
  font-weight: 800;
  font-size: 15px;
  color: #0f172a;
}

.dn-oxford-ipa {
  font-size: 12px;
  color: #0284c7;
  font-style: italic;
  margin-left: 6px;
}

.dn-oxford-audio-btn {
  background: #e0f2fe;
  border: none;
  color: #0284c7;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 11px;
}

.dn-oxford-def {
  color: #334155;
  margin-bottom: 6px;
}

.dn-oxford-translation {
  background: #f8fafc;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12.5px;
  color: #0369a1;
  font-weight: 600;
}

/* Key Vocabulary Cards Section */
.dn-vocab-section {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dn-section-title {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.dn-vocab-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.dn-vocab-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dn-vocab-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dn-vocab-term {
  font-weight: 700;
  color: #0284c7;
  font-size: 14px;
}

.dn-vocab-trans {
  font-size: 12.5px;
  color: #475569;
}

.dn-vocab-def {
  font-size: 12px;
  color: #64748b;
  line-height: 1.35;
}

/* 3-Question Comprehension Quiz Section */
.dn-quiz-section {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.dn-quiz-question-box {
  padding: 14px 0;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dn-quiz-question-box:last-child {
  border-bottom: none;
}

.dn-quiz-prompt {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.dn-quiz-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

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

.dn-quiz-opt-btn:disabled {
  cursor: default;
}

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

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

.dn-quiz-feedback {
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.4;
  display: none;
}

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

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

/* Reader Footer: Reward & Finish Button */
.dn-reader-footer {
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.dn-footer-rewards {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dn-footer-xp-pill {
  background: #fefce8;
  border: 1px solid #fef08a;
  border-radius: 16px;
  padding: 6px 14px;
  font-size: 14px;
  font-weight: 800;
  color: #ca8a04;
}

.dn-footer-hours-pill {
  background: #f0f7ff;
  border: 1px solid #bae6fd;
  border-radius: 16px;
  padding: 6px 14px;
  font-size: 13.5px;
  font-weight: 700;
  color: #0284c7;
}

.dn-btn-complete-article {
  background-color: #0079ff;
  color: #ffffff;
  border: none;
  border-radius: 20px;
  padding: 10px 32px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 121, 255, 0.3);
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.dn-btn-complete-article:hover {
  background-color: #0066d6;
  transform: translateY(-1px);
}
