/* ============================================================
   MOSTAQER — GLOBAL HEADER COMPONENT
   css/header.css
   Shared across ALL pages: landing, therapy module, admin
   Light Mostaqer brand | sticky | responsive | RTL
   ============================================================ */

/* ── Design tokens (mirrors tp-module.css) ── */
:root {
  --gh-bg       : #FFFFFF;
  --gh-border   : #EDE8D0;
  --gh-gold     : #C49A00;
  --gh-gold-l   : #E6B800;
  --gh-gold-bg  : #FFFBEA;
  --gh-text     : #1A1209;
  --gh-text2    : #44403C;
  --gh-muted    : #78716C;
  --gh-shadow   : 0 2px 10px rgba(196,154,0,.10), 0 1px 4px rgba(0,0,0,.06);
  --gh-h        : 62px;
  --gh-radius   : 10px;
}

/* ════════════════════════════════════════
   GLOBAL HEADER BAR
════════════════════════════════════════ */
#global-header {
  position: sticky;
  top: 0;
  z-index: 9000;
  background: var(--gh-bg);
  border-bottom: 1.5px solid var(--gh-border);
  box-shadow: var(--gh-shadow);
  height: var(--gh-h);
  width: 100%;
  display: flex;
  align-items: center;
}

/* Hide header during login / splash (before auth) */
#global-header.gh-hidden { display: none !important; }

/* Inner wrapper */
.gh-inner {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 100%;
}

/* ── Brand / Logo ── */
.gh-brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-shrink: 0;
  text-decoration: none;
}
.gh-logo {
  height: 38px;
  width: auto;
}
.gh-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.gh-brand-title {
  font-size: .88rem;
  font-weight: 900;
  color: var(--gh-text);
  font-family: 'Cairo', sans-serif;
}
.gh-brand-sub {
  font-size: .65rem;
  color: var(--gh-gold);
  font-weight: 700;
  font-family: 'Cairo', sans-serif;
}

/* ── Page title (dynamic) ── */
.gh-page-title {
  font-size: .82rem;
  font-weight: 700;
  color: var(--gh-muted);
  background: var(--gh-gold-bg);
  border: 1px solid var(--gh-border);
  border-radius: 20px;
  padding: .22rem .75rem;
  white-space: nowrap;
  font-family: 'Cairo', sans-serif;
  flex-shrink: 0;
}

/* ── Spacer ── */
.gh-spacer { flex: 1; }

/* ── User badge ── */
.gh-user-badge {
  display: flex;
  align-items: center;
  gap: .5rem;
  background: #FAFAF5;
  border: 1.5px solid var(--gh-border);
  border-radius: 20px;
  padding: .28rem .8rem .28rem .4rem;
  flex-shrink: 0;
}
.gh-user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gh-gold-l), var(--gh-gold));
  color: #fff;
  font-size: .8rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-family: 'Cairo', sans-serif;
}
.gh-user-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.gh-user-name {
  font-size: .78rem;
  font-weight: 700;
  color: var(--gh-text);
  font-family: 'Cairo', sans-serif;
}
.gh-user-role {
  font-size: .65rem;
  color: var(--gh-gold);
  font-weight: 600;
  font-family: 'Cairo', sans-serif;
}

/* ── Action buttons ── */
.gh-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--gh-radius);
  border: 1.5px solid var(--gh-border);
  background: #FAFAF5;
  color: var(--gh-text2);
  font-size: .85rem;
  cursor: pointer;
  text-decoration: none;
  transition: all .2s;
  flex-shrink: 0;
  font-family: 'Cairo', sans-serif;
}
.gh-btn:hover {
  background: var(--gh-gold-bg);
  border-color: var(--gh-gold-l);
  color: var(--gh-gold);
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(196,154,0,.2);
}
.gh-btn--home {
  background: var(--gh-gold-bg);
  border-color: var(--gh-gold-l);
  color: var(--gh-gold);
}
.gh-btn--home:hover {
  background: var(--gh-gold-l);
  color: #fff;
}
.gh-btn--logout {
  color: #DC2626;
  border-color: #FECACA;
  background: #FFF5F5;
}
.gh-btn--logout:hover {
  background: #DC2626;
  border-color: #DC2626;
  color: #fff;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .gh-inner { padding: 0 .75rem; gap: .5rem; }
  .gh-brand-text { display: none; }
  .gh-page-title { font-size: .72rem; padding: .18rem .5rem; }
  .gh-user-info   { display: none; }
  .gh-user-badge { padding: .28rem .28rem; }
}
@media (max-width: 400px) {
  .gh-page-title { display: none; }
}

/* ── Print: hide header ── */
@media print {
  #global-header { display: none !important; }
}

/* ── Body offset so content isn't behind sticky header ── */
body.has-global-header {
  padding-top: 0;          /* header is sticky, not fixed */
}
