/**
 * el-unified.css — Unified E-Labs Header & Footer
 * ================================================
 * Include on every www page:
 *   <link rel="stylesheet" href="/css/el-unified.css">
 *
 * Then paste the canonical header/footer HTML blocks and call:
 *   ELabsAuth.bindNav({ loginBtnId:'elHeaderSignIn', acctDropId:'elHeaderAcctDrop',
 *                        acctNameId:'elHeaderAcctName', logoutBtnId:'elHeaderLogout',
 *                        onLogin: <fn> })
 */

/* ── Shared token fallbacks (safe to re-declare — same values as all pages) ── */
:root {
  --el-bg:      #0a0a0f;
  --el-bg2:     #111118;
  --el-bg3:     #16161f;
  --el-border:  #1e1e2e;
  --el-border2: #2a2a3e;
  --el-text:    #e8e8f0;
  --el-muted:   #8888a8;
  --el-accent:  #6c63ff;
  --el-cyan:    #38bdf8;
}

/* ══════════════════════════════════════════════════
   UNIFIED HEADER
   ══════════════════════════════════════════════════ */
.el-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 9000;
  background: rgba(5,5,16,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(108,99,255,0.13);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  height: 65px;
  min-height: 65px;
  gap: 1rem;
  box-sizing: border-box;
}

/* Brand / logo */
.el-brand {
  font-weight: 900;
  font-size: 1.2rem;
  letter-spacing: -0.03em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  flex-shrink: 0;
  color: var(--el-text, #e8e8f0);
}

.el-brand-logo {
  display: block;
  height: 34px;
  width: auto;
  max-width: min(38vw, 240px);
  object-fit: contain;
  filter: drop-shadow(0 1px 10px rgba(56, 189, 248, 0.14));
}

.el-brand-text {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.el-brand-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.el-brand-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, #6c63ff, #38bdf8);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 900; color: #fff;
  box-shadow: 0 0 16px rgba(108,99,255,0.4);
  flex-shrink: 0;
}
.el-brand-name span:first-child { color: var(--el-text, #e8e8f0); }
.el-brand-ai { color: var(--el-accent, #6c63ff); }

/* ── Preview Brand (E-Labs AI with particles & tagline) ── */
.el-header { overflow: hidden !important; }
.el-brand.preview-brand {
  gap: 10px !important; min-width: 0 !important; align-items: center !important;
  flex-direction: row !important; display: flex !important; font-size: auto !important;
}
.preview-brand-mark {
  display: inline-flex !important; align-items: center !important; gap: 12px !important;
  width: min(36vw, 410px) !important; min-width: 0 !important;
  flex: 0 0 auto !important;
}
.preview-brand-e-wrap { position: relative; width: 34px; height: 54px; flex: 0 0 auto; }
.preview-brand-e {
  position: absolute; right: 0; top: 50%; transform: translateY(-54%);
  font-size: 70px; line-height: 0.82; font-weight: 900;
  letter-spacing: -0.08em;
  font-family: Impact, Haettenschweiler, "Arial Black", sans-serif;
  background: linear-gradient(180deg, #55dfff 0%, #279fff 44%, #244cf2 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 18px rgba(46, 162, 255, 0.18);
}
.preview-brand-particles {
  position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; pointer-events: none;
}
.preview-brand-particles::before, .preview-brand-particles::after {
  content: ""; position: absolute; inset: 0; background-repeat: no-repeat;
}
.preview-brand-particles::before {
  background-image:
    radial-gradient(circle, rgba(80,211,255,0.98) 0 2px, transparent 2.5px),
    radial-gradient(circle, rgba(57,166,255,0.98) 0 2px, transparent 2.5px),
    radial-gradient(circle, rgba(57,166,255,0.92) 0 1.7px, transparent 2.2px),
    radial-gradient(circle, rgba(112,224,255,0.9) 0 1.6px, transparent 2px),
    radial-gradient(circle, rgba(46,162,255,0.85) 0 1.4px, transparent 1.8px),
    radial-gradient(circle, rgba(46,162,255,0.82) 0 1.4px, transparent 1.8px),
    radial-gradient(circle, rgba(46,162,255,0.74) 0 1.3px, transparent 1.8px);
  background-size: 6px 6px, 6px 6px, 5px 5px, 5px 5px, 4px 4px, 4px 4px, 4px 4px;
  background-position: 2px 15px, 8px 7px, 12px 21px, 17px 12px, 21px 4px, 23px 18px, 26px 28px;
}
.preview-brand-particles::after {
  background-image:
    linear-gradient(90deg, rgba(62,183,255,0.95), rgba(62,183,255,0.95)),
    linear-gradient(90deg, rgba(62,183,255,0.86), rgba(62,183,255,0.86)),
    linear-gradient(90deg, rgba(62,183,255,0.78), rgba(62,183,255,0.78)),
    linear-gradient(90deg, rgba(62,183,255,0.72), rgba(62,183,255,0.72)),
    linear-gradient(90deg, rgba(62,183,255,0.65), rgba(62,183,255,0.65));
  background-size: 14px 2px, 10px 2px, 9px 2px, 8px 2px, 7px 2px;
  background-position: 6px 17px, 13px 9px, 13px 22px, 19px 13px, 22px 27px;
}
.preview-brand-copy { display: grid !important; gap: 2px !important; min-width: 0 !important; }
.preview-brand-line {
  display: flex !important; align-items: center !important; gap: 7px !important; flex-wrap: nowrap !important; white-space: nowrap !important;
  color: #dfe4ee !important; font-family: Impact, Haettenschweiler, "Arial Black", sans-serif !important;
  font-weight: 900 !important; letter-spacing: 0.18em !important; text-transform: uppercase !important;
  line-height: 0.92 !important; font-size: 36px !important; text-shadow: 0 1px 0 rgba(255,255,255,0.08) !important;
}
.preview-brand-letter.blue { color: #2c9dff; text-shadow: 0 0 14px rgba(46,162,255,0.16); }
.preview-brand-dash { color: #aeb6c6; margin: 0 -2px; }
.preview-brand-a-letter {
  position: relative; display: inline-block; width: 22px; height: 29px;
  margin: 0 1px 0 -2px; transform: translateY(2px);
}
.preview-brand-a-letter::before, .preview-brand-a-letter::after {
  content: ""; position: absolute; bottom: 0; width: 8px; height: 100%;
  border-radius: 2px 2px 0 0;
  background: linear-gradient(180deg, #3fc7ff 0%, #2494ff 54%, #1f6fff 100%);
}
.preview-brand-a-letter::before { left: 2px; transform: skewX(-26deg); }
.preview-brand-a-letter::after { right: 2px; transform: skewX(26deg); }
.preview-brand-a-letter .crossbar {
  position: absolute; left: 5px; right: 5px; top: 15px; height: 4px;
  border-radius: 3px; background: #08101e;
  box-shadow: 0 0 0 1px rgba(32,93,170,0.15);
}
.preview-brand-tagline {
  display: flex; align-items: center; gap: 10px; padding-left: 2px;
  color: rgba(222,231,244,0.82); font-size: 7px; font-weight: 700;
  letter-spacing: 0.38em; text-transform: uppercase; white-space: nowrap;
}
.preview-brand-dot { width: 4px; height: 4px; border-radius: 999px; background: #2ea2ff; box-shadow: 0 0 8px rgba(46,162,255,0.38); }
@media (max-width: 860px) {
  .preview-brand-mark { width: min(50vw, 312px); gap: 8px; }
  .preview-brand-e-wrap { width: 28px; height: 44px; }
  .preview-brand-e { font-size: 56px; }
  .preview-brand-line { font-size: 28px; gap: 5px; }
  .preview-brand-a-letter { width: 18px; height: 23px; }
  .preview-brand-tagline { font-size: 6px; letter-spacing: 0.22em; gap: 7px; }
}
@media (max-width: 700px) {
  .preview-brand-mark { width: min(58vw, 246px); }
  .preview-brand-e-wrap { width: 20px; height: 32px; }
  .preview-brand-e { font-size: 40px; }
  .preview-brand-line { font-size: 20px; gap: 3px; }
  .preview-brand-a-letter { width: 13px; height: 17px; }
  .preview-brand-tagline { font-size: 5px; letter-spacing: 0.16em; gap: 5px; }
}

/* Nav links */
.el-nav {
  display: flex;
  align-items: center;
  gap: 0.1rem;
  flex: 1;
  justify-content: center;
}
.el-nav a {
  font-size: 0.88rem;
  color: var(--el-muted, #8888a8);
  padding: 0.4rem 0.85rem;
  border-radius: 8px;
  transition: color .18s, background .18s;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.el-nav a:hover {
  color: var(--el-text, #e8e8f0);
  background: rgba(255,255,255,0.05);
}
.el-nav a.active {
  color: var(--el-text, #e8e8f0);
}

/* Right side — sign in + dropdown */
.el-nav-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  position: relative;
  flex-shrink: 0;
  justify-content: flex-end;
  flex-wrap: nowrap;
}
.el-sign-in-btn {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--el-muted, #8888a8);
  padding: 0.42rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--el-border2, #2a2a3e);
  background: transparent;
  transition: color .18s, border-color .18s, background .18s;
  cursor: pointer;
  font-family: inherit;
  line-height: 1;
}
.el-sign-in-btn:hover {
  color: var(--el-text, #e8e8f0);
  border-color: rgba(108,99,255,0.4);
  background: rgba(108,99,255,0.06);
}

.el-balance-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--el-text, #e8e8f0);
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.1);
  border-radius: 999px;
  padding: 0.34rem 0.64rem;
  line-height: 1;
  white-space: nowrap;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Account dropdown */
.el-acct-drop {
  display: none;
  position: absolute;
  right: 0; top: calc(100% + 8px);
  min-width: 190px;
  background: var(--el-bg3, #16161f);
  border: 1px solid var(--el-border2, #2a2a3e);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 8px 40px rgba(0,0,0,.75), 0 0 0 1px rgba(108,99,255,.08);
  z-index: 9100;
}
.el-acct-drop.open { display: block !important; }
.el-acct-name {
  padding: 8px 12px 6px;
  font-size: .73rem;
  font-weight: 600;
  color: var(--el-muted, #8888a8);
  border-bottom: 1px solid var(--el-border, #1e1e2e);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.el-drop-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 7px 12px;
  font-size: .83rem;
  color: var(--el-text, #e8e8f0);
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 7px;
  text-decoration: none;
  font-family: inherit;
  font-weight: 500;
  transition: background .12s, color .12s;
  box-sizing: border-box;
}
.el-drop-item:hover {
  background: rgba(108,99,255,.1);
  color: var(--el-accent, #6c63ff);
}
.el-drop-logout { color: var(--el-muted, #8888a8); }

/* Mobile — hide nav links below 700px */
@media (max-width: 700px) {
  .el-nav { display: none; }
  .el-header { padding: 0 1.25rem; }
  .el-brand-logo {
    height: 28px;
    max-width: min(52vw, 190px);
  }
  .el-balance-pill {
    max-width: 140px;
    font-size: 0.7rem;
    padding: 0.3rem 0.52rem;
  }
}

/* ══════════════════════════════════════════════════
   UNIFIED FOOTER
   ══════════════════════════════════════════════════ */
.el-footer-bar {
  background: rgba(5,5,16,0.97);
  border-top: 1px solid var(--el-border, #1e1e2e);
  padding: 1.5rem 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}
.el-footer-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
}
.el-footer-links a {
  font-size: 0.83rem;
  color: var(--el-muted, #8888a8);
  text-decoration: none;
  transition: color .18s;
}
.el-footer-links a:hover { color: var(--el-text, #e8e8f0); }
.el-footer-copy {
  font-size: 0.75rem;
  color: var(--el-muted, #8888a8);
  margin: 0;
}
