/* ===================================================
   Learn Arabic — Shared Styles
   learn-arabic.css
   =================================================== */

/* ---- Arabic Script Font ---- */
.ar {
  font-family: "Noto Naskh Arabic", "Amiri", serif;
  direction: rtl;
  unicode-bidi: embed;
}

/* ---- Course Progress Strip ---- */
.la-progress-strip {
  background: #fff;
  border-bottom: 1px solid rgba(0,0,0,.07);
  padding: 10px 0;
  position: sticky;
  top: 82px;
  z-index: 900;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.la-progress-strip .progress {
  height: 7px;
  border-radius: 50px;
  background: #e9ecef;
  flex: 1;
}
.la-progress-strip .progress-bar {
  background: linear-gradient(90deg, #1f7a63, #2eb872);
  border-radius: 50px;
  transition: width 0.5s ease;
}
.la-step-label {
  font-size: 12px;
  font-weight: 700;
  color: #1f7a63;
  white-space: nowrap;
}
.la-step-pct {
  font-size: 12px;
  color: #9ca3af;
  white-space: nowrap;
}

/* ---- Step Pills Navigator ---- */
.la-step-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  padding: 14px 0 6px;
}
.la-step-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  background: #f3f4f6;
  color: #6b7280;
  border: 2px solid transparent;
  transition: all 0.2s;
}
.la-step-pill:hover {
  background: #e5f4ef;
  color: #1f7a63;
  border-color: #1f7a63;
}
.la-step-pill.active {
  background: #1f7a63;
  color: #fff;
  border-color: #1f7a63;
  box-shadow: 0 3px 10px rgba(31,122,99,.3);
}
.la-step-pill.done {
  background: #e5f4ef;
  color: #1f7a63;
  border-color: #96d5be;
}

/* ---- Flip Letter Cards ---- */
.la-letter-card {
  cursor: pointer;
  perspective: 900px;
  height: 190px;
  user-select: none;
}
.la-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.55s cubic-bezier(.4,0,.2,1);
  transform-style: preserve-3d;
}
.la-letter-card.flipped .la-card-inner {
  transform: rotateY(180deg);
}
.la-card-front,
.la-card-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-shadow: 0 3px 14px rgba(0,0,0,.07);
}
.la-card-front {
  background: #fff;
  border: 1.5px solid rgba(0,0,0,.06);
}
.la-card-back {
  background: linear-gradient(145deg, #1f7a63 0%, #2eb872 100%);
  color: #fff;
  transform: rotateY(180deg);
}
.la-letter-glyph {
  font-family: "Noto Naskh Arabic", "Amiri", serif;
  font-size: 3.6rem;
  line-height: 1.2;
  color: #1f7a63;
  font-weight: 600;
  display: block;
}
.la-card-back .la-letter-glyph {
  font-size: 2.4rem;
  color: rgba(255,255,255,.9);
}
.la-letter-name-en {
  font-size: 13px;
  font-weight: 700;
  color: #374151;
  margin-top: 4px;
}
.la-letter-name-ar {
  font-family: "Noto Naskh Arabic","Amiri",serif;
  font-size: 14px;
  color: #9ca3af;
}
.la-flip-hint {
  font-size: 10px;
  color: #d1d5db;
  margin-top: 6px;
}
.la-card-back .la-back-row {
  font-size: 12px;
  opacity: .9;
  margin: 2px 0;
  line-height: 1.5;
}
.la-card-back .la-back-row strong {
  opacity: 1;
}
.la-card-back .la-back-example-ar {
  font-family: "Noto Naskh Arabic","Amiri",serif;
  font-size: 1.3rem;
  display: block;
  margin-top: 4px;
  line-height: 1.8;
}

/* ---- Audio Button ---- */
.la-audio-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 50px;
  border: 1.5px solid #1f7a63;
  background: transparent;
  color: #1f7a63;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  line-height: 1.4;
}
.la-audio-btn:hover,
.la-audio-btn.playing {
  background: #1f7a63;
  color: #fff;
}
.la-audio-btn.sm {
  padding: 3px 10px;
  font-size: 11px;
}

/* ---- Letter Forms Table ---- */
.la-forms-wrap {
  background: #fff;
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,.07);
  overflow: hidden;
}
.la-forms-table {
  width: 100%;
  border-collapse: collapse;
}
.la-forms-table th {
  background: #f9fafb;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #6b7280;
  padding: 9px 10px;
  text-align: center;
  border-bottom: 1px solid #f3f4f6;
}
.la-forms-table td {
  padding: 12px 10px;
  text-align: center;
  border-bottom: 1px solid #f9fafb;
  font-family: "Noto Naskh Arabic","Amiri",serif;
  font-size: 1.8rem;
  line-height: 1.5;
  color: #1f7a63;
}
.la-forms-table tr:last-child td { border-bottom: none; }
.la-forms-table .la-form-label {
  font-family: "Inter",sans-serif;
  font-size: 12px;
  color: #374151;
  font-weight: 600;
}
.la-forms-table .la-form-note {
  font-family: "Inter",sans-serif;
  font-size: 11px;
  color: #9ca3af;
}

/* ---- Vowel Demo Box ---- */
.la-vowel-box {
  background: #fff;
  border: 1.5px solid rgba(0,0,0,.06);
  border-radius: 16px;
  padding: 22px 16px;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0,0,0,.05);
  transition: transform .2s, box-shadow .2s;
}
.la-vowel-box:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,.1); }
.la-vowel-glyph {
  font-family: "Noto Naskh Arabic","Amiri",serif;
  font-size: 3.2rem;
  line-height: 2;
  display: block;
}
.la-vowel-name { font-weight: 700; font-size: 15px; color: #1c1c1c; }
.la-vowel-arabic { font-family: "Noto Naskh Arabic","Amiri",serif; font-size: 13px; color: #9ca3af; }
.la-vowel-sound { font-size: 12px; color: #6b7280; margin-top: 4px; }

/* ---- Word Card ---- */
.la-word-card {
  background: #fff;
  border-radius: 14px;
  padding: 14px 18px;
  border: 1.5px solid rgba(0,0,0,.06);
  box-shadow: 0 2px 10px rgba(0,0,0,.04);
  display: flex;
  align-items: center;
  gap: 14px;
  transition: transform .2s, box-shadow .2s;
}
.la-word-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.09); }
.la-word-arabic {
  font-family: "Noto Naskh Arabic","Amiri",serif;
  font-size: 2rem;
  line-height: 2;
  color: #1f7a63;
  font-weight: 600;
  min-width: 90px;
  text-align: center;
  direction: rtl;
}
.la-word-trans { font-size: 14px; font-weight: 600; color: #1c1c1c; }
.la-word-meaning { font-size: 12px; color: #9ca3af; }

/* ---- Phrase Card ---- */
.la-phrase-card {
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  border: 1.5px solid rgba(0,0,0,.06);
  box-shadow: 0 3px 14px rgba(0,0,0,.05);
  margin-bottom: 14px;
}
.la-phrase-arabic {
  font-family: "Noto Naskh Arabic","Amiri",serif;
  font-size: 2rem;
  line-height: 2.2;
  color: #1c1c1c;
  direction: rtl;
  text-align: right;
  margin-bottom: 8px;
}
.la-phrase-trans { font-size: 14px; font-weight: 600; color: #374151; }
.la-phrase-meaning { font-size: 12px; color: #9ca3af; }
.la-phrase-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  direction: rtl;
  margin-top: 10px;
}
.la-phrase-word {
  background: #f9fafb;
  border-radius: 8px;
  padding: 6px 10px;
  text-align: center;
}
.la-phrase-word .pw-ar {
  font-family: "Noto Naskh Arabic","Amiri",serif;
  font-size: 1.1rem;
  display: block;
  line-height: 1.8;
  color: #1f7a63;
}
.la-phrase-word .pw-en {
  font-size: 10px;
  color: #9ca3af;
  direction: ltr;
  display: block;
}

/* ---- Bottom Navigation ---- */
.la-nav-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px 0 44px;
  gap: 12px;
}
.la-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all .2s;
  border: 2px solid #1f7a63;
}
.la-nav-btn.prev { background: #fff; color: #1f7a63; }
.la-nav-btn.next { background: #1f7a63; color: #fff; }
.la-nav-btn:hover { background: #16624f; border-color: #16624f; color: #fff; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(31,122,99,.3); }
.la-nav-btn.no-prev { opacity: 0; pointer-events: none; }

/* ---- Tip Box ---- */
.la-tip-box {
  background: linear-gradient(135deg, #e8f5ee, #f0faf5);
  border-left: 4px solid #1f7a63;
  border-radius: 10px;
  padding: 14px 18px;
  margin: 16px 0;
  font-size: 13px;
  color: #374151;
}
.la-tip-box strong { color: #1f7a63; }

.la-warning-box {
  background: linear-gradient(135deg, #fff7ed, #fffbf5);
  border-left: 4px solid #f59e0b;
  border-radius: 10px;
  padding: 14px 18px;
  margin: 16px 0;
  font-size: 13px;
  color: #374151;
}

/* ---- Section Heading ---- */
.la-section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1c1c1c;
  margin-bottom: 4px;
}
.la-section-sub {
  font-size: 13px;
  color: #9ca3af;
  margin-bottom: 18px;
}

/* ---- Phase Badge ---- */
.la-phase-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 50px;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.la-ph-1 { background: #e5f4ef; color: #1f7a63; }
.la-ph-2 { background: #eff6ff; color: #2563eb; }
.la-ph-3 { background: #f5f3ff; color: #7c3aed; }
.la-ph-4 { background: #fff7ed; color: #ea580c; }

/* ---- Course Overview Card ---- */
.la-course-card {
  background: #fff;
  border-radius: 14px;
  padding: 16px;
  border: 1.5px solid rgba(0,0,0,.07);
  text-decoration: none;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  transition: all .2s;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
  margin-bottom: 0;
}
.la-course-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,.1);
  border-color: #1f7a63;
}
.la-course-card .la-num {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #e5f4ef;
  color: #1f7a63;
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1.5px solid #c3e8d8;
}
.la-course-card .la-card-title {
  font-size: 14px;
  font-weight: 600;
  color: #1c1c1c;
  margin-bottom: 2px;
  line-height: 1.3;
}
.la-course-card .la-card-desc {
  font-size: 12px;
  color: #9ca3af;
  line-height: 1.4;
}

/* ---- Quiz Styles ---- */
.la-quiz-q {
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  border: 1.5px solid rgba(0,0,0,.07);
  box-shadow: 0 3px 14px rgba(0,0,0,.05);
  margin-bottom: 16px;
}
.la-quiz-q .q-text {
  font-size: 15px;
  font-weight: 600;
  color: #1c1c1c;
  margin-bottom: 12px;
}
.la-quiz-q .q-arabic {
  font-family: "Noto Naskh Arabic","Amiri",serif;
  font-size: 2.5rem;
  color: #1f7a63;
  display: block;
  text-align: center;
  line-height: 2;
  margin-bottom: 14px;
}
.la-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f9fafb;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all .2s;
  width: 100%;
  text-align: left;
  margin-bottom: 8px;
}
.la-opt:hover { border-color: #1f7a63; background: #e8f5ee; }
.la-opt.correct { border-color: #22c55e; background: #f0fdf4; color: #15803d; font-weight: 700; }
.la-opt.wrong { border-color: #ef4444; background: #fef2f2; color: #dc2626; }
.la-opt .opt-ar {
  font-family: "Noto Naskh Arabic","Amiri",serif;
  font-size: 1.5rem;
  min-width: 44px;
  text-align: center;
  line-height: 1.8;
}
.la-quiz-result {
  display: none;
  text-align: center;
  padding: 36px 20px;
  background: linear-gradient(135deg, #1f7a63 0%, #2eb872 100%);
  border-radius: 20px;
  color: #fff;
}
.la-quiz-result.show { display: block; }
.la-quiz-result .score-big { font-size: 3.5rem; font-weight: 900; line-height: 1; }
.la-quiz-result .score-label { font-size: 13px; opacity: .85; margin-top: 4px; }
.la-quiz-result .score-msg { font-size: 16px; font-weight: 700; margin: 14px 0 6px; }

/* ---- Connecting Letters Demo ---- */
.la-conn-demo {
  font-family: "Noto Naskh Arabic","Amiri",serif;
  font-size: 2.4rem;
  direction: rtl;
  letter-spacing: 0;
  line-height: 2;
}
.c-green { color: #1f7a63; }
.c-red   { color: #ef4444; }
.c-gold  { color: #d97706; }

.la-nonconn-badge {
  display: inline-block;
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fca5a5;
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
}
.la-conn-badge {
  display: inline-block;
  background: #e5f4ef;
  color: #1f7a63;
  border: 1px solid #96d5be;
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
}

/* ---- Alphabet Overview Grid (Step 1) ---- */
.la-alpha-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}
@media (max-width: 768px) {
  .la-alpha-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 480px) {
  .la-alpha-grid { grid-template-columns: repeat(4, 1fr); }
}
.la-alpha-cell {
  background: #fff;
  border: 1.5px solid rgba(0,0,0,.07);
  border-radius: 12px;
  padding: 10px 6px;
  text-align: center;
  text-decoration: none;
  transition: all .2s;
  display: block;
}
.la-alpha-cell:hover {
  border-color: #1f7a63;
  background: #e5f4ef;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(31,122,99,.15);
}
.la-alpha-cell .al-letter {
  font-family: "Noto Naskh Arabic","Amiri",serif;
  font-size: 2rem;
  color: #1f7a63;
  display: block;
  line-height: 1.8;
}
.la-alpha-cell .al-name {
  font-size: 10px;
  color: #6b7280;
  font-weight: 600;
}
.la-alpha-cell .al-num {
  font-size: 9px;
  color: #d1d5db;
}

/* ---- Reading Practice ---- */
.la-read-card {
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  border: 1.5px solid rgba(0,0,0,.07);
  box-shadow: 0 3px 14px rgba(0,0,0,.05);
  text-align: center;
  transition: all .2s;
}
.la-read-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,.1); }
.la-read-arabic {
  font-family: "Noto Naskh Arabic","Amiri",serif;
  font-size: 2.8rem;
  color: #1c1c1c;
  direction: rtl;
  line-height: 2;
  display: block;
  margin-bottom: 6px;
}
.la-read-trans { font-size: 15px; font-weight: 700; color: #1f7a63; }
.la-read-meaning { font-size: 12px; color: #9ca3af; margin-top: 2px; }

/* ---- Vowel Practice Table ---- */
.la-vowel-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
}
.la-vowel-table th {
  background: #1f7a63;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 10px 12px;
  text-align: center;
  letter-spacing: .04em;
}
.la-vowel-table td {
  background: #fff;
  padding: 12px 10px;
  text-align: center;
  border-bottom: 1px solid #f3f4f6;
  font-size: 13px;
}
.la-vowel-table td.ar-cell {
  font-family: "Noto Naskh Arabic","Amiri",serif;
  font-size: 1.8rem;
  line-height: 2;
  color: #1f7a63;
}
.la-vowel-table tr:last-child td { border-bottom: none; }
.la-vowel-table tr:nth-child(even) td { background: #fafafa; }

/* ---- Hero Stat Boxes ---- */
.la-stat-box {
  background: #fff;
  border-radius: 14px;
  padding: 18px;
  border: 1.5px solid rgba(0,0,0,.07);
  text-align: center;
  box-shadow: 0 2px 10px rgba(0,0,0,.04);
}
.la-stat-box .la-stat-num {
  font-size: 2.2rem;
  font-weight: 800;
  color: #1f7a63;
  line-height: 1;
}
.la-stat-box .la-stat-label {
  font-size: 12px;
  color: #9ca3af;
  margin-top: 4px;
}

/* ---- Gradient Gold ---- */
.gradient-gold {
  background: linear-gradient(45deg, #d97706, #f59e0b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ---- Back to course link ---- */
.la-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #1f7a63;
  font-weight: 600;
  text-decoration: none;
}
.la-back-link:hover { text-decoration: underline; color: #16624f; }

/* ===================================================
   Website additions (not in the static design)
   The lesson HTML is admin-editable and script-free, so the
   interactive pieces are <button>/<div> elements driven by
   data-* attributes (see js/learn-arabic.js).
   =================================================== */

/* ---- Lesson frame ---- */
.la-step-pill.locked { opacity: .45; }
.la-lesson-tools {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 24px;
  padding: 4px 0 14px;
}
.la-lesson-tools .btn-link { font-size: 12px; font-weight: 600; text-decoration: none; }
.la-enrol-progress { display: flex; align-items: center; gap: 8px; }
.la-enrol-progress .progress { width: 140px; border-radius: 50px; }
.la-lesson-content { font-size: 15px; }
.la-lesson-intro { max-width: 720px; margin-left: auto; margin-right: auto; }
.la-complete-bar { display: flex; justify-content: center; padding-top: 24px; }
.la-nav-btn .la-nav-text {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.la-nav-btn.la-nav-finished { opacity: .4; pointer-events: none; }
@media (max-width: 576px) {
  .la-nav-btn { padding: 8px 12px; font-size: 12px; }
  .la-nav-btn .la-nav-text { max-width: 90px; }
}

/* ---- data-speak elements ---- */
button.la-alpha-cell {
  width: 100%;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.la-speak { cursor: pointer; }
.la-speak:focus-visible,
.la-flip:focus-visible,
.la-opt:focus-visible {
  outline: 3px solid rgba(31,122,99,.45);
  outline-offset: 2px;
}
.la-flip:focus-visible { border-radius: 16px; }
.la-speak.la-speaking { border-color: #1f7a63; box-shadow: 0 0 0 3px rgba(31,122,99,.18); }
.la-speech-note {
  background: linear-gradient(135deg, #fff7ed, #fffbf5);
  border-left: 4px solid #f59e0b;
  border-radius: 10px;
  padding: 12px 16px;
  margin: 0 0 16px;
  font-size: 13px;
  color: #374151;
}

/* ---- Quiz: readable markup first, enhanced by learn-arabic.js ---- */
.la-quiz .la-question {
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  border: 1.5px solid rgba(0,0,0,.07);
  box-shadow: 0 3px 14px rgba(0,0,0,.05);
  margin-bottom: 16px;
}
.la-quiz .la-prompt { font-size: 15px; font-weight: 600; color: #1c1c1c; margin-bottom: 12px; }
.la-quiz .la-arabic {
  font-family: "Noto Naskh Arabic","Amiri",serif;
  font-size: 2.5rem;
  color: #1f7a63;
  text-align: center;
  line-height: 2;
  margin-bottom: 14px;
}
.la-quiz .la-question ol { list-style: upper-alpha; margin-bottom: 0; font-size: 14px; }
.la-quiz .la-question ol li { padding: 3px 0; }
.la-quiz-messages { display: none; }
.la-quiz-links a { margin-right: 14px; }
.la-quiz.la-quiz-ready > .la-question,
.la-quiz.la-quiz-ready > .la-quiz-links { display: none; }
.la-quiz-box { margin-bottom: 16px; }
.la-quiz-box .la-opt:disabled { cursor: default; opacity: 1; color: inherit; }
.la-quiz-box .la-opt:disabled:hover { border-color: #e5e7eb; background: #f9fafb; }
.la-quiz-box .la-opt.correct:disabled,
.la-quiz-box .la-opt.correct:disabled:hover { border-color: #22c55e; background: #f0fdf4; color: #15803d; }
.la-quiz-box .la-opt.wrong:disabled,
.la-quiz-box .la-opt.wrong:disabled:hover { border-color: #ef4444; background: #fef2f2; color: #dc2626; }
.la-opt-letter {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #e5e7eb;
  color: #374151;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}
.la-quiz-feedback { font-size: 13px; font-weight: 600; min-height: 20px; margin-top: 4px; }
.la-quiz-feedback.correct { color: #15803d; }
.la-quiz-feedback.wrong { color: #dc2626; }
.la-quiz-result { margin-bottom: 16px; }
.la-quiz-result .score-icon { font-size: 3rem; line-height: 1.2; }
.la-quiz-result .score-detail { font-size: 13px; opacity: .85; margin-bottom: 16px; }
