/* ════════════════════════════════════════════════════════════════
   قسم الإنترفيو — تصميم v2 (نهاري/ليلي)
   كل الـ selectors هنا مقيّدة بـ .ivx / .ivx-* عشان مايأثرش على باقي الموقع.
   الوضع الليلي بيتفعّل من body.dark-mode (نفس آلية الموقع).
   الـ markup: index.html (#interview-screen و #iv-sim-overlay)
   الـ logic:  js/features/callcenter/interview-sim.js
   ════════════════════════════════════════════════════════════════ */

.ivx {
  --bg: #EEF0F8; --card: #FFFFFF; --c2: #F5F6FC; --bd: #E1E4F2;
  --tx: #1C1C2E; --mu: #565C75; --ac: #6C63FF; --acx: #4834D4; --acon: #FFFFFF;
  --ok: #007A62; --okb: #DDF5EE; --gd: #8A5A00; --gdb: #FFF1CC;
  --rd: #C8000A; --rdb: #FDE8EA; --tr: #E3E6F4;
  --sh: 0 4px 24px rgba(28, 28, 46, .08);
  font-family: Cairo, sans-serif;
  color: var(--tx);
  direction: rtl;
  text-align: right;
}
body.dark-mode .ivx {
  --bg: #05070F; --card: #111827; --c2: #141D2E; --bd: rgba(255, 255, 255, .09);
  --tx: #DDE3F8; --mu: #8393B5; --ac: #7C6AFF; --acx: #7C6AFF; --acon: #05070F;
  --ok: #00D68F; --okb: rgba(0, 214, 143, .12); --gd: #FFC947; --gdb: rgba(255, 201, 71, .12);
  --rd: #FF3D57; --rdb: rgba(255, 61, 87, .12); --tr: rgba(255, 255, 255, .08);
  --sh: 0 8px 32px rgba(0, 0, 0, .6);
}
.ivx *, .ivx *::before, .ivx *::after { box-sizing: border-box; }
.ivx button { font-family: Cairo, sans-serif; }
.ivx [hidden] { display: none !important; }
.ivx-fade { animation: ivxFade .28s ease both; }
@keyframes ivxFade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .ivx-fade { animation: none; } }

/* ── عناصر مشتركة ── */
.ivx-card { background: var(--card); border: 1px solid var(--bd); border-radius: 22px; box-shadow: var(--sh); }
.ivx-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ivx-mu { color: var(--mu); font-size: 13px; line-height: 1.8; }
.ivx-pill { display: inline-block; border-radius: 999px; padding: 4px 12px; font-size: 12px; font-weight: 800; white-space: nowrap; line-height: 1.6; }
.ivx-pill.ok { background: var(--okb); color: var(--ok); }
.ivx-pill.gd { background: var(--gdb); color: var(--gd); }
.ivx-pill.rd { background: var(--rdb); color: var(--rd); }
.ivx-pill.mu { background: var(--c2); color: var(--mu); border: 1px solid var(--bd); }
.ivx-btn {
  border: 0; border-radius: 14px; font-weight: 800; font-size: 14px; min-height: 44px;
  cursor: pointer; padding: 0 18px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .12s ease, opacity .15s ease; -webkit-tap-highlight-color: transparent;
}
.ivx-btn:active { transform: scale(.98); }
.ivx-btn:focus-visible, .ivx-tab:focus-visible, .ivx-chip:focus-visible, .ivx-opt:focus-visible { outline: 3px solid var(--ac); outline-offset: 2px; }
.ivx-btn.pr { background: var(--acx); color: var(--acon); }
.ivx-btn.gh { background: var(--c2); color: var(--tx); border: 1px solid var(--bd); }
.ivx-btn.gold { background: #FFD66B; color: #1C1C2E; }
.ivx-btn.block { width: 100%; }
.ivx-btn.big { min-height: 54px; font-size: 16px; border-radius: 16px; }
.ivx-logo {
  width: 46px; height: 46px; border-radius: 14px; display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 17px; color: #fff; flex: none; letter-spacing: -.5px; font-family: Cairo, sans-serif;
}
/* شريط التقدّم المقسّم لـ 8 أجزاء */
.ivx-sg { position: relative; height: 7px; border-radius: 4px; overflow: hidden; background: var(--tr); }
.ivx-sg > i { position: absolute; top: 0; bottom: 0; right: 0; display: block; }
.ivx-sg::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(to left, transparent 0 10.5%, var(--card) 10.5% 12.5%); }
.ivx-dots { display: inline-flex; align-items: center; gap: 4px; vertical-align: middle; }
.ivx-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--tr); }
.ivx-dot.on { background: var(--ac); }

/* ════ الشاشة الرئيسية ════ */
.ivx-main { display: flex; flex-direction: column; gap: 24px; padding: 4px 0 24px; max-width: 1180px; margin: 0 auto; }
.ivx-top { display: grid; grid-template-columns: 1.45fr 1fr; gap: 24px; }
.ivx-hero {
  background: linear-gradient(135deg, #12002E, #4C1D95); color: #fff; border-radius: 28px; padding: 40px;
  display: flex; flex-direction: column; gap: 20px; position: relative; overflow: hidden; min-width: 0;
}
.ivx-hero::before { content: ""; position: absolute; top: -90px; left: -70px; width: 300px; height: 300px; border-radius: 50%; background: rgba(255, 255, 255, .07); pointer-events: none; }
.ivx-hero::after { content: ""; position: absolute; bottom: -120px; left: 180px; width: 240px; height: 240px; border-radius: 50%; background: rgba(255, 186, 0, .12); pointer-events: none; }
.ivx-hero > * { position: relative; z-index: 1; }
.ivx-kicker { font-size: 13px; font-weight: 800; color: #FFD66B; }
.ivx-h1 { margin: 0; font-size: 40px; line-height: 1.4; font-weight: 900; max-width: 560px; color: #fff; }
.ivx-resume { background: rgba(255, 255, 255, .10); border: 1px solid rgba(255, 255, 255, .18); border-radius: 22px; padding: 16px 20px; display: flex; align-items: center; gap: 18px; }
.ivx-resume svg { flex: none; }
.ivx-resume-body { flex: 1; min-width: 0; }
.ivx-resume-lbl { font-size: 12.5px; color: #D8CCFF; }
.ivx-resume-name { font-size: 21px; font-weight: 800; line-height: 1.5; overflow-wrap: anywhere; }
.ivx-resume-sub { font-size: 13px; color: #D8CCFF; line-height: 1.7; }
.ivx-resume .ivx-btn { min-height: 48px; padding: 0 28px; }
.ivx-stats { display: flex; gap: 34px; flex-wrap: wrap; }
.ivx-stat-n { font-size: 30px; font-weight: 900; line-height: 1.4; }
.ivx-stat-n small { font-size: 16px; opacity: .7; font-weight: 800; }
.ivx-stat-l { font-size: 12.5px; color: #D8CCFF; }

.ivx-ready { padding: 28px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.ivx-ttl { font-weight: 800; font-size: 17px; }
.ivx-radar { display: flex; align-items: center; justify-content: center; flex: 1; }
.ivx-radar svg { width: 100%; max-width: 300px; height: auto; }
.ivx-empty-note { text-align: center; padding: 8px 12px; }

.ivx-journey { padding: 22px 28px; display: flex; flex-direction: column; gap: 16px; }
.ivx-steps { display: flex; align-items: center; }
.ivx-step { display: flex; align-items: center; flex: 1; }
.ivx-step:last-child { flex: 0; }
.ivx-node {
  width: 44px; height: 44px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center;
  font-weight: 900; background: var(--c2); color: var(--mu); border: 1px solid var(--bd);
}
.ivx-node.on { background: var(--ok); color: var(--acon); border-color: var(--ok); }
.ivx-link { flex: 1; height: 6px; background: var(--tr); margin: 0 6px; border-radius: 4px; overflow: hidden; position: relative; }
.ivx-link > i { position: absolute; top: 0; bottom: 0; right: 0; background: linear-gradient(to left, var(--ok), var(--ok)); border-radius: 4px; }
.ivx-lbls { display: flex; justify-content: space-between; gap: 6px; }
.ivx-lbls span { font-size: 13px; color: var(--mu); line-height: 1.6; }

.ivx-bar { display: flex; gap: 12px; flex-wrap: wrap; align-items: stretch; }
.ivx-tabs { display: flex; gap: 12px; overflow-x: auto; padding: 2px; margin: -2px; flex: 1; min-width: 0; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.ivx-tabs::-webkit-scrollbar { display: none; }
.ivx-tab {
  border: 1px solid var(--bd); background: var(--card); color: var(--tx); border-radius: 16px; padding: 10px 16px; min-width: 130px;
  text-align: right; cursor: pointer; display: flex; flex-direction: column; gap: 6px; flex: 0 0 auto;
}
.ivx-tab.on { border-color: var(--ac); }
.ivx-tab b { font-weight: 800; font-size: 15px; }
.ivx-tab span { font-size: 12px; color: var(--mu); }
.ivx-tab .ivx-sg { height: 5px; }
.ivx-search {
  display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--bd); border-radius: 16px;
  padding: 0 16px; min-height: 60px; min-width: 240px; margin-right: auto;
}
.ivx-search:focus-within { border-color: var(--ac); }
.ivx-search svg { flex: none; }
.ivx-search input { border: 0; outline: 0; background: transparent; color: var(--tx); font-family: Cairo, sans-serif; font-size: 15px; flex: 1; min-width: 0; width: 100%; padding: 0; margin: 0; box-shadow: none; }
.ivx-search input::placeholder { color: var(--mu); opacity: .8; }

.ivx-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.ivx-co { overflow: hidden; display: flex; flex-direction: column; cursor: pointer; transition: transform .15s ease, border-color .15s ease; }
.ivx-co:hover { transform: translateY(-2px); }
.ivx-co.cur { border-color: var(--ac); }
.ivx-co-bar { height: 5px; flex: none; }
.ivx-co-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 14px; flex: 1; }
.ivx-co-name { font-weight: 800; font-size: 18px; color: var(--tx); line-height: 1.4; }
.ivx-co-role { overflow-wrap: anywhere; }
.ivx-co .ivx-btn { margin-top: auto; }
.ivx-none { text-align: center; padding: 28px 12px; }

.ivx-guide h3 { font-size: 16px; font-weight: 900; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; color: var(--tx); }
.iv2-acc-item { background: var(--card); border: 1px solid var(--bd); border-radius: 18px; margin-bottom: 10px; box-shadow: var(--sh); overflow: hidden; }
.iv2-acc-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; cursor: pointer; user-select: none; }
.iv2-acc-icon { font-size: 22px; }
.iv2-acc-title { flex: 1; font-weight: 800; font-size: 14.5px; color: var(--tx); }
.iv2-acc-chevron { font-size: 14px; color: var(--ac); transition: transform .25s; display: inline-block; }
.iv2-acc-chevron.iv2-open { transform: rotate(180deg); }
.iv2-acc-body { max-height: 0; overflow: hidden; transition: max-height .3s ease; padding: 0 18px; }
.iv2-acc-body.iv2-open { max-height: 420px; }
.iv2-acc-body-inner { font-size: 13px; color: var(--mu); line-height: 1.9; padding: 0 2px 16px; }
.iv2-acc-body-inner b { color: var(--tx); }
.ivx-foot { border-top: 1px solid var(--bd); padding-top: 16px; }

/* ════ الأوفرلاي (قبل ما تبدأ / السؤال / النتيجة) ════ */
.ivx-overlay { background-color: var(--bg); }
body.dark-mode .ivx-overlay {
  background-image: radial-gradient(ellipse 90% 55% at 8% -8%, rgba(124, 106, 255, .16) 0, transparent 55%), radial-gradient(ellipse 70% 50% at 92% 95%, rgba(255, 61, 87, .09) 0, transparent 50%);
}
.ivx-sheet {
  max-width: 560px; margin: 0 auto; min-height: 100%; padding: 20px 20px calc(28px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; gap: 14px;
}
.ivx-sheet-body { display: flex; flex-direction: column; gap: 14px; flex: 1; }
.ivx-icon-btn { width: 44px; padding: 0; flex: none; }
.ivx-head-t { font-weight: 800; font-size: 15px; text-align: center; flex: 1; }
.ivx-bigcard {
  background: linear-gradient(135deg, #12002E, #4C1D95); color: #fff; border-radius: 26px; padding: 22px;
  display: flex; flex-direction: column; gap: 14px; position: relative; overflow: hidden;
}
.ivx-bigcard::before { content: ""; position: absolute; top: -60px; left: -40px; width: 180px; height: 180px; border-radius: 50%; background: rgba(255, 255, 255, .08); pointer-events: none; }
.ivx-bigcard > * { position: relative; }
.ivx-bigcard .ivx-logo { width: 58px; height: 58px; font-size: 22px; }
.ivx-bigcard-name { font-weight: 900; font-size: 24px; line-height: 1.4; }
.ivx-bigcard-role { font-size: 13px; color: #D8CCFF; direction: ltr; text-align: right; }
.ivx-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.ivx-chips .ivx-pill { background: rgba(255, 255, 255, .14); }
.ivx-chips .ivx-pill.lvl { background: rgba(255, 214, 107, .2); color: #FFD66B; }
.ivx-sec { padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.ivx-sec-t { font-weight: 800; font-size: 15px; }
.ivx-sec-t.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ivx-p { font-size: 14px; line-height: 1.9; color: var(--tx); margin: 0; }
.ivx-p.de { direction: ltr; text-align: left; }
.ivx-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ivx-fact { background: var(--c2); border: 1px solid var(--bd); border-radius: 14px; padding: 10px; text-align: center; min-width: 0; }
.ivx-fact div:first-child { color: var(--mu); font-size: 11.5px; }
.ivx-fact div:last-child { font-weight: 800; font-size: 13px; margin-top: 2px; line-height: 1.5; }
.ivx-wchips { display: flex; flex-wrap: wrap; gap: 8px; }
.ivx-chip {
  background: var(--c2); border: 1px solid var(--bd); border-radius: 18px; padding: 8px 14px; font-size: 13px; color: var(--tx);
  cursor: pointer; display: inline-flex; flex-direction: column; align-items: center; gap: 0; line-height: 1.5;
}
.ivx-chip span { direction: ltr; font-weight: 700; }
.ivx-chip small { color: var(--mu); font-size: 11.5px; }
.ivx-chip:active { transform: scale(.97); }
.ivx-tip { display: flex; gap: 10px; font-size: 14px; line-height: 1.8; }
.ivx-tip b { color: var(--ok); font-weight: 900; flex: none; }
.ivx-cta { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding-top: 6px; }
.ivx-cta .ivx-mu { text-align: center; font-size: 12px; }

/* السؤال */
.ivx-qtop { display: flex; align-items: center; gap: 12px; }
.ivx-segs { flex: 1; display: flex; gap: 5px; }
.ivx-segs span { flex: 1; height: 6px; border-radius: 4px; background: var(--tr); transition: background .25s; }
.ivx-segs span.ok { background: var(--ok); }
.ivx-segs span.bad { background: var(--rd); }
.ivx-segs span.cur { background: var(--ac); }
.ivx-score { font-weight: 800; font-size: 13px; color: var(--gd); background: var(--gdb); border-radius: 999px; padding: 6px 12px; white-space: nowrap; }
.ivx-hr { display: flex; gap: 12px; align-items: flex-start; }
.ivx-hr .ivx-logo { border-radius: 50%; background: var(--c2); color: var(--acx); border: 1px solid var(--bd); }
.ivx-bubble { border-radius: 6px 22px 22px 22px; padding: 16px; display: flex; flex-direction: column; gap: 10px; flex: 1; min-width: 0; align-items: stretch; }
.ivx-bubble .ivx-btn { align-self: flex-start; font-size: 13px; }
.ivx-qde { direction: ltr; font-size: 16px; line-height: 1.7; font-weight: 700; text-align: left; overflow-wrap: anywhere; }
.ivx-opts { display: flex; flex-direction: column; gap: 12px; }
.ivx-opt {
  width: 100%; display: block; border-radius: 18px; padding: 16px; font-size: 14.5px; line-height: 1.8; border: 1px solid var(--bd);
  background: var(--card); color: var(--tx); cursor: pointer; text-align: right; transition: border-color .15s, background .15s, opacity .2s;
}
.ivx-opt:not(:disabled):hover { border-color: var(--ac); }
.ivx-opt .de { display: block; direction: ltr; text-align: left; color: var(--tx); overflow-wrap: anywhere; }
.ivx-opt .ar { display: block; font-size: 12.5px; color: var(--mu); margin-top: 2px; line-height: 1.7; }
.ivx-opt:disabled { cursor: default; }
.ivx-opt.good { border: 2px solid var(--ok); background: var(--okb); padding: 15px; }
.ivx-opt.bad { border: 2px solid var(--rd); background: var(--rdb); padding: 15px; }
.ivx-opt.dim { opacity: .6; }
.ivx-opt .tag { display: block; font-size: 12.5px; font-weight: 800; margin-top: 6px; }
.ivx-opt.good .tag { color: var(--ok); }
.ivx-opt.bad .tag { color: var(--rd); }
.ivx-fb { padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.ivx-fb-t { font-weight: 800; font-size: 15px; }
.ivx-fb-t.ok { color: var(--ok); }
.ivx-fb-t.bad { color: var(--rd); }
.ivx-fb p { font-size: 13.5px; line-height: 1.9; margin: 0; color: var(--tx); }
.ivx-fb .why { border-top: 1px solid var(--bd); padding-top: 8px; margin-top: 2px; }
.ivx-fb .why b { color: var(--ok); }

/* النتيجة */
.ivx-res { text-align: center; align-items: center; padding: 28px 22px; }
.ivx-res-n { font-size: 22px; font-weight: 900; line-height: 1.5; }
.ivx-res-s { font-size: 13px; color: #D8CCFF; line-height: 1.8; }
.ivx-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.ivx-tile { background: var(--card); border: 1px solid var(--bd); border-radius: 18px; padding: 14px 8px; text-align: center; box-shadow: var(--sh); }
.ivx-tile b { display: block; font-size: 22px; font-weight: 900; color: var(--acx); line-height: 1.5; }
body.dark-mode .ivx-tile b { color: var(--ac); }
.ivx-tile span { font-size: 11.5px; color: var(--mu); }
.ivx-mist { background: var(--rdb); border-right: 3px solid var(--rd); border-radius: 10px; padding: 10px 12px; font-size: 13px; line-height: 1.8; color: var(--tx); }
.ivx-vrow { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--bd); font-size: 13px; }
.ivx-vrow:last-child { border-bottom: 0; }
.ivx-vrow span:first-child { font-weight: 700; direction: ltr; text-align: left; }
.ivx-vrow span:last-child { color: var(--mu); text-align: left; }
.ivx-btns { display: flex; gap: 10px; }
.ivx-btns .ivx-btn { flex: 1; }

/* ════ شاشات صغيرة ════ */
@media (max-width: 900px) {
  .ivx-top { grid-template-columns: 1fr; }
  .ivx-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
  .ivx-hero { padding: 28px 24px; }
  .ivx-h1 { font-size: 32px; }
}
@media (max-width: 640px) {
  .ivx-main { gap: 18px; }
  .ivx-hero { padding: 24px 18px; border-radius: 24px; gap: 16px; }
  .ivx-h1 { font-size: 25px; }
  .ivx-resume { flex-wrap: wrap; padding: 14px; gap: 12px; }
  .ivx-resume-body { flex-basis: calc(100% - 100px); }
  .ivx-resume .ivx-btn { width: 100%; }
  .ivx-resume-name { font-size: 18px; }
  .ivx-stats { gap: 22px; }
  .ivx-stat-n { font-size: 24px; }
  .ivx-ready { padding: 20px; }
  .ivx-journey { padding: 18px 16px; }
  .ivx-node { width: 36px; height: 36px; font-size: 13px; }
  .ivx-link { margin: 0 4px; }
  .ivx-lbls span { font-size: 11px; }
  .ivx-search { min-width: 0; width: 100%; min-height: 52px; margin-right: 0; }
  .ivx-tab { min-width: 112px; padding: 8px 12px; }
  .ivx-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .ivx-co-body { padding: 14px 12px 14px; gap: 10px; }
  .ivx-co .ivx-logo { width: 38px; height: 38px; border-radius: 12px; font-size: 14px; }
  .ivx-co-name { font-size: 15px; }
  .ivx-co-role { font-size: 11.5px; }
  .ivx-co .ivx-pill { font-size: 11px; padding: 3px 8px; }
  .ivx-co .ivx-btn { min-height: 40px; font-size: 13px; padding: 0 8px; }
  .ivx-co .ivx-row { gap: 6px; }
  .ivx-sheet { padding-left: 16px; padding-right: 16px; }
}
