/**
 * Philly BitDevs — base stylesheet
 * Mempool block-explorer aesthetic. Dark, dense, monospace numerics,
 * teal/orange/magenta accents.
 */

:root {
  --bg:        #11141b;
  --bg-2:      #181c25;
  --bg-3:      #20252f;
  --line:      #2a2f3b;
  --line-soft: #1f242f;
  --text:      #e6e9ef;
  --muted:     #7d8597;
  --subtle:    #4f5667;
  --teal:      #2bd5b3;
  --teal-soft: rgba(43, 213, 179, 0.2);
  --magenta:   #ff5fa2;
  --orange:    #ffa53e;
  --green:     #6fd47e;
  --red:       #ff6b6b;
  --purple:    #b48aff;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.mono { font-family: var(--font-mono); }

a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

code, kbd {
  font-family: var(--font-mono);
  font-size: 0.92em;
  background: var(--bg-3);
  border: 1px solid var(--line);
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  color: var(--teal);
}

/* Top bar (used by index + admin) */
nav {
  border-bottom: 1px solid var(--line);
  padding: 0.6rem 1.5rem;
  display: flex;
  align-items: center;
  min-height: 52px;
  gap: 2rem;
  background: var(--bg-2);
  position: sticky;
  top: 0;
  z-index: 100;
}

/* nostrAuth.js renders its UI here with hardcoded MIM-neon inline styles.
   We override aggressively so the auth buttons match the mempool theme. */
#nostr-auth-container > div {
  flex-direction: row !important;
  flex-wrap: wrap;
  align-items: center !important;
  gap: 0.4rem !important;
  justify-content: flex-end;
}

/* All buttons + links inside the auth container — uniform pill style */
#nostr-auth-container button,
#nostr-auth-container a {
  background: var(--bg-3) !important;
  border: 1px solid var(--line) !important;
  border-radius: 4px !important;
  color: var(--muted) !important;
  padding: 0.4rem 0.8rem !important;
  font-family: var(--font-mono) !important;
  font-size: 0.78rem !important;
  font-weight: 500 !important;
  letter-spacing: 0.02em !important;
  text-decoration: none !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.35rem !important;
  transition: all 0.15s ease !important;
  box-shadow: none !important;
  margin: 0 !important;
  text-shadow: none !important;
  filter: none !important;
  text-transform: none !important;
}
#nostr-auth-container button:hover,
#nostr-auth-container a:hover {
  border-color: var(--teal) !important;
  color: var(--teal) !important;
  background: var(--bg-3) !important;
  box-shadow: none !important;
}

/* First button = the most likely sign-in path (Connect if extension is
   detected, else nsec). Make it the primary CTA in teal. */
#nostr-auth-container > div > button:first-child {
  background: var(--teal) !important;
  border-color: var(--teal) !important;
  color: var(--bg) !important;
  font-weight: 600 !important;
}
#nostr-auth-container > div > button:first-child:hover {
  background: #4ee5c4 !important;
  border-color: #4ee5c4 !important;
  color: var(--bg) !important;
  box-shadow: 0 0 16px rgba(43, 213, 179, 0.3) !important;
}

/* Hide the "New to Nostr? Create a key" external link — clutter for an
   admin sign-in surface. nostrAuth renders it as an <a> with target=_blank. */
#nostr-auth-container > div > a[target="_blank"] {
  display: none !important;
}

/* "▾ more" chevron + popover for alternative sign-in methods.
   auth-ui.js wraps nostrAuth's output to expose just the primary button + this. */
#nostr-auth-container .auth-primary-group {
  position: relative;
  display: inline-flex;
  align-items: stretch;
  gap: 0;
}
#nostr-auth-container .auth-more {
  background: var(--bg-3) !important;
  border: 1px solid var(--line) !important;
  border-left: none !important;
  border-radius: 0 4px 4px 0 !important;
  color: var(--muted) !important;
  padding: 0.4rem 0.55rem !important;
  font-family: var(--font-mono) !important;
  font-size: 0.78rem !important;
  cursor: pointer !important;
  margin: 0 !important;
  transition: all 0.15s ease !important;
}
#nostr-auth-container .auth-more:hover {
  border-color: var(--teal) !important;
  color: var(--teal) !important;
}
/* Make the primary button (first child of group) flush with the chevron */
#nostr-auth-container .auth-primary-group > button:first-child {
  border-radius: 4px 0 0 4px !important;
}
#nostr-auth-container .auth-popover {
  position: absolute;
  top: calc(100% + 0.45rem);
  right: 0;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.45rem;
  display: none;
  flex-direction: column !important;
  gap: 0.35rem !important;
  min-width: 200px;
  z-index: 200;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
}
#nostr-auth-container .auth-popover.open { display: flex; }
#nostr-auth-container .auth-popover button,
#nostr-auth-container .auth-popover a {
  width: 100%;
  justify-content: flex-start !important;
  text-align: left !important;
}
nav .nav-content {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 2rem;
}
nav .logo {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
nav .logo .pre { color: var(--teal); }
nav .logo .post { color: var(--muted); font-weight: 400; }
nav .nav-links {
  display: flex;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
}
nav .nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 0.4rem 0.7rem;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}
nav .nav-links a:hover { color: var(--text); }
nav .nav-links a.active {
  color: var(--text);
  background: var(--bg-3);
}
nav .net {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}
nav .net::before {
  content: '';
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 8px var(--teal);
}

/* Buttons */
.btn-primary, .btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 500;
  border-radius: 4px;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid;
  transition: all 0.15s ease;
  letter-spacing: 0.02em;
}
.btn-primary {
  background: var(--teal);
  color: var(--bg);
  border-color: var(--teal);
  font-weight: 600;
}
.btn-primary:hover {
  background: #4ee5c4;
  border-color: #4ee5c4;
  text-decoration: none;
  box-shadow: 0 0 20px rgba(43, 213, 179, 0.3);
}
.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
}
.btn-secondary:hover {
  border-color: var(--text);
  color: var(--text);
  text-decoration: none;
}
.btn-small { padding: 0.35rem 0.8rem; font-size: 0.78rem; }
button { font-family: inherit; }
button:disabled { opacity: 0.4; cursor: not-allowed; }

/* Panel — used everywhere */
.panel {
  border: 1px solid var(--line);
  background: var(--bg-2);
  border-radius: 4px;
  margin-bottom: 1.5rem;
  overflow: hidden;
}
.panel-header {
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-3);
  gap: 1rem;
  flex-wrap: wrap;
}
.panel-header h2 {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  margin: 0;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 500;
}
.panel-header .right {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--subtle);
}
.panel-content { padding: 1.25rem 1.5rem; }
.panel-content p { margin: 0 0 0.75rem; color: var(--text); }
.panel-content p:last-child { margin-bottom: 0; }
.panel-content .muted { color: var(--muted); font-size: 0.92rem; }

/* Hamburger / mobile menu (kept for compatibility) */
.hamburger { display: none; }
.mobile-menu { display: none; }
