/* ============================================================
   shared.css — top navigation + footer
   Used by index.html, how-it-works.html and swap-and-bridge-guide.html
   so the three pages always share the exact same footer.
   (CSP: style-src 'self' already allows this file.)
   ============================================================ */

/* ---- Top navigation bar ---- */
.topnav {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  display: flex;
  justify-content: center;
  background: rgba(13, 11, 30, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.topnav-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 20px;
  max-width: 680px;
  width: 100%;
  height: 48px;
}

/* Brand (logo + title) pinned to the left of the bar. It is taken out of the
   flow (position: absolute), so the links in .topnav-inner stay centered.
   index.html and how-it-works.html add it as the first child of <nav>. */
.topnav-brand {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  color: #c7f284;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
}
.topnav-brand img {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}
.topnav-brand:hover span {
  color: #d8f89e;
}
/* Narrow desktop windows: logo only, so the title never touches the links */
@media (max-width: 900px) {
  .topnav-brand span {
    display: none;
  }
}

.topnav-link {
  color: #c7f284;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  letter-spacing: 0.01em;
  transition: background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}
.topnav-link:hover,
.topnav-link.active {
  background: rgba(199, 242, 132, 0.12);
  color: #d8f89e;
}
.topnav-icon {
  display: none;
  color: rgba(232, 249, 255, 0.55);
  transition: color 0.15s ease;
}
.topnav-link:hover .topnav-icon,
.topnav-link.active .topnav-icon {
  color: #c7f284;
}

@media (max-width: 640px) {
  .topnav {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    border-bottom: none;
    background: linear-gradient(rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.05)), #0d0b1e;
  }
  /* On phones the bar is at the bottom, so the brand stays in the page header */
  .topnav-brand {
    display: none;
  }
  .topnav-inner {
    height: 60px;
    padding: 0 2px;
    gap: 0;
  }
  .topnav-link {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: 9.8px;
    line-height: 1.15;
    padding: 6px 1px;
    white-space: normal;
    text-align: center;
  }
  .topnav-icon {
    display: block;
    width: 20px;
    height: 20px;
  }
}

/* ---- Sortable table headers (Top 100: 24h Change, 24h Volume, Liquidity) ----
   The headers are marked by app.js. Plain CSS only, so the CSP is unaffected. */
.top100-table th.sortable {
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: color 0.15s ease, background 0.15s ease;
}
.top100-table th.sortable:hover,
.top100-table th.sortable:focus-visible {
  color: #e8f9ff;
  background: rgba(199, 242, 132, 0.06);
  outline: none;
}
.top100-table th.sortable .sort-arrow {
  display: inline-block;
  margin-left: 2px;
  font-size: 11px;
  opacity: 0.45;
}
.top100-table th.sortable.sorted {
  color: #c7f284;
}
.top100-table th.sortable.sorted .sort-arrow {
  opacity: 1;
}

/* ---- Footer ---- */
footer {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 28px 0 8px 0;
  text-align: center;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  color: #c7f284;
}
.footer-brand .brand-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}
.jupiter-logo-img {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  flex-shrink: 0;
  vertical-align: middle;
}
.footer-powered {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14.5px;
  color: rgba(232, 249, 255, 0.5);
}
.footer-powered a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #e8f9ff;
  font-weight: 700;
  text-decoration: none;
}
.footer-powered a:hover {
  text-decoration: underline;
}
.footer-copy {
  margin: 0;
  font-size: 13px;
  color: rgba(232, 249, 255, 0.3);
}
.footer-contact-line {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
}
.footer-contact-sep {
  color: rgba(232, 249, 255, 0.25);
}
.footer-contact-email {
  color: rgba(232, 249, 255, 0.45);
  text-decoration: underline;
}
.social-link-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(232, 249, 255, 0.45);
  transition: color 0.15s ease;
}
.social-link-inline:hover {
  color: #c7f284;
}
.social-link-inline svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}
