
/* ═══════════════════════════════════════════════════════
   MOBILE POLISH — Èdè Yorùbá
   ═══════════════════════════════════════════════════════ */

/* ── Global mobile reset ────────────────────────────── */
@media (max-width: 768px) {
  .ey-wrap {
    padding: 16px 12px;
    max-width: 100%;
  }

  /* Course header */
  .ey-course-header {
    gap: 12px;
  }
  .ey-course-header h2 {
    font-size: 17px;
    line-height: 1.3;
  }
  .ey-course-icon {
    width: 44px;
    height: 44px;
    font-size: 20px;
  }
  .ey-course-meta {
    gap: 6px;
  }
  .ey-badge-pill {
    font-size: 11px;
    padding: 2px 8px;
  }
  .ey-item-count {
    font-size: 12px;
  }

  /* Progress bar */
  .ey-progress-bar {
    margin-bottom: 16px;
  }

  /* Tabs — horizontal scroll */
  .ey-tabs {
    gap: 0;
    margin-bottom: 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .ey-tabs::-webkit-scrollbar {
    display: none;
  }
  .ey-tab {
    padding: 10px 14px;
    font-size: 14px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* Stats grid */
  .ey-stats {
    padding: 12px;
    margin-bottom: 20px;
  }
  .ey-stats-grid {
    gap: 8px;
  }
  .ey-stat-card {
    padding: 10px 8px;
  }
  .ey-stat-value {
    font-size: 20px;
  }
  .ey-stat-name {
    font-size: 11px;
  }

  /* Section headers */
  .ey-section {
    margin-bottom: 24px;
  }
  .ey-section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    margin-bottom: 10px;
  }
  .ey-section-title {
    font-size: 15px;
  }
  .ey-section-count {
    font-size: 11px;
  }

  /* Item stack */
  .ey-item-stack {
    border-radius: 10px;
  }
  .ey-item {
    padding: 12px;
    gap: 10px;
  }
  .ey-yoruba {
    font-size: 14px;
    line-height: 1.4;
  }
  .ey-english {
    font-size: 12px;
  }

  /* Audio buttons — bigger tap targets on mobile */
  .ey-audio-group {
    gap: 6px;
  }
  .ey-audio-btn {
    width: 38px;
    height: 38px;
    min-width: 38px;
  }
  .ey-audio-btn svg {
    width: 18px;
    height: 18px;
  }
  .ey-gender-dot {
    width: 8px;
    height: 8px;
  }

  /* Completion checkmarks */
  .ey-check {
    width: 20px;
    height: 20px;
    min-width: 20px;
  }

  /* Course cards (program overview) */
  .ey-program-grid {
    gap: 6px;
  }
  .ey-course-card {
    padding: 14px 12px;
    gap: 12px;
    border-radius: 10px;
  }
  .ey-course-card-progress {
    width: 40px;
    height: 40px;
    min-width: 40px;
  }
  .ey-course-card-code {
    font-size: 14px;
  }
  .ey-course-card-subtitle {
    font-size: 12px;
  }

  /* Quiz cards */
  .ey-quiz-card,
  div[onclick*="EYQuiz.open"] {
    padding: 12px;
    gap: 10px;
    border-radius: 10px;
  }

  /* Cultural note */
  div[style*="ey-amber-50"],
  div[style*="#FAEEDA"] {
    padding: 10px 12px;
    font-size: 13px;
    border-radius: 10px;
  }

  /* Back link */
  a[href*="Back to program"],
  a[style*="Back to program"] {
    font-size: 13px;
    margin-bottom: 12px;
  }
}

/* ── Small phones (≤400px) ──────────────────────────── */
@media (max-width: 400px) {
  .ey-wrap {
    padding: 12px 8px;
  }
  .ey-course-header h2 {
    font-size: 15px;
  }
  .ey-course-icon {
    width: 38px;
    height: 38px;
    font-size: 18px;
  }
  .ey-stats-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }
  .ey-stat-value {
    font-size: 18px;
  }
  .ey-item {
    padding: 10px 8px;
    gap: 8px;
  }
  .ey-yoruba {
    font-size: 13px;
  }
  .ey-audio-btn {
    width: 34px;
    height: 34px;
    min-width: 34px;
  }
}

/* ── Quiz modal — mobile fullscreen ─────────────────── */
@media (max-width: 768px) {
  .ey-qm-overlay {
    padding: 0;
    align-items: flex-end;
  }
  .ey-qm-inner {
    max-height: 92vh;
    border-radius: 16px 16px 0 0;
    padding: 20px 16px;
    max-width: 100%;
  }
  .ey-qm-inner h3 {
    font-size: 16px;
    padding-right: 32px;
  }
  .ey-question-text {
    font-size: 15px;
  }
  .ey-option {
    padding: 10px 12px;
    font-size: 14px;
  }
  .ey-fill-blank {
    font-size: 14px;
    padding: 10px 12px;
  }
  .ey-quiz-submit {
    font-size: 15px;
    padding: 12px;
  }
}

/* ── Flashcard — mobile ─────────────────────────────── */
@media (max-width: 768px) {
  .ey-fc-container {
    margin: 16px 0;
  }
  .ey-fc-card {
    min-height: 180px;
  }
  .ey-fc-front,
  .ey-fc-back {
    padding: 24px 16px;
  }
  .ey-fc-yoruba {
    font-size: 20px;
  }
  .ey-fc-english {
    font-size: 18px;
  }
  .ey-fc-controls {
    gap: 12px;
    margin-top: 12px;
  }
  .ey-fc-btn {
    padding: 10px 18px;
    font-size: 14px;
  }
  .ey-fc-counter {
    font-size: 13px;
  }
}

/* ── Touch-friendly enhancements ────────────────────── */
@media (hover: none) and (pointer: coarse) {
  /* Larger tap targets for touch devices */
  .ey-audio-btn {
    width: 42px;
    height: 42px;
    min-width: 42px;
  }
  .ey-option {
    padding: 14px;
    min-height: 48px;
  }
  .ey-tab {
    padding: 12px 16px;
    min-height: 44px;
  }
  .ey-course-card {
    min-height: 64px;
  }
  .ey-fc-btn {
    min-height: 44px;
    padding: 12px 20px;
  }
  .ey-check {
    width: 24px;
    height: 24px;
    min-width: 24px;
  }

  /* Remove hover effects on touch */
  .ey-item:hover {
    background: transparent;
  }
  .ey-course-card:hover {
    background: transparent;
    border-color: rgba(0,0,0,0.1);
  }
}

/* ── Landscape phone ────────────────────────────────── */
@media (max-height: 500px) and (orientation: landscape) {
  .ey-qm-inner {
    max-height: 85vh;
  }
  .ey-fc-card {
    min-height: 140px;
  }
  .ey-fc-front,
  .ey-fc-back {
    padding: 16px;
  }
}

/* ── Tablet tweaks (769px - 1024px) ─────────────────── */
@media (min-width: 769px) and (max-width: 1024px) {
  .ey-wrap {
    max-width: 680px;
    padding: 20px 16px;
  }
  .ey-stats-grid {
    gap: 10px;
  }
}

/* ── Safe area for notched phones ───────────────────── */
@supports (padding: max(0px)) {
  @media (max-width: 768px) {
    .ey-wrap {
      padding-left: max(12px, env(safe-area-inset-left));
      padding-right: max(12px, env(safe-area-inset-right));
    }
    .ey-qm-inner {
      padding-bottom: max(20px, env(safe-area-inset-bottom));
    }
  }
}

/* ── Prevent content shift on scroll ────────────────── */
.ey-qm-overlay {
  overscroll-behavior: contain;
}
.ey-qm-inner {
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

/* ── Smooth transitions for tab content ─────────────── */
.ey-tab-panel {
  animation: eyFadeIn 0.2s ease;
}
@keyframes eyFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}