/* assets/topbar.css — FULLY SCOPED + COLLISION-PROOF
   Requires wrapper: <div class="leefTopbarMount"> ...topbar.php... </div>

   State classes (must match topbar.js):
   - html.leefTbOpen
   - body.leefTbNoScroll
*/

/* ✅ HARD STOP: prevent sideways scroll site-wide (Chrome counts off-canvas fixed panels) */
html, body{
  overflow-x: hidden;
}

/* ================= TOPBAR SHELL ================= */
.leefTopbarMount .topbar2{
  position: sticky;
  top: 0;
  z-index: 99999;

  /* ✅ never exceed viewport */
  width: calc(100% - 20px);
  max-width: 1100px;

  margin: 12px auto 0;
  padding: 10px 12px;
  border-radius: 18px;

  background:
    radial-gradient(900px 220px at 18% 0%, rgba(92,255,154,0.10), transparent 60%),
    radial-gradient(900px 220px at 82% 0%, rgba(120,180,255,0.08), transparent 60%),
    rgba(6,15,11,0.78);

  border: 1px solid rgba(157,221,187,0.14);
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);

  box-sizing: border-box;
  overflow: hidden;
}

.leefTopbarMount .topbar2 .topbar2Inner{
  position: relative;
  overflow: hidden; /* ✅ clip glow */
}

/* ✅ Glow without negative left/right that can trigger scrollWidth in Chrome */
.leefTopbarMount .topbar2 .tbGlowStrip{
  position: absolute;
  left: 0;
  right: 0;
  top: -70px;
  height: 140px;

  /* make it *look* wider without changing layout width */
  width: 100%;
  transform: scaleX(1.35);

  background:
    radial-gradient(circle at 20% 40%, rgba(44,255,138,0.20), transparent 55%),
    radial-gradient(circle at 75% 10%, rgba(120,180,255,0.14), transparent 60%);

  filter: blur(12px);
  opacity: 0.85;
  pointer-events: none;
  z-index: 0;
}

.leefTopbarMount .topbar2 .tbRow{
  position: relative;
  z-index: 1;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;

  flex-wrap: nowrap;
  min-width: 0;
}

/* ================= BRAND ================= */
.leefTopbarMount .topbar2 .tbBrand{
  display:flex;
  align-items:center;
  gap: 10px;
  text-decoration:none;
  color: inherit;

  flex: 0 1 auto;
  min-width: 0;
}

.leefTopbarMount .topbar2 .tbLogo{
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(157,221,187,0.18);

  background:
    radial-gradient(circle at 30% 30%, rgba(44,255,138,0.55), rgba(44,255,138,0.06) 60%),
    rgba(255,255,255,0.03);

  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;

  animation: tbLogoGlow 2.8s ease-in-out infinite;
}

@keyframes tbLogoGlow{
  0%{ box-shadow: 0 0 14px rgba(44,255,138,0.14), 0 0 28px rgba(44,255,138,0.08); transform: scale(1); }
  50%{ box-shadow: 0 0 22px rgba(44,255,138,0.28), 0 0 46px rgba(44,255,138,0.14); transform: scale(1.03); }
  100%{ box-shadow: 0 0 14px rgba(44,255,138,0.14), 0 0 28px rgba(44,255,138,0.08); transform: scale(1); }
}

.leefTopbarMount .topbar2 .tbLogoImg{
  width: 72%;
  height: 72%;
  display:block;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(44,255,138,0.20));
}

.leefTopbarMount .topbar2 .tbText{ line-height: 1.1; min-width:0; }

.leefTopbarMount .topbar2 .tbName{
  font-weight: 900;
  font-size: 16px;
  color: rgba(235,255,245,0.95);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.leefTopbarMount .topbar2 .tbSub{
  font-size: 12px;
  opacity: 0.75;
  color: rgba(235,255,245,0.75);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

/* ================= RIGHT CONTROLS ================= */
.leefTopbarMount .topbar2 .tbRight{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap: 8px;

  flex: 0 0 auto;
  flex-wrap: nowrap;
  overflow: visible;
}

.leefTopbarMount .topbar2 .tbRight .deskOnly{ display: none; }

/* ONLY topbar buttons */
.leefTopbarMount .topbar2 .tbChip{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap: 8px;

  height: 38px;
  padding: 0 14px;
  border-radius: 16px;

  border: 1px solid rgba(157,221,187,0.18);
  background: linear-gradient(135deg, rgba(92,255,154,0.12), rgba(255,255,255,0.03));
  color: rgba(235,255,245,0.92);
  text-decoration:none;

  cursor:pointer;
  user-select:none;

  font-weight: 900;
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;

  box-shadow: 0 10px 26px rgba(0,0,0,0.18);
  transition: transform .18s ease, background .18s ease, border-color .18s ease;

  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

.leefTopbarMount .topbar2 button.tbChip{
  margin: 0;
  font: inherit;
  background-clip: padding-box;
}

.leefTopbarMount .topbar2 .tbChip:hover{
  transform: translateY(-1px);
  background: linear-gradient(135deg, rgba(92,255,154,0.18), rgba(255,255,255,0.05));
  border-color: rgba(44,255,138,0.30);
}

/* Theme button */
.leefTopbarMount .topbar2 .tbTheme{
  width: 46px;
  padding: 0;
  border-radius: 16px;
}

.leefTopbarMount .topbar2 .tbTheme .tbIconSun,
.leefTopbarMount .topbar2 .tbTheme .tbIconMoon{
  display: inline;
  line-height: 1;
}

body.light .leefTopbarMount .topbar2 .tbTheme .tbIconMoon{ display: none; }
body.light .leefTopbarMount .topbar2 .tbTheme .tbIconSun{ display: inline; }

body:not(.light) .leefTopbarMount .topbar2 .tbTheme .tbIconSun{ display: none; }
body:not(.light) .leefTopbarMount .topbar2 .tbTheme .tbIconMoon{ display: inline; }

/* prevent scroll when drawer open */
.leefTbNoScroll{ overflow: hidden; }

/* Hamburger always visible */
.leefTopbarMount .topbar2 .tbRight #hambBtn.hamb{
  display: inline-flex;
  width: 50px;
  padding: 0;
  border-radius: 16px;
  position: relative;
}

/* hamburger lines */
.leefTopbarMount .topbar2 .tbRight #hambBtn.hamb .lines,
.leefTopbarMount .topbar2 .tbRight #hambBtn.hamb .lines::before,
.leefTopbarMount .topbar2 .tbRight #hambBtn.hamb .lines::after{
  content:"";
  display:block;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 999px;
  position: relative;
  transition: transform .22s ease, opacity .18s ease, top .22s ease;
}
.leefTopbarMount .topbar2 .tbRight #hambBtn.hamb .lines::before{ position:absolute; left:0; top:-6px; }
.leefTopbarMount .topbar2 .tbRight #hambBtn.hamb .lines::after{ position:absolute; left:0; top: 6px; }

/* morph to X when open */
html.leefTbOpen .leefTopbarMount #hambBtn.hamb .lines{ transform: rotate(45deg); }
html.leefTbOpen .leefTopbarMount #hambBtn.hamb .lines::before{ top:0; opacity:0; }
html.leefTbOpen .leefTopbarMount #hambBtn.hamb .lines::after{ top:0; transform: rotate(-90deg); }

/* tiny screens */
@media (max-width: 420px){
  .leefTopbarMount .topbar2 .tbBrand{ min-width: 0; }
  .leefTopbarMount .topbar2 .tbName{ font-size: 15px; }
}

/* ================= OVERLAY ================= */
.leefTopbarMount #tbOverlay.tbOverlay{
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  background: rgba(0,0,0,0.68);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease;
  z-index: 99998;
}

html.leefTbOpen .leefTopbarMount #tbOverlay.tbOverlay{
  opacity: 1;
  pointer-events: auto;
}

/* ================= DRAWER ================= */
.leefTopbarMount #tbDrawer.tbDrawer{
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;

  width: 90vw;
  max-width: 360px;

  background:
    radial-gradient(900px 260px at 20% 0%, rgba(92,255,154,0.10), transparent 60%),
    radial-gradient(900px 260px at 80% 0%, rgba(120,180,255,0.08), transparent 60%),
    rgba(6,15,11,0.96);

  border-left: 1px solid rgba(157,221,187,0.16);
  box-shadow: -18px 0 60px rgba(0,0,0,0.40);

  /* ✅ was 102% — can create horizontal scrollWidth in Chrome */
  transform: translateX(100%);
  transition: transform .30s cubic-bezier(.2,.9,.2,1);
  z-index: 99999;

  display:flex;
  flex-direction: column;
}

html.leefTbOpen .leefTopbarMount #tbDrawer.tbDrawer{ transform: translateX(0); }

/* Drawer header */
.leefTopbarMount #tbDrawer .tbDrawerHead{
  height: 64px;
  display:flex;
  align-items:center;
  justify-content: space-between;
  padding: 0 14px;
  border-bottom: 1px solid rgba(157,221,187,0.14);
}

.leefTopbarMount #tbDrawer .tbDrawerTitle{
  font-weight: 900;
  letter-spacing: .2px;
  color: rgba(235,255,245,0.95);
}

.leefTopbarMount #tbDrawer .tbDrawerClose{
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 16px;
}

/* Drawer body */
.leefTopbarMount #tbDrawer .tbDrawerBody{
  padding: 14px;
  overflow: auto;
  display:flex;
  flex-direction: column;
  gap: 12px;
}

/* Section label */
.leefTopbarMount #tbDrawer .tbSection{
  margin-top: 2px;
  color: rgba(235,255,245,0.58);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}

/* Menu list */
.leefTopbarMount #tbDrawer .tbList{
  display:flex;
  flex-direction: column;
  gap: 10px;
}

.leefTopbarMount #tbDrawer .tbNavItem{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 12px;

  padding: 12px 12px;
  border-radius: 16px;

  text-decoration:none;
  color: rgba(235,255,245,0.92);
  font-weight: 900;

  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);

  transition: transform .16s ease, background .16s ease, border-color .16s ease;
}

.leefTopbarMount #tbDrawer .tbNavItem:hover{
  background: rgba(255,255,255,0.10);
  border-color: rgba(44,255,138,0.22);
  transform: translateY(-1px);
}

.leefTopbarMount #tbDrawer .tbNavLeft{
  display:flex;
  align-items:center;
  gap: 10px;
  min-width: 0;
}

.leefTopbarMount #tbDrawer .tbNavIcon{
  width: 32px;
  height: 32px;
  border-radius: 12px;
  background: rgba(0,0,0,0.12);
  border: 1px solid rgba(255,255,255,0.10);
  display:flex;
  align-items:center;
  justify-content:center;
  flex: 0 0 auto;
  font-size: 14px;
}

.leefTopbarMount #tbDrawer .tbNavLabel{
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Logout */
.leefTopbarMount #tbDrawer .tbNavItem.logout{
  background: rgba(255, 70, 70, 0.10);
  border-color: rgba(255, 70, 70, 0.22);
}
.leefTopbarMount #tbDrawer .tbNavItem.logout:hover{
  background: rgba(255, 70, 70, 0.16);
  border-color: rgba(255, 70, 70, 0.35);
}

/* ================= POLICIES DROPDOWN ================= */
.leefTopbarMount #tbDrawer .tbPoliciesWrap{
  display:flex;
  flex-direction: column;
  gap: 8px;
}

.leefTopbarMount #tbDrawer .tbPoliciesBtn{
  width: 100%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  color: rgba(235,255,245,0.92);

  padding: 12px 12px;
  border-radius: 16px;

  display:flex;
  align-items:center;
  justify-content: space-between;

  cursor:pointer;
  transition: background .16s ease, border-color .16s ease, transform .16s ease;

  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  font-weight: 900;
}

.leefTopbarMount #tbDrawer .tbPoliciesBtn:hover{
  background: rgba(255,255,255,0.10);
  border-color: rgba(44,255,138,0.22);
  transform: translateY(-1px);
}

.leefTopbarMount #tbDrawer .tbChev{ opacity: .9; transition: transform .18s ease; }
.leefTopbarMount #tbDrawer .tbPoliciesWrap.open .tbChev{ transform: rotate(180deg); }

.leefTopbarMount #tbDrawer .tbPoliciesSub{
  display:none;
  padding-left: 10px;
  gap: 8px;
  flex-direction: column;
}
.leefTopbarMount #tbDrawer .tbPoliciesWrap.open .tbPoliciesSub{ display:flex; }

.leefTopbarMount #tbDrawer .tbPoliciesSub a{
  padding: 10px 12px;
  border-radius: 16px;
  font-weight: 900;
  color: rgba(235,255,245,0.86);
  text-decoration:none;

  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);

  transition: background .16s ease, transform .16s ease, border-color .16s ease;
}
.leefTopbarMount #tbDrawer .tbPoliciesSub a:hover{
  background: rgba(255,255,255,0.08);
  border-color: rgba(44,255,138,0.16);
  transform: translateY(-1px);
}