/**
 * dr-page-les-4.css
 * Darja Rihla — Nederlandse les 4: Familie en relaties
 * Theme: Teal/turquoise family bonds
 */

:root {
  --l4-bg: #080d0c;
  --l4-teal: #1fa8b8;
  --l4-cyan: #2db8c8;
  --l4-coral: #f05856;
  --l4-amber: #d4a428;
  --l4-ink: #e0f4f6;
  --l4-muted: #7a9a9f;
}

/* Kleur-CONTRACT voor de gedeelde basis-laag */
.dr-les4-page {
  --les-accent:   var(--l4-teal);
  --les-accent-2: var(--l4-cyan);
  --les-bg:       var(--l4-bg);
  --les-ink:      var(--l4-ink);
  --les-muted:    var(--l4-muted);
}

/* LICHT THEMA — dark/light-knop (de override gebruikt al var(--l4-bg)/ink) */
html[data-lesson-theme="light"] {
  --l4-bg:    #eef7f7;
  --l4-ink:   #0f2426;
  --l4-muted: #4a6e72;
  --l4-teal:  #137f8c;
}

/* ──── BACKGROUND EMOJI ──── */
body:has(.dr-les4-page) {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 600'%3E%3Ctext x='0' y='60' font-size='48' opacity='0.08'%3E👨 👩 👧 👦 👶 👴 👵 💑 👨‍👩‍👧‍👦 👨 👩 👧 👦 👶 👴 👵 💑 👨‍👩‍👧‍👦 👨 👩 👧%3C/text%3E%3Ctext x='0' y='150' font-size='48' opacity='0.08'%3E👦 👶 👴 👵 💑 👨‍👩‍👧‍👦 👨 👩 👧 👦 👶 👴 👵 💑 👨‍👩‍👧‍👦 👨 👩 👧 👦 👶%3C/text%3E%3Ctext x='0' y='240' font-size='48' opacity='0.08'%3E👴 👵 💑 👨‍👩‍👧‍👦 👨 👩 👧 👦 👶 👴 👵 💑 👨‍👩‍👧‍👦 👨 👩 👧 👦 👶 👴%3C/text%3E%3C/svg%3E");
  background-attachment: fixed;
}

/* ──── FULL-WIDTH OVERRIDE (Gutenberg) ──── */
body:has(.dr-les4-page) .dr-single-shell { display: block !important; }

body:has(.dr-les4-page) .dr-single-template-main,
body:has(.dr-les4-page) .dr-single-body-wrap,
body:has(.dr-les4-page) .dr-single-shell,
body:has(.dr-les4-page) .dr-single-content-wrap,
body:has(.dr-les4-page) .dr-single-content-wrap > .wp-block-post-content {
  width: 100% !important; max-width: none !important;
  margin: 0 !important; padding-inline: 0 !important; padding-block: 0 !important;
  background: var(--l4-bg) !important; color: var(--l4-ink) !important;
}

body:has(.dr-les4-page) .wp-block-html,
body:has(.dr-les4-page) .wp-block-html > .dr-les4-page,
body:has(.dr-les4-page) .dr-les4-page {
  width: 100% !important; max-width: none !important; margin: 0 !important; padding: 0 !important;
}

/* ──── NAVIGATION ──── */
.dr-les4-nav {
  position: sticky;
  top: 0;
  z-index: 900;
  background: linear-gradient(135deg, rgba(8, 13, 12, 0.98) 0%, rgba(15, 50, 55, 0.95) 100%);
  border-top: 3px solid var(--l4-teal);
  border-bottom: 1px solid rgba(31, 168, 184, 0.3);
  backdrop-filter: blur(8px);
  padding: 0;
  margin: 0;
}

.dr-les4-nav-inner {
  display: flex;
  gap: 16px;
  padding: 12px 20px;
  max-width: none;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.dr-les4-nav-links {
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: 20px;
  background: rgba(31, 168, 184, 0.1);
  border: 1px solid rgba(31, 168, 184, 0.3);
  color: var(--l4-cyan);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s;
}

.dr-les4-nav-links:hover,
.dr-les4-nav-links.is-done {
  background: rgba(31, 168, 184, 0.3);
  border-color: var(--l4-teal);
  color: var(--l4-ink);
}

/* ──── SECTIONS ──── */
.dr-les4-page > section {
  padding: 48px 24px;
  margin: 0;
  background: var(--l4-bg);
  border-bottom: 1px solid rgba(31, 168, 184, 0.15);
}

.dr-les4-page h2 {
  font-size: 28px;
  font-weight: 800;
  color: var(--l4-teal);
  margin: 0 0 24px 0;
  text-align: center;
}

.dr-les4-page h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--l4-cyan);
  margin: 16px 0 8px 0;
}

.dr-les4-page p {
  font-size: 14px;
  color: var(--l4-muted);
  line-height: 1.6;
  margin: 0 0 16px 0;
}

/* ──── CAROUSEL CONTAINER ──── */
.dr-les4-carousel-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
}

.dr-les4-carousel-btn {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(31, 168, 184, 0.2);
  border: 1px solid var(--l4-teal);
  color: var(--l4-cyan);
  font-size: 20px;
  cursor: pointer;
  transition: all 0.25s;
}

.dr-les4-carousel-btn:hover {
  background: rgba(31, 168, 184, 0.4);
  color: var(--l4-ink);
}

.dr-les4-track {
  flex: 1;
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 8px 0;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

.dr-les4-track::-webkit-scrollbar {
  height: 6px;
}

.dr-les4-track::-webkit-scrollbar-track {
  background: rgba(31, 168, 184, 0.1);
  border-radius: 3px;
}

.dr-les4-track::-webkit-scrollbar-thumb {
  background: rgba(31, 168, 184, 0.4);
  border-radius: 3px;
}

/* ──── FLIP CARDS ──── */
.dr-les4-flipcard {
  flex-shrink: 0;
  width: 200px;
  height: 240px;
  perspective: 1000px;
  cursor: pointer;
  outline: none;
}

.dr-les4-flipcard-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s;
  transform-style: preserve-3d;
  border-radius: 12px;
}

.dr-les4-flipcard.is-flipped .dr-les4-flipcard-inner {
  transform: rotateY(180deg);
}

.dr-les4-flipcard-front,
.dr-les4-flipcard-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  border-radius: 12px;
  gap: 8px;
}

.dr-les4-flipcard-front {
  background: linear-gradient(135deg, rgba(31, 168, 184, 0.2) 0%, rgba(240, 88, 86, 0.1) 100%);
  border: 1px solid var(--l4-teal);
}

.dr-les4-flipcard-back {
  background: linear-gradient(135deg, rgba(212, 164, 40, 0.15) 0%, rgba(31, 168, 184, 0.2) 100%);
  border: 1px solid var(--l4-amber);
  transform: rotateY(180deg);
}

.dr-les4-flipcard-nl {
  font-size: 16px;
  font-weight: 700;
  color: var(--l4-cyan);
  text-align: center;
  line-height: 1.4;
  cursor: pointer;
  transition: color 0.2s;
}

.dr-les4-flipcard-nl:hover {
  color: var(--l4-ink);
}

.dr-les4-flipcard-tounsi {
  font-size: 14px;
  color: var(--l4-amber);
  font-style: italic;
}

.dr-les4-flipcard-meaning {
  font-size: 12px;
  color: var(--l4-muted);
}

.dr-les4-audio-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(240, 88, 86, 0.2);
  border: 1px solid var(--l4-coral);
  color: var(--l4-coral);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.dr-les4-audio-btn:hover {
  background: rgba(240, 88, 86, 0.4);
  color: var(--l4-ink);
}

/* ──── DOTS ──── */
.dr-les4-dots {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin: 16px 0 0 0;
}

.dr-les4-dots .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(31, 168, 184, 0.2);
  border: none;
  cursor: pointer;
  transition: all 0.25s;
}

.dr-les4-dots .dot.is-active {
  background: var(--l4-teal);
  transform: scale(1.3);
}

/* ──── PHRASES ──── */
.dr-les4-phrases {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin: 20px 0;
}

.dr-les4-phrase-card {
  background: linear-gradient(135deg, rgba(31, 168, 184, 0.15) 0%, rgba(240, 88, 86, 0.1) 100%);
  border: 1px solid rgba(31, 168, 184, 0.3);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dr-les4-phrase-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--l4-cyan);
  line-height: 1.5;
}

.dr-les4-phrase-card .dr-les4-audio-btn {
  width: 100%;
  border-radius: 6px;
  padding: 8px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* ──── DIALOGUE ──── */
.dr-les4-dialogue {
  background: rgba(31, 168, 184, 0.08);
  border-left: 4px solid var(--l4-teal);
  border-radius: 8px;
  padding: 20px;
  margin: 20px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dr-les4-dialogue-line {
  display: flex;
  gap: 8px;
  font-size: 13px;
  line-height: 1.6;
}

.dr-les4-speaker {
  font-weight: 700;
  min-width: 60px;
  color: var(--l4-cyan);
}

.dr-les4-text {
  color: var(--l4-muted);
}

.dr-les4-jan .dr-les4-speaker {
  color: var(--l4-coral);
}

.dr-les4-ines .dr-les4-speaker {
  color: var(--l4-amber);
}

/* ──── TYPING EXERCISE ──── */
.dr-les4-typo-card {
  background: rgba(31, 168, 184, 0.1);
  border: 1px solid var(--l4-teal);
  border-radius: 8px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 280px;
  flex-shrink: 0;
}

.dr-les4-typo-q {
  font-size: 14px;
  font-weight: 600;
  color: var(--l4-cyan);
}

.dr-les4-typo-input {
  padding: 10px 12px;
  border: 1px solid rgba(31, 168, 184, 0.3);
  border-radius: 6px;
  background: rgba(8, 13, 12, 0.5);
  color: var(--l4-cyan);
  font-size: 13px;
  font-family: inherit;
  transition: all 0.2s;
}

.dr-les4-typo-input:focus {
  outline: none;
  border-color: var(--l4-teal);
  background: rgba(8, 13, 12, 0.8);
  box-shadow: 0 0 0 2px rgba(31, 168, 184, 0.2);
}

.dr-les4-typo-input.is-correct {
  border-color: #4ade80;
  background: rgba(74, 222, 128, 0.1);
}

.dr-les4-typo-input.is-wrong {
  border-color: #f87171;
  background: rgba(248, 113, 113, 0.1);
}

.dr-les4-typo-submit {
  padding: 8px 16px;
  background: var(--l4-teal);
  border: none;
  border-radius: 6px;
  color: var(--l4-bg);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.dr-les4-typo-submit:hover:not(:disabled) {
  background: var(--l4-cyan);
  color: var(--l4-bg);
}

.dr-les4-typo-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.dr-les4-typo-feedback {
  font-size: 12px;
  font-weight: 600;
  min-height: 16px;
}

.dr-les4-typo-feedback.is-correct {
  color: #4ade80;
}

.dr-les4-typo-feedback.is-wrong {
  color: #f87171;
}

/* ──── QUIZ ──── */
.dr-les4-quiz-progress {
  margin-bottom: 24px;
}

.dr-les4-quiz-bar {
  height: 4px;
  background: rgba(31, 168, 184, 0.2);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 8px;
}

.dr-les4-quiz-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--l4-teal), var(--l4-cyan));
  width: 0%;
  transition: width 0.3s ease;
}

.dr-les4-quiz-q-num {
  font-size: 12px;
  color: var(--l4-muted);
  margin-bottom: 12px;
}

.dr-les4-quiz-question {
  font-size: 16px;
  font-weight: 700;
  color: var(--l4-cyan);
  margin-bottom: 12px;
  line-height: 1.5;
}

.dr-les4-quiz-hint {
  font-size: 12px;
  color: var(--l4-muted);
  background: rgba(31, 168, 184, 0.1);
  border-left: 2px solid var(--l4-teal);
  padding: 8px 12px;
  border-radius: 4px;
  margin-bottom: 16px;
}

.dr-les4-quiz-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.dr-les4-quiz-opt {
  padding: 12px;
  background: rgba(31, 168, 184, 0.1);
  border: 1px solid rgba(31, 168, 184, 0.3);
  border-radius: 6px;
  color: var(--l4-cyan);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}

.dr-les4-quiz-opt:hover:not(:disabled) {
  background: rgba(31, 168, 184, 0.25);
  border-color: var(--l4-teal);
}

.dr-les4-quiz-opt:disabled {
  cursor: not-allowed;
}

.dr-les4-quiz-opt.is-correct {
  background: rgba(74, 222, 128, 0.2);
  border-color: #4ade80;
  color: #4ade80;
}

.dr-les4-quiz-opt.is-wrong {
  background: rgba(248, 113, 113, 0.2);
  border-color: #f87171;
  color: #f87171;
}

.dr-les4-quiz-feedback {
  font-size: 13px;
  font-weight: 600;
  min-height: 18px;
  padding: 8px 12px;
  border-radius: 4px;
  margin-top: 12px;
}

.dr-les4-quiz-feedback.is-correct {
  color: #4ade80;
  background: rgba(74, 222, 128, 0.1);
}

.dr-les4-quiz-feedback.is-wrong {
  color: #f87171;
  background: rgba(248, 113, 113, 0.1);
}

.dr-les4-quiz-score {
  margin-top: 24px;
  padding: 16px;
  background: rgba(31, 168, 184, 0.1);
  border-radius: 8px;
  text-align: center;
  font-size: 14px;
  color: var(--l4-cyan);
}

.dr-les4-quiz-score strong {
  color: var(--l4-ink);
  font-size: 18px;
}

.dr-les4-reset-btn {
  margin-left: 12px;
  padding: 6px 12px;
  background: var(--l4-teal);
  border: none;
  border-radius: 4px;
  color: var(--l4-bg);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.dr-les4-reset-btn:hover {
  background: var(--l4-cyan);
  color: var(--l4-bg);
}

/* ──── RECAP GRID ──── */
.dr-les4-recap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin: 24px 0;
}

.dr-les4-recap-card {
  background: linear-gradient(135deg, rgba(31, 168, 184, 0.1) 0%, rgba(212, 164, 40, 0.05) 100%);
  border: 1px solid rgba(31, 168, 184, 0.2);
  border-radius: 8px;
  padding: 16px;
}

.dr-les4-recap-card h3 {
  margin: 0 0 12px 0;
}

.dr-les4-recap-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  color: var(--l4-muted);
}

.dr-les4-recap-card li {
  line-height: 1.5;
}

.dr-les4-recap-card strong {
  color: var(--l4-cyan);
}

.dr-les4-recap-card p {
  font-size: 13px;
  margin: 0;
}

/* ──── NEXT LESSON ──── */
.dr-les4-next-lesson {
  text-align: center;
  padding: 32px 20px;
  background: rgba(31, 168, 184, 0.1);
  border-radius: 12px;
  border: 1px solid rgba(31, 168, 184, 0.2);
  margin: 32px 0;
}

.dr-les4-next-lesson p {
  margin: 8px 0;
  font-size: 14px;
}

.dr-les4-next-lesson p:first-child {
  font-size: 18px;
  font-weight: 700;
  color: var(--l4-cyan);
}

.dr-les4-next-btn {
  display: inline-block;
  margin-top: 12px;
  padding: 10px 24px;
  background: var(--l4-teal);
  border: none;
  border-radius: 20px;
  color: var(--l4-bg);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.dr-les4-next-btn:hover {
  background: var(--l4-cyan);
  color: var(--l4-bg);
}

/* ──── POPUP ──── */
.dr-les4-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
  padding: 20px;
}

.dr-les4-popup-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.dr-les4-popup-box {
  position: relative;
  background: var(--l4-bg);
  border: 1px solid var(--l4-teal);
  border-radius: 12px;
  padding: 28px;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: popupSlideIn 0.3s ease;
}

@keyframes popupSlideIn {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

.dr-les4-popup-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(31, 168, 184, 0.2);
  border: none;
  color: var(--l4-cyan);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.dr-les4-popup-close:hover {
  background: rgba(31, 168, 184, 0.4);
  color: var(--l4-ink);
}

.dr-les4-popup-kicker {
  font-size: 20px;
  margin-bottom: 12px;
}

.dr-les4-popup-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--l4-cyan);
  margin: 0 0 16px 0;
}

.dr-les4-popup-body {
  font-size: 13px;
  color: var(--l4-muted);
  line-height: 1.7;
}

.dr-les4-popup-body p {
  margin: 12px 0;
}

.dr-les4-popup-body strong {
  color: var(--l4-ink);
}

.dr-les4-tounsi {
  font-style: italic;
  color: var(--l4-amber);
}

/* ──── RESPONSIVE ──── */
@media (max-width: 768px) {
  .dr-les4-page > section {
    padding: 32px 16px;
  }

  .dr-les4-page h2 {
    font-size: 22px;
  }

  .dr-les4-flipcard {
    width: 160px;
    height: 200px;
  }

  .dr-les4-phrases {
    grid-template-columns: 1fr;
  }

  .dr-les4-recap-grid {
    grid-template-columns: 1fr;
  }

  .dr-les4-popup-box {
    padding: 20px;
  }
}
