/* نمط Duolingo - light theme متناسق مع شعار ناموس */

.learn-app {
  min-height: 100vh;
  display: flex; flex-direction: column;
  position: relative;
}

/* ============ TOP BAR ============ */
.learn-topbar {
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid var(--border);
  padding: 12px 20px;
  display: flex; align-items: center; gap: 10px;
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.brand-mini {
  margin-left: auto;
  display: flex; align-items: center;
}
.brand-mini img { height: 30px; width: auto; }

.stat-chip {
  display: flex; align-items: center; gap: 6px;
  background: var(--surface);
  padding: 8px 12px; border-radius: var(--radius);
  font-weight: 800; font-size: 14px;
  border: 1px solid var(--border);
  color: var(--text);
}
.stat-chip svg { width: 18px; height: 18px; }
.stat-chip.streak {
  color: var(--amber);
  border-color: rgba(245, 158, 11, 0.25);
  background: #FFFBEB;
}
.stat-chip.streak svg { color: var(--amber); }
.stat-chip.hearts {
  color: var(--red);
  border-color: rgba(220, 38, 38, 0.25);
  background: #FEF2F2;
}
.stat-chip.hearts svg { color: var(--red); fill: var(--red); }
.stat-chip.xp {
  color: var(--primary);
  border-color: var(--primary-pale);
  background: var(--primary-paler);
}
.stat-chip.xp svg { color: var(--primary); }

/* ============ DAILY GOAL ============ */
.goal-banner {
  background: var(--primary);
  margin: 18px 20px 0;
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  display: flex; align-items: center; gap: 16px;
  color: #fff;
  box-shadow: 0 8px 24px rgba(79, 60, 217, 0.25);
}
.goal-icon {
  background: rgba(255, 255, 255, 0.2);
  width: 48px; height: 48px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: var(--gold-light);
}
.goal-icon svg { width: 24px; height: 24px; }
.goal-text { flex: 1; }
.goal-title { font-size: 13px; opacity: 0.9; margin-bottom: 4px; }
.goal-progress { font-weight: 800; font-size: 16px; }
.goal-bar {
  height: 8px; background: rgba(0, 0, 0, 0.18); border-radius: 4px;
  overflow: hidden; margin-top: 6px;
}
.goal-bar-fill {
  height: 100%; background: var(--gold-light);
  border-radius: 4px; transition: width .4s;
}

/* ============ UNITS MAP ============ */
.units-container {
  max-width: 540px;
  margin: 0 auto;
  padding: 24px 16px 60px;
  width: 100%;
}

.unit { margin-bottom: 36px; }
.unit-header {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex; align-items: center; gap: 14px;
  border: 1px solid var(--border);
  margin-bottom: 22px;
  position: relative; overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.unit-header.locked { opacity: 0.55; }
.unit-header.locked::after {
  content: '🔒'; position: absolute; left: 16px; top: 50%;
  transform: translateY(-50%); font-size: 24px;
}
.unit-emoji {
  font-size: 38px;
  background: var(--primary-pale);
  width: 64px; height: 64px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.unit-info { flex: 1; }
.unit-title { font-size: 19px; font-weight: 800; margin-bottom: 4px; color: var(--text); }
.unit-meta { font-size: 13px; color: var(--text-2); }

/* ============ SKILL TREE ============ */
.skills-path {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}

.skill-node {
  position: relative;
  display: flex; flex-direction: column; align-items: center;
  margin-bottom: 8px;
}
.skill-node::before {
  content: ''; position: absolute; top: -10px;
  width: 4px; height: 14px;
  background: var(--border-dark); border-radius: 2px;
}
.skill-node:first-child::before { display: none; }

/* Zigzag */
.skill-node:nth-child(2n) { transform: translateX(40px); }
.skill-node:nth-child(2n+1) { transform: translateX(-40px); }
.skill-node:nth-child(3n) { transform: translateX(0); }

.skill-circle {
  width: 100px; height: 100px; border-radius: 50%;
  background: var(--surface);
  border: 3px solid var(--border);
  border-bottom: 6px solid var(--border-dark);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all .15s;
  position: relative;
  text-align: center;
  padding: 4px;
  color: var(--text-dim);
}
.skill-circle:hover:not(.locked) { transform: translateY(2px); border-bottom-width: 3px; }
.skill-circle.active {
  border-color: var(--primary);
  border-bottom-color: var(--primary-deep);
  background: var(--primary);
  color: #fff;
  box-shadow: 0 6px 20px rgba(79, 60, 217, 0.25);
}
.skill-circle.completed {
  border-color: var(--gold);
  border-bottom-color: var(--gold-deep);
  background: var(--gold);
  color: #fff;
}
.skill-circle.locked {
  cursor: not-allowed;
  background: var(--surface-2);
  border-color: var(--border);
}
.skill-circle.locked .skill-icon { opacity: 0.4; }

.skill-icon { margin-bottom: 4px; }
.skill-icon svg { width: 36px; height: 36px; }

.skill-label {
  font-size: 11px; font-weight: 800;
  line-height: 1.2;
}

.skill-crown {
  position: absolute; top: -10px; right: -8px;
  background: var(--gold); color: #fff;
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 11px;
  border: 3px solid var(--bg);
  font-family: monospace;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}
.skill-name {
  font-size: 13px; font-weight: 700;
  color: var(--text); margin-top: 10px;
  text-align: center; max-width: 140px;
}
.skill-progress {
  font-size: 11px; color: var(--text-2);
  margin-top: 2px; font-weight: 600;
}

/* ============ LESSON START POPUP ============ */
.lesson-popup-backdrop {
  position: fixed; inset: 0;
  background: rgba(26, 26, 46, 0.5);
  display: none; align-items: center; justify-content: center;
  z-index: 100;
  padding: 20px;
  backdrop-filter: blur(4px);
}
.lesson-popup-backdrop.show { display: flex; }
.lesson-popup {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 30px;
  max-width: 400px;
  width: 100%;
  text-align: center;
  border: 1px solid var(--border);
  animation: popIn .25s;
  box-shadow: var(--shadow-lg);
}
@keyframes popIn {
  from { opacity: 0; transform: scale(0.92);}
  to { opacity: 1; transform: scale(1);}
}
.popup-emoji { font-size: 56px; margin-bottom: 10px; }
.popup-title { font-size: 22px; font-weight: 800; margin-bottom: 8px; color: var(--text); }
.popup-sub { color: var(--text-2); font-size: 14px; margin-bottom: 18px; }
.popup-actions { display: flex; gap: 10px; }

/* ============ LESSON PAGE ============ */
.lesson-app {
  min-height: 100vh;
  display: flex; flex-direction: column;
  max-width: 620px; margin: 0 auto;
  width: 100%;
}

.lesson-topbar {
  padding: 14px 20px;
  display: flex; align-items: center; gap: 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.btn-icon {
  background: transparent; border: none;
  color: var(--text-2); cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}
.btn-icon:hover { background: var(--surface-2); color: var(--text); }
.btn-icon svg { width: 24px; height: 24px; }

.lesson-progress-bar {
  flex: 1;
  height: 14px;
  background: var(--border);
  border-radius: 7px;
  overflow: hidden;
  position: relative;
}
.lesson-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: 7px;
  transition: width .4s cubic-bezier(0.4, 0, 0.2, 1);
}

.lesson-content {
  flex: 1;
  padding: 30px 24px;
  display: flex; flex-direction: column;
  gap: 20px;
}

.lesson-q-label {
  font-size: 13px; color: var(--text-2);
  font-weight: 800; text-transform: uppercase; letter-spacing: 1px;
}

.lesson-q-text {
  font-size: 24px; font-weight: 800; line-height: 1.5; color: var(--text);
}

.lesson-options {
  display: flex; flex-direction: column; gap: 12px;
  margin-top: 14px;
}

.lesson-option {
  background: var(--surface);
  border: 2px solid var(--border);
  border-bottom: 4px solid var(--border-dark);
  border-radius: var(--radius);
  padding: 18px 16px;
  font-family: inherit; font-size: 16px; font-weight: 700;
  color: var(--text);
  cursor: pointer;
  text-align: right;
  display: flex; gap: 12px; align-items: center;
  transition: all .12s;
}
.lesson-option:active:not(:disabled) { transform: translateY(2px); border-bottom-width: 2px; }
.lesson-option:hover:not(:disabled):not(.selected) {
  background: var(--primary-paler);
  border-color: var(--primary-soft);
}
.lesson-option .opt-letter {
  background: var(--surface-2); color: var(--text-2);
  width: 34px; height: 34px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; flex-shrink: 0;
  border: 2px solid var(--border);
}
.lesson-option.selected {
  background: var(--primary-pale);
  border-color: var(--primary);
  border-bottom-color: var(--primary-deep);
}
.lesson-option.selected .opt-letter {
  background: var(--primary); color: #fff;
  border-color: var(--primary-deep);
}
.lesson-option.correct {
  background: var(--green-pale);
  border-color: var(--green);
  border-bottom-color: var(--green-deep);
}
.lesson-option.correct .opt-letter { background: var(--green); color: #fff; border-color: var(--green-deep); }
.lesson-option.wrong {
  background: var(--red-pale);
  border-color: var(--red);
  border-bottom-color: #991B1B;
}
.lesson-option.wrong .opt-letter { background: var(--red); color: #fff; border-color: #991B1B; }
.lesson-option:disabled { cursor: default; }

/* Lesson footer */
.lesson-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 20px;
}

.feedback-bar {
  padding: 16px 20px;
  border-radius: var(--radius);
  margin-bottom: 14px;
  display: flex; align-items: flex-start; gap: 14px;
  animation: slideUp .25s;
}
@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.feedback-bar.correct {
  background: var(--green-pale);
  border: 2px solid var(--green);
}
.feedback-bar.wrong {
  background: var(--red-pale);
  border: 2px solid var(--red);
}
.feedback-icon-circle {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-weight: 800;
  color: #fff;
}
.feedback-bar.correct .feedback-icon-circle { background: var(--green); }
.feedback-bar.wrong .feedback-icon-circle { background: var(--red); }
.feedback-text { flex: 1; }
.feedback-heading { font-weight: 800; font-size: 17px; margin-bottom: 4px; }
.feedback-bar.correct .feedback-heading { color: var(--green-deep); }
.feedback-bar.wrong .feedback-heading { color: var(--red); }
.feedback-explain { color: var(--text); font-size: 14px; line-height: 1.6; }

.btn-check {
  width: 100%;
  background: var(--primary);
  color: #fff;
  border: none;
  border-bottom: 4px solid var(--primary-deep);
  padding: 16px;
  border-radius: var(--radius);
  font-family: inherit; font-size: 16px; font-weight: 800;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all .1s;
}
.btn-check:active { transform: translateY(2px); border-bottom-width: 2px; }
.btn-check:disabled {
  background: var(--surface-2);
  color: var(--text-dim);
  border-bottom-color: var(--border);
  cursor: not-allowed;
}
.btn-check.continue {
  background: var(--green);
  border-bottom-color: var(--green-deep);
}
.btn-check.wrong-continue {
  background: var(--red);
  border-bottom-color: #991B1B;
}

/* ============ LESSON COMPLETE ============ */
.lesson-done {
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 30px 20px;
  text-align: center;
  gap: 24px;
}
.done-trophy {
  font-size: 100px;
  animation: bounce 1s ease infinite alternate;
}
@keyframes bounce {
  from { transform: translateY(0); }
  to { transform: translateY(-12px); }
}
.done-title {
  font-size: 32px; font-weight: 800;
  color: var(--primary);
}
.done-stats {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  width: 100%; max-width: 460px;
}
.done-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 12px;
  box-shadow: var(--shadow-sm);
}
.done-stat-label { font-size: 11px; color: var(--text-2); text-transform: uppercase; margin-bottom: 6px; font-weight: 800; }
.done-stat-value { font-size: 24px; font-weight: 800; }
.done-stat.xp .done-stat-value { color: var(--primary); }
.done-stat.time .done-stat-value { color: var(--gold-deep); }
.done-stat.accuracy .done-stat-value { color: var(--green-deep); }

/* ============ NO HEARTS ============ */
.broken-heart { font-size: 70px; margin-bottom: 14px; }
.refill-time {
  background: var(--red-pale);
  border: 1px solid rgba(220, 38, 38, 0.3);
  border-radius: var(--radius);
  padding: 10px 16px;
  font-size: 14px;
  color: var(--red);
  margin: 14px 0;
  font-weight: 600;
}

@media (max-width: 480px) {
  .skill-circle { width: 88px; height: 88px; }
  .lesson-q-text { font-size: 20px; }
  .units-container { padding: 16px 12px 60px; }
}
