/* ============================================================
   ReviewSignal.ai — Unified Navigation Bar
   One navbar to rule them all. Used on every public page.
   ============================================================ */

/* Hide old headers immediately (before JS removes them) to prevent FOUC */
header.header,
body > .container > div.header:first-child {
  display: none !important;
}

.rs-nav {
  position: sticky;
  top: 0;
  z-index: 9999;
  background: rgba(255, 252, 247, 0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  height: 64px;
  display: flex;
  align-items: center;
  padding: 0 2rem;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  transition: background 0.3s, border-color 0.3s;
}

/* Dark theme */
[data-theme="dark"] .rs-nav,
body:not([data-theme]) .rs-nav {
  background: rgba(10, 10, 15, 0.97);
  border-bottom-color: rgba(255,255,255,0.06);
}

.rs-nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* Left side: logo + theme toggle */
.rs-nav-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* Logo */
.rs-nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.rs-nav-logo img {
  height: 36px;
  width: auto;
}

.rs-nav-logo span {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-primary, #fff);
  background: linear-gradient(135deg, #ff00ff 0%, #8b5cf6 50%, #00e5ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Links */
.rs-nav-links {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}

.rs-nav-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary, #888);
  text-decoration: none;
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.rs-nav-link:hover {
  color: var(--text-primary, #fff);
  background: rgba(139, 92, 246, 0.08);
}

.rs-nav-link.active {
  color: #8b5cf6;
  background: rgba(139, 92, 246, 0.1);
}

/* Chain count badge */
.rs-chain-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  background: linear-gradient(135deg, #8b5cf6, #00e5ff);
  color: #000;
  line-height: 1;
}

/* Right actions */
.rs-nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

/* Theme toggle */
.rs-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  color: var(--text-secondary, #888);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 16px;
  padding: 0;
}

.rs-theme-toggle:hover {
  background: rgba(139, 92, 246, 0.15);
  border-color: rgba(139, 92, 246, 0.3);
  color: #8b5cf6;
}

/* CTA button */
.rs-nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, #ff00ff 0%, #8b5cf6 50%, #00e5ff 100%);
  color: #000 !important;
  padding: 0.55rem 1.4rem;
  border-radius: 999px;
  text-decoration: none !important;
  font-weight: 600;
  font-size: 0.85rem;
  transition: transform 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}

.rs-nav-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.4);
}

/* Hamburger */
.rs-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 10001;
}

.rs-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary, #fff);
  border-radius: 2px;
  transition: all 0.3s;
}

/* Hamburger X animation when open */
.rs-hamburger.open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.rs-hamburger.open span:nth-child(2) {
  opacity: 0;
}
.rs-hamburger.open span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile menu */
.rs-mobile-menu {
  display: none;
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 10, 15, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 9998;
  padding: 1.5rem;
  flex-direction: column;
  gap: 0.25rem;
  overflow-y: auto;
  animation: rs-slide-down 0.25s ease-out;
}

@keyframes rs-slide-down {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.rs-mobile-menu.open {
  display: flex;
}

.rs-mobile-menu .rs-nav-link {
  font-size: 1.15rem;
  padding: 1rem 1.2rem;
  border-radius: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.rs-mobile-menu .rs-nav-link:hover,
.rs-mobile-menu .rs-nav-link.active {
  background: rgba(139, 92, 246, 0.12);
}

.rs-mobile-menu .rs-nav-link .rs-chain-count {
  font-size: 0.75rem;
  height: 22px;
  padding: 0 7px;
}

.rs-mobile-menu .rs-nav-cta {
  margin-top: 1.5rem;
  text-align: center;
  justify-content: center;
  padding: 1rem 2rem;
  font-size: 1.05rem;
  border-radius: 16px;
}

.rs-mobile-menu .rs-theme-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.2rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: var(--text-secondary, #888);
  font-size: 1.15rem;
  font-weight: 500;
}

.rs-mobile-menu .rs-theme-toggle-mobile {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  color: var(--text-secondary, #888);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  padding: 0;
  transition: all 0.2s;
}

.rs-mobile-menu .rs-theme-toggle-mobile:hover {
  background: rgba(139, 92, 246, 0.15);
  color: #8b5cf6;
}

/* Breadcrumb */
.rs-breadcrumb {
  padding: 0.6rem 2rem;
  font-size: 0.82rem;
  color: var(--text-secondary, #888);
  max-width: 1280px;
  margin: 0 auto;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.rs-breadcrumb a {
  color: #8b5cf6;
  text-decoration: none;
}

.rs-breadcrumb a:hover {
  text-decoration: underline;
}

.rs-breadcrumb .sep {
  margin: 0 0.4rem;
  opacity: 0.4;
}

/* Futures sub-bar */
.rs-futures-bar {
  background: linear-gradient(90deg, rgba(139,92,246,0.12) 0%, rgba(0,229,255,0.08) 100%);
  border-bottom: 1px solid rgba(139,92,246,0.15);
  padding: 0.5rem 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.85rem;
}

.rs-futures-badge {
  background: linear-gradient(135deg, #8b5cf6, #00e5ff);
  color: #000;
  padding: 2px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 1px;
}

.rs-futures-tokens {
  color: var(--text-secondary, #888);
}

/* ============================================================
   Floating Home Button (FAB)
   Appears after scrolling down 300px. Click to scroll to top.
   Shows on every page, desktop + mobile.
   ============================================================ */
.rs-fab-home {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9990;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, #ff00ff 0%, #8b5cf6 50%, #00e5ff 100%);
  color: #000;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4), 0 2px 8px rgba(0,0,0,0.3);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s, box-shadow 0.3s;
  opacity: 0;
  transform: scale(0.6) translateY(20px);
  pointer-events: none;
  -webkit-tap-highlight-color: transparent;
}

.rs-fab-home.visible {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: auto;
}

.rs-fab-home:hover {
  transform: scale(1.1) translateY(-2px);
  box-shadow: 0 6px 28px rgba(139, 92, 246, 0.55), 0 3px 12px rgba(0,0,0,0.3);
}

.rs-fab-home:active {
  transform: scale(0.95);
}

.rs-fab-home svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Tooltip on hover (desktop only) */
.rs-fab-home::after {
  content: 'Back to top';
  position: absolute;
  right: 62px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.85);
  color: #fff;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.rs-fab-home:hover::after {
  opacity: 1;
}

/* On chain detail pages, show "Home" tooltip instead */
.rs-fab-home.go-home::after {
  content: 'Go Home';
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .rs-nav-links {
    display: none;
  }

  /* Hide CTA on mobile (it's in hamburger menu) */
  .rs-nav-actions {
    display: none;
  }

  .rs-hamburger {
    display: flex;
  }

  .rs-nav {
    padding: 0 1rem;
  }

  /* Theme toggle always visible next to logo */
  .rs-nav-left .rs-theme-toggle {
    display: inline-flex !important;
  }

  .rs-breadcrumb {
    padding: 0.5rem 1rem;
    font-size: 0.78rem;
  }

  .rs-fab-home {
    bottom: 20px;
    right: 16px;
    width: 48px;
    height: 48px;
  }

  .rs-fab-home::after {
    display: none; /* No tooltip on mobile — touch only */
  }
}

@media (max-width: 480px) {
  .rs-nav-cta {
    font-size: 0.78rem;
    padding: 0.5rem 1rem;
  }

  .rs-nav-logo span {
    display: none;
  }

  .rs-fab-home {
    bottom: 16px;
    right: 12px;
    width: 44px;
    height: 44px;
  }
}
