/* ══════════════════════════════════════════════════
   IINL – Top Bar with Small Title + Pill Navigation
══════════════════════════════════════════════════ */

/* ── TOP BAR WRAPPER ─────────────────────────────── */
.topbar {
  position: fixed;
  top: 0;
  left: var(--sb-w);
  right: 0;
  height: var(--topbar-h);
  z-index: 150;
  display: flex;
  align-items: center;
  padding: 0 2rem;
  transition: left var(--dur-slow) var(--ease);
  pointer-events: none;
}

.sidebar:hover ~ .main-area .topbar {
  left: var(--sb-w-open);
}

/* ── TOP BAR INNER ───────────────────────────────── */
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  pointer-events: all;
}

/* ── LEFT: SITE TITLE ────────────────────────────── */
.topbar-brand {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.topbar-brand-name {
  font-family: var(--font-head);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--text-light);
}
.topbar-brand-sub {
  font-size: .58rem;
  color: var(--text-xlight);
  letter-spacing: .1em;
}

/* ── CENTER: PILL NAV ────────────────────────────── */
.topbar-nav {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  background: #111827;
  border-radius: 50px;
  padding: 4px 5px;
  gap: 2px;
  box-shadow: 0 8px 32px rgba(0,0,0,.22), 0 2px 8px rgba(0,0,0,.15),
              inset 0 1px 0 rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.07);
}

.topbar-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 5px 12px;
  border-radius: 40px;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease);
  text-decoration: none;
  border: none;
  background: transparent;
  white-space: nowrap;
  position: relative;
}
.topbar-nav-item:hover { background: rgba(255,255,255,.08); }
.topbar-nav-item.active { background: rgba(255,255,255,.12); }

.tn-dot {
  width: 4px; height: 4px;
  border-radius: 50%;
  background: rgba(255,255,255,.25);
  transition: all var(--dur-fast) var(--ease);
}
.topbar-nav-item:hover .tn-dot,
.topbar-nav-item.active .tn-dot {
  background: var(--saffron);
  box-shadow: 0 0 6px var(--saffron);
}

.tn-label {
  font-family: var(--font-head);
  font-size: .58rem;
  font-weight: 700;
  color: rgba(255,255,255,.5);
  letter-spacing: .1em;
  text-transform: uppercase;
  transition: color var(--dur-fast) var(--ease);
  line-height: 1;
}
.topbar-nav-item:hover .tn-label,
.topbar-nav-item.active .tn-label {
  color: rgba(255,255,255,.92);
}

/* ── RIGHT: ACTIONS ──────────────────────────────── */
.topbar-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
}
.topbar-search-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--white);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease);
  color: var(--text-mid);
}
.topbar-search-btn:hover { border-color: var(--saffron); color: var(--saffron); }
.topbar-search-btn svg { width: 15px; height: 15px; }

/* Visitor badge */
.topbar-visitor {
  display: flex;
  align-items: center;
  gap: .45rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: .35rem .9rem;
  font-size: .7rem;
  color: var(--text-mid);
  box-shadow: var(--shadow-xs);
}
.topbar-visitor .live-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green);
  animation: pulse 2s ease infinite;
}
.topbar-visitor strong { color: var(--text-dark); }

/* Topbar glass effect on scroll */
.topbar.scrolled .topbar-inner {
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(16px);
  border-radius: 50px;
  padding: .4rem 1rem;
  box-shadow: 0 4px 20px rgba(0,0,0,.08);
}

/* ── SEARCH MODAL ────────────────────────────────── */
.search-modal {
  position: fixed; inset: 0;
  background: rgba(15,23,42,.7);
  backdrop-filter: blur(8px);
  z-index: 400;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 6rem 1.5rem 1.5rem;
  animation: fadeIn var(--dur-fast) var(--ease);
}
.search-modal-panel {
  background: var(--white);
  border-radius: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 560px;
  padding: 1.5rem;
  animation: slideDown var(--dur-base) var(--ease-spring);
}
.search-modal-input-wrap {
  display: flex;
  align-items: center;
  gap: .75rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
  margin-bottom: 1rem;
}
.search-modal-input-wrap svg { width: 20px; height: 20px; color: var(--text-light); flex-shrink: 0; }
.search-modal-input {
  flex: 1;
  font-size: 1.1rem;
  border: none;
  outline: none;
  color: var(--text-dark);
  background: transparent;
}
.search-modal-input::placeholder { color: var(--text-light); }
.search-modal-hint { font-size: .75rem; color: var(--text-light); }

/* ── RESPONSIVE ──────────────────────────────────── */
@media (max-width: 1100px) {
  .topbar-visitor { display: none; }
  .topbar-nav-item { padding: 5px 9px; }
  .tn-label { font-size: .52rem; }
}

@media (max-width: 768px) {
  .topbar { left: 0; padding: 0 1rem; }
  .topbar-brand { display: none; }
  .topbar-nav {
    position: relative;
    left: auto;
    transform: none;
    overflow-x: auto;
    scrollbar-width: none;
    border-radius: 50px;
    max-width: calc(100vw - 120px);
  }
  .topbar-nav::-webkit-scrollbar { display: none; }
  .topbar-inner { justify-content: center; }
  .topbar-actions { display: none; }
}

@media (max-width: 480px) {
  .tn-label { display: none; }
  .topbar-nav-item { padding: 6px 10px; }
  .tn-dot { width: 6px; height: 6px; }
}
