/* hapooalKabool — wizard quiz CSS (inherits Estaba tokens) */
@import url('https://fonts.googleapis.com/css2?family=Rubik:wght@300;400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Heebo:wght@400;500;700;800&display=swap');

/* === TOKENS === */
:root {
  --moe-blue:       #004d99;
  --moe-cyan:       #009eb3;
  --moe-accent:     #ffb300;
  --moe-light-blue: #e6f0fa;
  --white:          #ffffff;
  --bg:             #f0f4f8;
  --card-bg:        #ffffff;
  --border:         #d0daea;
  --text-dark:      #1a2742;
  --text-muted:     #64748b;
  --success:        #16a34a;
  --danger:         #dc2626;
  --transition:     all 0.22s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: 'Rubik', sans-serif;
  background: var(--bg);
  direction: rtl;
  color: var(--text-dark);
}

/* === HEADER === */
.quiz-header {
  background: linear-gradient(135deg, var(--moe-blue) 0%, #0066cc 60%, var(--moe-cyan) 100%);
  color: var(--white);
  padding: 14px 24px 10px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(0,77,153,0.25);
}
.quiz-header-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 860px;
  margin: 0 auto;
}
.quiz-title {
  font-family: 'Heebo', sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  margin: 0;
}
.quiz-subtitle {
  font-size: 0.78rem;
  opacity: 0.85;
  margin: 2px 0 0;
}
.quiz-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 20px;
  padding: 3px 11px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}
.progress-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  max-width: 860px;
  margin-left: auto;
  margin-right: auto;
}
.progress-track {
  flex: 1;
  height: 6px;
  background: rgba(255,255,255,0.25);
  border-radius: 3px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--moe-accent);
  border-radius: 3px;
  transition: width 0.4s ease;
  width: 4%;
}
.progress-label {
  font-size: 0.75rem;
  white-space: nowrap;
  opacity: 0.9;
}

/* === MAIN === */
.quiz-main {
  max-width: 860px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}

/* === PART BADGE === */
.part-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.part-badge {
  background: var(--moe-blue);
  color: var(--white);
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 0.8rem;
  font-weight: 700;
}
.part-pts {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* === QUESTION CARD === */
.q-card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 24px 26px;
  box-shadow: 0 4px 24px rgba(0,77,153,0.09);
  border-right: 5px solid var(--moe-cyan);
  animation: slideIn 0.28s ease;
  margin-bottom: 16px;
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(18px); }
  to   { opacity: 1; transform: translateX(0); }
}
.q-num {
  font-size: 0.78rem;
  color: var(--moe-cyan);
  font-weight: 700;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.q-text {
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.7;
  color: var(--text-dark);
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px dashed var(--border);
}
.q-text strong { color: var(--moe-blue); font-size: 1.15rem; }

/* === SUB-QUESTIONS (3 fields) === */
.sub-q { margin-bottom: 16px; }
.sub-q-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 6px;
  line-height: 1.5;
}
.text-in {
  width: 100%;
  max-width: 320px;
  padding: 9px 13px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: 'Rubik', sans-serif;
  direction: rtl;
  transition: var(--transition);
  background: var(--bg);
}
.text-in:focus {
  outline: none;
  border-color: var(--moe-cyan);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(0,158,179,0.12);
}
.text-in:disabled { background: #f1f5f9; cursor: not-allowed; color: var(--text-muted); }
.text-in.in-correct { border-color: var(--success); background: #dcfce7; }
.text-in.in-wrong   { border-color: var(--danger);  background: #fee2e2; }

/* === NOTICE BAR === */
.notice-bar {
  background: linear-gradient(90deg, #fff8e1, #fffde7);
  border: 1px solid #ffc107;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 0.82rem;
  color: #7c5c00;
  margin-bottom: 12px;
  display: none;
}
.notice-bar.visible { display: block; }

/* === NAVIGATION === */
.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
}
.btn-nav {
  background: var(--moe-blue);
  color: var(--white);
  border: none;
  border-radius: 24px;
  padding: 10px 22px;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: 'Rubik', sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: var(--transition);
}
.btn-nav:hover:not(:disabled) { background: var(--moe-cyan); transform: translateY(-1px); }
.btn-nav:disabled { opacity: 0.4; cursor: not-allowed; }
.nav-counter { font-size: 0.85rem; color: var(--text-muted); font-weight: 600; }

/* === FINISH === */
.finish-row { text-align: center; margin-top: 14px; }
.btn-finish {
  background: linear-gradient(135deg, var(--moe-blue), var(--moe-cyan));
  color: var(--white);
  border: none;
  border-radius: 28px;
  padding: 13px 36px;
  font-size: 1rem;
  font-weight: 700;
  font-family: 'Rubik', sans-serif;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 18px rgba(0,77,153,0.3);
}
.btn-finish:hover { transform: translateY(-2px); box-shadow: 0 6px 22px rgba(0,77,153,0.4); }

/* === SCORE MODAL === */
.score-panel { border-radius: 20px; border: none; overflow: hidden; }
.score-mhead {
  background: linear-gradient(135deg, var(--moe-blue), var(--moe-cyan));
  padding: 20px;
  text-align: center;
  color: var(--white);
}
.score-emoji { font-size: 2.8rem; }
.score-mhead h4 { font-family: 'Heebo',sans-serif; font-weight: 800; font-size: 1.3rem; margin-top: 6px; }
.score-number { font-size: 4rem; font-weight: 800; font-family: 'Heebo',sans-serif; color: var(--moe-blue); text-align: center; line-height: 1; }
.score-of { text-align: center; color: var(--text-muted); font-size: 0.85rem; margin: 4px 0 18px; }
.score-rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.score-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 14px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 500;
}
.score-row.r1 { background: rgba(0,77,153,0.07); }
.score-row.r2 { background: rgba(0,158,179,0.07); }
.score-row .val { font-weight: 700; color: var(--moe-blue); }
.score-actions { display: flex; gap: 10px; justify-content: center; }
.btn-review-ans {
  background: var(--moe-light-blue); color: var(--moe-blue); border: none;
  border-radius: 22px; padding: 9px 20px; font-weight: 600;
  font-family: 'Rubik',sans-serif; font-size: 0.88rem; cursor: pointer;
  transition: var(--transition);
}
.btn-review-ans:hover { background: var(--moe-blue); color: var(--white); }
.btn-retry-exam {
  background: var(--moe-blue); color: var(--white); border: none;
  border-radius: 22px; padding: 9px 20px; font-weight: 600;
  font-family: 'Rubik',sans-serif; font-size: 0.88rem; cursor: pointer;
  transition: var(--transition);
}
.btn-retry-exam:hover { background: var(--moe-cyan); }

/* === CONFIRM MODAL === */
.confirm-panel { border-radius: 16px; border: none; padding: 28px 24px 24px; text-align: center; box-shadow: 0 20px 60px rgba(0,77,153,0.2); }
.confirm-icon { font-size: 2.5rem; margin-bottom: 12px; }
.confirm-title { font-family: 'Heebo',sans-serif; font-weight: 800; font-size: 1.2rem; color: var(--text-dark); margin-bottom: 10px; }
.confirm-msg { font-size: 0.9rem; color: var(--text-muted); line-height: 1.6; margin-bottom: 22px; }
.confirm-actions { display: flex; gap: 10px; justify-content: center; }
.btn-confirm-cancel {
  background: var(--white); border: 2px solid var(--border); color: var(--text-muted);
  border-radius: 22px; padding: 9px 20px; font-weight: 600; font-family: 'Rubik',sans-serif;
  font-size: 0.88rem; cursor: pointer; transition: var(--transition);
}
.btn-confirm-cancel:hover { border-color: var(--moe-blue); color: var(--moe-blue); }
.btn-confirm-ok {
  background: var(--moe-blue); border: 2px solid var(--moe-blue); color: var(--white);
  border-radius: 22px; padding: 9px 20px; font-weight: 600; font-family: 'Rubik',sans-serif;
  font-size: 0.88rem; cursor: pointer; transition: var(--transition);
}
.btn-confirm-ok:hover { background: var(--moe-cyan); border-color: var(--moe-cyan); }

/* === FB === */
.fb-icon { display: inline-block; vertical-align: middle; margin-right: 4px; }

/* === RESPONSIVE === */
@media (max-width: 580px) {
  .quiz-title { font-size: 1rem; }
  .q-card { padding: 16px; }
  .q-text { font-size: 0.95rem; }
  .text-in { max-width: 100%; }
}
