/* ========================================================================
   CYBERJUNIOR — HEADER STYLES
   Covers: status ticker, floating pill header, theme-swapping logo,
   nav, theme toggle, currency switcher, floating login, mobile drawer.
======================================================================== */

/* ========================================================================
   STATUS TICKER
======================================================================== */
.cj-strip {
  border-bottom: 1px solid var(--hair);
  background: var(--raised);
  overflow: hidden;
  padding-block: 8px;
  position: relative;
}
.cj-strip-track {
  display: flex;
  width: max-content;
  animation: cj-marquee 34s linear infinite;
}
.cj-strip-run {
  display: flex;
  align-items: center;
  gap: 36px;
  padding-right: 36px;
  font-size: 12px;
  color: var(--text-sub);
  white-space: nowrap;
}
.cj-strip-run b { color: var(--text); font-family: var(--display); font-weight: 600; }
.cj-strip-run i { color: var(--brand-hair); font-style: normal; }
@keyframes cj-marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.cj-strip:hover .cj-strip-track { animation-play-state: paused; }

/* ========================================================================
   HEADER SHELL
======================================================================== */
.cj-header {
  position: fixed;
  top: 48px;
  left: 0;
  width: 100%;
  z-index: 1000;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-inline: 16px;
  transition: top .34s cubic-bezier(.16, 1, .3, 1);
}
.cj-header.is-stuck { top: 12px; }

.cj-bar {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  max-width: calc(100% - 20px);
  padding: 6px 10px 6px 18px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid transparent;
  transition: background .34s ease, border-color .34s ease, box-shadow .34s ease, backdrop-filter .34s ease;
}
.cj-header.is-stuck .cj-bar {
  background: var(--pill);
  border-color: var(--brand-hair);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* ========================================================================
   LOGO — theme swapping
======================================================================== */
.cj-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.cj-logo__img {
  height: 30px;
  width: auto;
  object-fit: contain;
  transition: opacity .25s ease;
}

/* Dark theme → white logo */
html[data-theme="dark"] .cj-logo__img--light { display: none !important; }
html[data-theme="dark"] .cj-logo__img--dark  { display: block; }

/* Light theme → blue logo */
html[data-theme="light"] .cj-logo__img--dark  { display: none !important; }
html[data-theme="light"] .cj-logo__img--light { display: block; }

/* Text fallback (only visible if both PNGs fail to load) */
.cj-logo-alt { display: none; align-items: center; gap: 8px; }
.cj-logo-badge {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  background: var(--brand);
  color: #fff;
  border-radius: 7px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 13px;
}
.cj-logo-word {
  font-family: var(--display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.02em;
  color: var(--text);
}

.cj-rule {
  width: 1px;
  height: 18px;
  background: var(--hair);
  flex-shrink: 0;
}

/* ========================================================================
   PRIMARY NAV
======================================================================== */
.cj-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.cj-nav a {
  position: relative;
  padding: 7px 13px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-sub);
  white-space: nowrap;
  border-radius: 8px;
  transition: color .2s ease;
}
.cj-nav a::after {
  content: '';
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 1px;
  height: 2px;
  background: var(--brand);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .25s cubic-bezier(0.16, 1, 0.3, 1);
}
.cj-nav a:not([aria-current="page"]):hover { color: var(--text); }
.cj-nav a:not([aria-current="page"]):hover::after { transform: scaleX(1); }
.cj-nav a[aria-current="page"] { color: var(--brand); font-weight: 600; }
.cj-nav a[aria-current="page"]::after { transform: scaleX(1); }

/* ========================================================================
   THEME TOGGLE BUTTON
======================================================================== */
.cj-icon-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--hair);
  background: var(--control);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color .2s ease, color .2s ease, background .2s ease;
}
.cj-icon-btn:hover { border-color: var(--brand); color: var(--brand); }

/* ========================================================================
   CURRENCY SWITCHER
======================================================================== */
.cj-currency {
  display: inline-flex;
  align-items: center;
  background: var(--control);
  border: 1px solid var(--hair);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
  flex-shrink: 0;
}
.cj-currency__btn {
  padding: 6px 12px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text-sub);
  font-family: var(--display);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: all .2s ease;
  white-space: nowrap;
}
.cj-currency__btn:hover { color: var(--text); }
.cj-currency__btn.is-active {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 2px 8px var(--brand-hair);
}
.cj-currency--drawer {
  align-self: flex-start;
  margin-top: 8px;
  margin-bottom: 4px;
}

/* ========================================================================
   LOGIN — drawer link
======================================================================== */
.cj-drawer-login {
  display: block;
  padding: 11px 14px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--brand-lift);
  border: 1px dashed var(--brand-hair);
  margin-bottom: 8px;
  transition: background .2s ease;
}
.cj-drawer-login:hover {
  background: var(--brand-wash);
  color: var(--brand);
}

/* ========================================================================
   FLOATING LOGIN BUTTON
   Sits at bottom-right. Chat widget (in main.css) sits ABOVE it.
======================================================================== */
.cj-login-float {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 951;
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px 14px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-deep) 100%);
  color: #fff;
  font-family: var(--display);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-decoration: none;
  box-shadow:
    0 8px 28px var(--brand-hair),
    0 0 0 0 var(--brand-glow);
  transition: transform .25s cubic-bezier(.16, 1, .3, 1),
              box-shadow .25s ease,
              padding .25s ease;
  animation: cj-login-glow 2.4s ease-in-out infinite;
}

.cj-login-float:hover {
  transform: translateY(-3px);
  padding: 14px 26px 14px 14px;
  box-shadow:
    0 14px 40px var(--brand-glow),
    0 0 0 6px rgba(137, 21, 240, 0.08);
}

.cj-login-float__icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  display: grid;
  place-items: center;
  font-size: 13px;
  flex-shrink: 0;
  transition: background .2s ease;
}
.cj-login-float:hover .cj-login-float__icon {
  background: rgba(255, 255, 255, 0.28);
}

.cj-login-float__label { white-space: nowrap; }

.cj-login-float__pulse {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--brand);
  opacity: 0.35;
  z-index: -1;
  pointer-events: none;
  animation: cj-login-pulse 2.4s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}

@keyframes cj-login-pulse {
  0%   { transform: scale(1);    opacity: 0.35; }
  70%  { transform: scale(1.15); opacity: 0; }
  100% { transform: scale(1.15); opacity: 0; }
}

@keyframes cj-login-glow {
  0%, 100% {
    box-shadow:
      0 8px 28px var(--brand-hair),
      0 0 0 0 var(--brand-glow);
  }
  50% {
    box-shadow:
      0 10px 34px var(--brand-glow),
      0 0 0 8px rgba(137, 21, 240, 0.06);
  }
}

/* ========================================================================
   MOBILE BURGER
======================================================================== */
.cj-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 34px;
  height: 34px;
  padding: 7px;
  background: transparent;
  border: none;
  cursor: pointer;
}
.cj-burger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .25s ease, opacity .2s ease;
}
.cj-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.cj-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.cj-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ========================================================================
   MOBILE DRAWER
======================================================================== */
.cj-drawer {
  pointer-events: auto;
  display: none;
  flex-direction: column;
  gap: 3px;
  width: min(310px, calc(100vw - 32px));
  margin-top: 10px;
  padding: 14px;
  border-radius: 20px;
  background: var(--pill);
  border: 1px solid var(--brand-hair);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}
.cj-drawer.is-open { display: flex; }
.cj-drawer a {
  padding: 11px 14px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-sub);
}
.cj-drawer a:hover {
  background: var(--brand-wash);
  color: var(--brand);
}
.cj-drawer a[aria-current="page"] {
  color: var(--brand);
  font-weight: 600;
}

/* ========================================================================
   RESPONSIVE
======================================================================== */
@media (max-width: 900px) {
  .cj-nav,
  .cj-rule,
  .cj-bar > .btn { display: none !important; }
  .cj-burger { display: flex; }
  .cj-header .cj-currency { display: none; }
}

@media (max-width: 720px) {
  .cj-login-float { padding: 12px; }
  .cj-login-float__label { display: none; }
  .cj-login-float__icon { width: 30px; height: 30px; }
}

/* Push the login button up on very narrow screens so it clears the burger
   and any OS-level navigation bars. */
@media (max-width: 400px) {
  .cj-login-float { bottom: 78px; }
}