/* ============================================================
   topbar.css  —  Single-row: red ticker LEFT | purple portals RIGHT
   Mobile: portals collapse into a toggle → full-width dropdown
   ============================================================ */

/* ── Wrapper: one solid row, never wraps ─────────────────── */
.topbar-bar {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  width: 100%;
  height: 36px;
  overflow: visible;           /* let dropdown hang below */
  position: relative;
  z-index: 1100;
  flex-wrap: nowrap;           /* NEVER wrap — ticker always left */
}

/* ══════════════════════════════════════════════════════════
   LEFT — Red ticker (takes all remaining space)
══════════════════════════════════════════════════════════ */
.tb-left {
  display: flex;
  align-items: center;
  background: #d20f0c;
  flex: 1 1 0%;               /* grow to fill space */
  min-width: 0;
  overflow: hidden;
  height: 36px;
}

.tb-news-badge {
  flex-shrink: 0;
  background: rgba(0,0,0,0.28);
  color: #fff;
  font-family: 'Poppins', sans-serif;
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 0 11px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  border-right: 1px solid rgba(255,255,255,0.25);
  margin-right: 10px;
}

.tb-ticker-track {
  flex: 1 1 0%;
  min-width: 0;
  overflow: hidden;
  height: 100%;
  display: flex;
  align-items: center;
}

.tb-ticker-inner {
  display: inline-flex;
  white-space: nowrap;
  animation: tbScroll 40s linear infinite;
}

.tb-ticker-track:hover .tb-ticker-inner {
  animation-play-state: paused;
}

.tb-ticker-inner span {
  font-family: 'Poppins', sans-serif;
  font-size: 0.7rem;
  color: #fff;
  padding-right: 56px;
  display: inline-block;
  white-space: nowrap;
}

@keyframes tbScroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ══════════════════════════════════════════════════════════
   RIGHT — Purple portals (fixed width, never moves)
══════════════════════════════════════════════════════════ */
.tb-right {
  display: flex;
  align-items: stretch;
  background: #582b84;
  flex-shrink: 0;
  flex-grow: 0;
  height: 36px;
  position: relative;         /* anchor for dropdown */
}

/* ── Desktop: all 5 links in a horizontal row ─────────────── */
.tb-portals {
  display: flex;
  align-items: stretch;
  height: 36px;
}

.tb-portals a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: 'Poppins', sans-serif;
  font-size: 0.67rem;
  font-weight: 600;
  color: rgba(255,255,255,0.9);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 0 11px;
  height: 36px;
  border-left: 1px solid rgba(255,255,255,0.2);
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.tb-portals a:first-child    { border-left: none; }
.tb-portals a i              { font-size: 0.58rem; opacity: 0.85; }
.tb-portals a:hover          { background: rgba(255,255,255,0.13); color: #ffed00; }

/* Toggle button — hidden on desktop */
.tb-toggle-btn { display: none; }

/* ══════════════════════════════════════════════════════════
   TABLET ≤ 900px — shrink link text slightly
══════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .tb-portals a   { font-size: 0.6rem; padding: 0 8px; gap: 3px; }
  .tb-news-badge  { padding: 0 9px; font-size: 0.62rem; }
}

/* ══════════════════════════════════════════════════════════
   MOBILE ≤ 640px
   • Ticker stays LEFT in the same row (never moves)
   • All 5 portal links hidden behind toggle button
   • Toggle button sits on the RIGHT of the bar
   • Clicking drops a full-width panel BELOW the bar
══════════════════════════════════════════════════════════ */
@media (max-width: 640px) {

  /* Bar stays as one row — no wrapping */
  .topbar-bar {
    height: 36px;
    overflow: visible;
  }

  /* Ticker: fills remaining space, no diagonal cut */
  .tb-left {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
  }

  /* Right zone: only the toggle button */
  .tb-right {
    flex: 0 0 auto;
    background: #582b84;
    height: 36px;
  }

  /* HIDE portal links — become a dropdown panel */
  .tb-portals {
    display: none;               /* hidden by default */
    position: fixed;             /* fixed so it always anchors to viewport */
    top: 36px;                   /* right below the bar */
    left: 0;
    right: 0;
    width: 100%;
    height: auto;
    flex-wrap: wrap;
    background: #3a1a6e;
    z-index: 9999;
    box-shadow: 0 6px 20px rgba(0,0,0,0.35);
    border-top: 2px solid #ffed00;
  }

  /* When toggled open, show as flex */
  .tb-portals.tb-open {
    display: flex;
  }

  /* Each link: 50% width so 2 per row, last one centred */
  .tb-portals a {
    flex: 0 0 50%;
    height: 42px;
    border-left: none;
    border-bottom: 1px solid rgba(255,255,255,0.12);
    border-right: 1px solid rgba(255,255,255,0.12);
    justify-content: center;
    font-size: 0.72rem;
    padding: 0 8px;
    text-align: center;
  }

  /* 5th link spans full width */
  .tb-portals a:nth-child(5) {
    flex: 0 0 100%;
    border-right: none;
  }

  /* Show toggle button */
  .tb-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 36px;
    padding: 0 13px;
    background: rgba(255,255,255,0.1);
    border: none;
    border-left: 1px solid rgba(255,255,255,0.25);
    color: #fff;
    font-family: 'Poppins', sans-serif;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
    flex-shrink: 0;
  }
  .tb-toggle-btn:hover      { background: rgba(255,255,255,0.2); }
  .tb-toggle-btn i          { font-size: 0.62rem; }

  /* Shrink ticker text */
  .tb-ticker-inner span     { font-size: 0.65rem; padding-right: 30px; }
  .tb-news-badge            { font-size: 0.58rem; padding: 0 7px; margin-right: 6px; }
}

/* ══════════════════════════════════════════════════════════
   VERY SMALL ≤ 380px
══════════════════════════════════════════════════════════ */
@media (max-width: 380px) {
  .tb-news-badge            { display: none; }
  .tb-portals a             { flex: 0 0 100%; border-right: none; }
  .tb-portals a:nth-child(5){ flex: 0 0 100%; }
}