/* ==========================================================================
   Smart Mentor Hub — Help Center
   styles.css
   Dark theme matched to the Smart Mentor Hub web app design system.
   Pure CSS. Responsive (desktop / tablet / mobile). RTL-ready (Arabic).
   ========================================================================== */

:root {
  /* Brand (from web app design tokens) */
  --brand:        #12e4f8;   /* aqua primary */
  --brand-hover:  #0fc8d9;
  --brand-soft:   rgba(18, 228, 248, 0.10);
  --accent:       #34d399;   /* green */
  --accent-soft:  rgba(52, 211, 153, 0.12);

  /* Backgrounds */
  --bg:           #0e1c29;   /* root */
  --surface:      #13242f;   /* card */
  --surface-2:    #1b3349;   /* fill */
  --bg-input:     #0e1c29;
  --bg-overlay:   rgba(8, 16, 24, 0.66);

  /* Text */
  --text:         #ffffff;
  --text-soft:    #a3a7ae;
  --text-muted:   #5e6a78;
  --text-on-brand:#0e1c29;

  /* Status */
  --warn:         #fbbf24;
  --warn-soft:    rgba(251, 191, 36, 0.12);
  --danger:       #f87171;
  --danger-soft:  rgba(248, 113, 113, 0.12);
  --info:         #0ea5e9;

  /* Borders */
  --border:       #2d5c87;          /* stroke */
  --border-soft:  rgba(45, 92, 135, 0.5);

  /* Type & layout */
  --font: 'Poppins', system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --font-ar: 'Tajawal', 'Poppins', sans-serif;
  --radius:       16px;
  --radius-sm:    12px;
  --radius-xs:    8px;
  --shadow-sm:    0px 4px 16px rgba(0, 0, 0, 0.20);
  --shadow:       0px 4px 24px rgba(0, 0, 0, 0.30);
  --shadow-lg:    0px 8px 32px rgba(0, 0, 0, 0.45);
  --sidebar-w:    280px;
  --header-h:     72px;
  --maxw:         1200px;
}

/* ------------------------------- Reset ---------------------------------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
[dir="rtl"] body { font-family: var(--font-ar); }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-hover); text-decoration: underline; }
img { max-width: 100%; display: block; }
ul, ol { padding-inline-start: 1.25rem; }
button { font-family: inherit; cursor: pointer; }
::selection { background: var(--brand-soft); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }

/* ------------------------------- Header --------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  background: rgba(14, 28, 41, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-soft);
  display: flex; align-items: center;
}
.site-header .wrap {
  max-width: var(--maxw); width: 100%; margin: 0 auto;
  padding: 0 24px; display: flex; align-items: center; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 1.05rem; color: var(--text); }
.brand:hover { text-decoration: none; color: var(--text); }
.brand .logo { display: flex; align-items: center; }
.brand .wordmark { font-weight: 700; letter-spacing: -.01em; line-height: 1; }
.brand .wordmark .hl { color: var(--brand); }
.brand small { display: block; font-weight: 400; font-size: .72rem; color: var(--text-muted); margin-top: 2px; }
.header-spacer { flex: 1; }
.header-nav { display: flex; align-items: center; gap: 4px; }
.header-nav a { color: var(--text-soft); padding: 8px 12px; border-radius: var(--radius-xs); font-size: .92rem; font-weight: 500; }
.header-nav a:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }

/* Language toggle */
.lang-toggle {
  display: inline-flex; background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: 999px; padding: 3px; gap: 2px;
}
.lang-toggle button {
  border: 0; background: transparent; color: var(--text-soft);
  padding: 5px 13px; border-radius: 999px; font-size: .82rem; font-weight: 600;
}
.lang-toggle button.active { background: var(--brand); color: var(--text-on-brand); }

/* Mobile menu button */
.menu-btn {
  display: none; border: 1px solid var(--border-soft); background: var(--surface);
  width: 42px; height: 42px; border-radius: var(--radius-xs); font-size: 1.2rem; color: var(--text);
}

/* ------------------------------- Hero ----------------------------------- */
.hero {
  position: relative;
  background:
    radial-gradient(1100px 360px at 12% -10%, rgba(18,228,248,.14), transparent),
    radial-gradient(900px 360px at 100% 0%, rgba(52,211,153,.12), transparent),
    linear-gradient(180deg, #112634, var(--bg));
  border-bottom: 1px solid var(--border-soft);
  padding: 58px 24px 46px;
}
.hero .wrap { max-width: 820px; margin: 0 auto; text-align: center; }
.hero .eyebrow {
  display: inline-block; background: var(--brand-soft); color: var(--brand);
  font-size: .8rem; font-weight: 600; padding: 6px 14px; border-radius: 999px; letter-spacing: .02em;
  border: 1px solid var(--border-soft);
}
.hero h1 { font-size: clamp(1.9rem, 4vw, 2.7rem); line-height: 1.15; margin: 16px 0 10px; letter-spacing: -.02em; font-weight: 600; }
.hero p.lead { font-size: 1.06rem; color: var(--text-soft); max-width: 640px; margin: 0 auto; }

/* Search */
.search-box { margin: 28px auto 0; max-width: 640px; position: relative; }
.search-box input {
  width: 100%; padding: 16px 20px; padding-inline-start: 50px; font-size: 1rem;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-input);
  box-shadow: var(--shadow); color: var(--text);
}
.search-box input::placeholder { color: var(--text-muted); }
.search-box input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.search-box .icon { position: absolute; inset-inline-start: 18px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 1.1rem; pointer-events: none; }
.search-results {
  position: absolute; top: calc(100% + 8px); inset-inline: 0; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
  text-align: start; max-height: 320px; overflow-y: auto; display: none; z-index: 40;
}
.search-results.show { display: block; }
.search-results a { display: block; padding: 12px 18px; color: var(--text); border-bottom: 1px solid var(--border-soft); }
.search-results a:last-child { border-bottom: 0; }
.search-results a:hover { background: var(--surface-2); text-decoration: none; }
.search-results a span { display: block; font-size: .8rem; color: var(--text-muted); }
.search-results .empty { padding: 16px 18px; color: var(--text-muted); font-size: .9rem; }

/* Role selector */
.role-selector { margin-top: 26px; display: inline-flex; flex-wrap: wrap; gap: 8px; background: var(--surface); border: 1px solid var(--border-soft); padding: 6px; border-radius: 999px; box-shadow: var(--shadow-sm); }
.role-selector button {
  border: 0; background: transparent; color: var(--text-soft); font-weight: 600;
  padding: 9px 20px; border-radius: 999px; font-size: .92rem; transition: .15s;
}
.role-selector button .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-inline-end: 7px; vertical-align: middle; }
.role-selector button[data-role="mentee"] .dot { background: var(--brand); }
.role-selector button[data-role="mentor"] .dot { background: var(--accent); }
.role-selector button[data-role="all"] .dot { background: linear-gradient(90deg, var(--brand), var(--accent)); }
.role-selector button.active { background: var(--brand); color: var(--text-on-brand); }
.role-selector button.active .dot { background: var(--text-on-brand); }
.hero-actions { margin-top: 16px; display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }
.ghost-btn {
  min-height: 38px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-soft); background: rgba(19,36,47,.78);
  color: var(--text); border-radius: 999px; padding: 8px 16px; font-weight: 600; font-size: .88rem;
}
.ghost-btn:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; background: var(--surface); }
.guide-meta { margin-top: 14px !important; color: var(--text-muted) !important; font-size: .84rem !important; }

/* ------------------------------ Layout ---------------------------------- */
.layout { max-width: var(--maxw); margin: 0 auto; display: flex; gap: 32px; padding: 32px 24px 64px; align-items: flex-start; }

/* Sidebar */
.sidebar {
  width: var(--sidebar-w); flex: none; position: sticky; top: calc(var(--header-h) + 20px);
  max-height: calc(100vh - var(--header-h) - 40px); overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow-sm);
}
.sidebar h4 { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--brand); margin: 16px 8px 6px; font-weight: 600; }
.sidebar h4:first-child { margin-top: 4px; }
.sidebar nav a {
  display: block; padding: 8px 10px; border-radius: var(--radius-xs); color: var(--text-soft);
  font-size: .9rem; font-weight: 500; border-inline-start: 3px solid transparent;
}
.sidebar nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.sidebar nav a.active { background: var(--brand-soft); color: var(--brand); border-inline-start-color: var(--brand); font-weight: 600; }

/* Main content */
.content { flex: 1; min-width: 0; }

/* Scenario quick-cards grid */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-bottom: 44px; }
.scenario-card {
  background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow-sm); transition: .18s; color: var(--text);
}
.scenario-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); text-decoration: none; border-color: var(--brand); }
.scenario-card .emoji { font-size: 1.5rem; }
.scenario-card h3 { font-size: 1rem; margin: 10px 0 4px; font-weight: 600; }
.scenario-card p { font-size: .86rem; color: var(--text-soft); }

/* Section blocks */
.section { margin-bottom: 50px; scroll-margin-top: calc(var(--header-h) + 16px); }
.section > h2 {
  font-size: 1.5rem; letter-spacing: -.01em; margin-bottom: 6px; font-weight: 600;
  display: flex; align-items: center; gap: 10px;
}
.section > p.section-intro { color: var(--text-soft); margin-bottom: 20px; max-width: 72ch; }
.section-divider { height: 1px; background: var(--border-soft); border: 0; margin: 8px 0 24px; }

/* Role badges */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: .72rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; letter-spacing: .02em; }
.badge.mentee { background: var(--brand-soft); color: var(--brand); border: 1px solid var(--border-soft); }
.badge.mentor { background: var(--accent-soft); color: var(--accent); border: 1px solid rgba(52,211,153,.4); }
.badge.both   { background: rgba(14,165,233,.14); color: #38bdf8; border: 1px solid rgba(14,165,233,.4); }

/* Accordion (scenario) */
.accordion { display: flex; flex-direction: column; gap: 12px; }
.scenario {
  background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); overflow: hidden; scroll-margin-top: calc(var(--header-h) + 16px);
}
.scenario.open { border-color: var(--border); }
.scenario > button.scenario-head {
  width: 100%; border: 0; background: transparent; text-align: start; color: var(--text);
  padding: 18px 20px; display: flex; align-items: center; gap: 12px;
}
.scenario > button.scenario-head:hover { background: var(--surface-2); }
.scenario-head .s-emoji { font-size: 1.3rem; flex: none; }
.scenario-head .s-titles { flex: 1; min-width: 0; }
.scenario-head .s-titles h3 { font-size: 1.05rem; margin-bottom: 4px; font-weight: 600; }
.scenario-head .s-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.scenario-head .chev { flex: none; color: var(--text-muted); transition: transform .2s; font-size: 1.1rem; }
.scenario.open .chev { transform: rotate(180deg); color: var(--brand); }

.scenario-body { display: none; padding: 0 20px 22px; }
.scenario.open .scenario-body { display: block; }
.scenario-body .when { background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px 14px; font-size: .9rem; color: var(--text-soft); margin-bottom: 16px; margin-top: 16px; }
.scenario-body .when strong { color: var(--text); }

.steps { counter-reset: step; list-style: none; padding: 0; margin: 0 0 4px; }
.steps li { position: relative; padding: 4px 0 14px 42px; }
.steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; inset-inline-start: 0; top: 2px;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--brand); color: var(--text-on-brand); font-weight: 700; font-size: .82rem;
  display: grid; place-items: center;
}
.steps li:not(:last-child)::after { content: ""; position: absolute; inset-inline-start: 13px; top: 32px; bottom: 0; width: 2px; background: var(--border-soft); }
.steps strong { color: var(--text); font-weight: 600; }

/* Note / tip / warning callouts */
.callout { border-radius: var(--radius-sm); padding: 12px 16px; margin: 16px 0; font-size: .92rem; border-inline-start: 4px solid; color: var(--text-soft); }
.callout p { margin: 0; }
.callout strong { display: block; margin-bottom: 2px; color: var(--text); }
.callout.tip   { background: var(--accent-soft); border-color: var(--accent); }
.callout.note  { background: var(--brand-soft);  border-color: var(--brand); }
.callout.warn  { background: var(--warn-soft);   border-color: var(--warn); }
.callout.issue { background: var(--danger-soft); border-color: var(--danger); }
.callout ul { margin: 6px 0 0; }
.callout a { color: var(--brand); }

/* Media placeholders */
.media-placeholder {
  border: 2px dashed var(--border); border-radius: var(--radius); background: var(--bg-input);
  padding: 26px 20px; text-align: center; margin: 16px 0; color: var(--text-soft);
}
.media-placeholder .ph-icon { font-size: 1.8rem; display: block; margin-bottom: 6px; }
.media-placeholder .ph-label { font-weight: 600; color: var(--text); }
.media-placeholder .ph-path { font-size: .78rem; color: var(--text-muted); font-family: ui-monospace, "SF Mono", Menlo, monospace; margin-top: 4px; word-break: break-all; }
.media-placeholder.video { border-color: rgba(52,211,153,.5); }
.media-placeholder.video .ph-icon { color: var(--accent); }

/* Real screenshots — phone-framed gallery */
.shots { display: flex; flex-wrap: wrap; gap: 18px; margin: 18px 0; }
.shot { width: 200px; max-width: 46%; }
.shot figure { margin: 0; }
.shot .frame {
  border: 6px solid #060d16; border-radius: 26px; overflow: hidden;
  background: #060d16; box-shadow: var(--shadow); aspect-ratio: 9 / 19.5;
}
.shot .frame img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.shot figcaption { font-size: .8rem; color: var(--text-muted); text-align: center; margin-top: 8px; }
@media (max-width: 560px) {
  .shot { width: 44%; max-width: 44%; }
}

/* Step screenshot strip (small inline placeholders) */
.shot-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 14px 0; }
.shot-mini { border: 2px dashed var(--border); border-radius: var(--radius-sm); aspect-ratio: 9/16; display: grid; place-items: center; text-align: center; font-size: .72rem; color: var(--text-muted); background: var(--bg-input); padding: 6px; }
.shot-mini b { color: var(--text-soft); font-size: .76rem; }

/* FAQ */
.faq-item { border-bottom: 1px solid var(--border-soft); }
.faq-item button { width: 100%; border: 0; background: transparent; text-align: start; padding: 16px 4px; font-size: 1rem; font-weight: 600; color: var(--text); display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.faq-item button .chev { color: var(--text-muted); transition: transform .2s; }
.faq-item.open button { color: var(--brand); }
.faq-item.open button .chev { transform: rotate(180deg); color: var(--brand); }
.faq-item .faq-answer { display: none; padding: 0 4px 18px; color: var(--text-soft); }
.faq-item.open .faq-answer { display: block; }
.faq-answer a { color: var(--brand); }

/* Troubleshooting */
.trouble-list { display: grid; gap: 12px; }
.trouble-item { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius-sm); padding: 16px 18px; box-shadow: var(--shadow-sm); }
.trouble-item h4 { font-size: .98rem; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; font-weight: 600; }
.trouble-item h4 .q { color: var(--brand); font-weight: 800; }
.trouble-item p { font-size: .92rem; color: var(--text-soft); margin: 0; }
.trouble-item ol, .trouble-item ul { font-size: .92rem; color: var(--text-soft); margin-top: 6px; }
.trouble-item a { color: var(--brand); }
.trouble-item strong { color: var(--text); }

/* Role visibility filtering */
body[data-active-role="mentee"] [data-roles="mentor"],
body[data-active-role="mentor"] [data-roles="mentee"] { display: none !important; }

/* Footer */
.site-footer { background: #0a151f; color: var(--text-soft); padding: 46px 24px 28px; border-top: 1px solid var(--border-soft); }
.site-footer .wrap { max-width: var(--maxw); margin: 0 auto; display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 28px; }
.site-footer h5 { color: #fff; font-size: .92rem; margin-bottom: 12px; font-weight: 600; }
.site-footer a { color: var(--text-soft); font-size: .9rem; display: block; padding: 4px 0; }
.site-footer a:hover { color: var(--brand); }
.site-footer .foot-brand p { font-size: .88rem; max-width: 32ch; margin-top: 10px; color: var(--text-muted); }
.store-badges { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.store-badge { border: 1px solid var(--border); border-radius: var(--radius-xs); padding: 8px 12px; font-size: .8rem; color: #fff; display: flex; align-items: center; gap: 8px; background: var(--surface); }
.foot-bottom { max-width: var(--maxw); margin: 28px auto 0; padding-top: 18px; border-top: 1px solid var(--border-soft); font-size: .82rem; color: var(--text-muted); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

/* Back to top */
.to-top { position: fixed; inset-inline-end: 22px; bottom: 22px; width: 46px; height: 46px; border-radius: 50%; background: var(--brand); color: var(--text-on-brand); border: 0; box-shadow: var(--shadow-lg); font-size: 1.2rem; display: none; place-items: center; z-index: 45; }
.to-top.show { display: grid; }

/* Sidebar overlay (mobile) */
.overlay { position: fixed; inset: 0; background: var(--bg-overlay); z-index: 60; display: none; }
.overlay.show { display: block; }

/* ----------------------------- Responsive ------------------------------- */
@media (max-width: 1024px) {
  .site-footer .wrap { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 880px) {
  .header-nav { display: none; }
  .menu-btn { display: grid; place-items: center; }
  .layout { display: block; padding-top: 22px; }
  .sidebar {
    position: fixed; inset-block: 0; inset-inline-start: 0; z-index: 70;
    width: 280px; max-height: 100vh; border-radius: 0; transform: translateX(-105%);
    transition: transform .25s ease; box-shadow: var(--shadow-lg);
  }
  [dir="rtl"] .sidebar { transform: translateX(105%); }
  .sidebar.open { transform: translateX(0); }
  .content { margin-top: 8px; }
}
@media (max-width: 560px) {
  .hero { padding: 38px 16px 32px; }
  .site-header .wrap { padding: 0 14px; }
  .brand small { display: none; }
  .layout { padding: 18px 14px 50px; }
  .site-footer .wrap { grid-template-columns: 1fr; }
  .scenario-head .s-titles h3 { font-size: 1rem; }
  .role-selector { width: 100%; border-radius: var(--radius); }
  .role-selector button { flex: 1 1 100%; border-radius: var(--radius-xs); }
  .hero-actions .ghost-btn { flex: 1 1 auto; }
  .search-box input { font-size: .95rem; }
}

/* ------------------------------ RTL ready ------------------------------- */
[dir="rtl"] body, [dir="rtl"] .hero .wrap { text-align: right; }
[dir="rtl"] .steps li { padding: 4px 42px 14px 0; }

/* Print */
@media print {
  .site-header, .sidebar, .search-box, .role-selector, .hero-actions, .to-top, .menu-btn, .site-footer .store-badges { display: none !important; }
  .scenario-body, .faq-answer { display: block !important; }
  body { background: #fff; color: #000; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
