/* MoneroUSD Block Explorer - Dark Theme */

:root {
  --bg: #0d1117;
  --bg-card: #161b22;
  --bg-header: #010409;
  --border: #30363d;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --accent: #58a6ff;
  --accent-hover: #79c0ff;
  --green: #3fb950;
  --red: #f85149;
  --orange: #d29922;
  --gold: #b8860b;
  --radius: 6px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
}

/* Header */
header {
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.logo {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.logo-sub {
  color: var(--text-muted);
  font-weight: 400;
}

.header-nav {
  display: flex;
  gap: 16px;
  align-items: center;
}

.header-nav a {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.15s;
}

.header-nav a:hover {
  color: var(--accent);
  text-decoration: none;
}

.search-form {
  display: flex;
  flex: 1;
  max-width: 600px;
}

.search-wrapper {
  position: relative;
  flex: 1;
}

.search-form input {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-right: none;
  border-radius: var(--radius) 0 0 var(--radius);
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
}

.search-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  z-index: 100;
  max-height: 400px;
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.sd-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  text-decoration: none;
  color: var(--text);
  transition: background 0.1s;
  cursor: pointer;
}

.sd-item:hover, .sd-item.sd-active {
  background: rgba(88, 166, 255, 0.08);
}

.sd-item + .sd-item {
  border-top: 1px solid rgba(48, 54, 61, 0.5);
}

.sd-logo {
  width: 28px;
  height: 28px;
  max-width: 28px;
  max-height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: contain;
  overflow: hidden;
}

.sd-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.sd-name {
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sd-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(184, 134, 11, 0.2);
  color: var(--gold);
  border: 1px solid rgba(184, 134, 11, 0.4);
  border-radius: 3px;
  font-size: 10px;
  padding: 0 4px;
  line-height: 16px;
}

.sd-sym {
  font-size: 0.78rem;
  color: var(--accent);
  font-weight: 500;
}

.sd-issuer {
  font-size: 0.75rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.search-form input:focus {
  border-color: var(--accent);
}

.search-form button {
  padding: 8px 18px;
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
}

.search-form button:hover {
  background: var(--accent-hover);
}

/* Main */
main {
  flex: 1;
  padding: 24px 0;
}

/* Footer */
footer {
  border-top: 1px solid var(--border);
  padding: 18px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Headings */
h2 {
  font-size: 1.4rem;
  margin-bottom: 16px;
  color: var(--text);
}

h3 {
  font-size: 1.15rem;
  margin-bottom: 12px;
  color: var(--text);
}

section {
  margin-bottom: 32px;
}

/* Info Grid (v1.2.207 Sovereign Tech polish) */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
}

.info-card {
  background: linear-gradient(180deg, var(--bg-card) 0%, rgba(0,0,0,0.18) 100%);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
  transition: transform 180ms ease-out, border-color 180ms ease-out, box-shadow 180ms ease-out;
}
.info-card::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--orange, #ff6600);
  opacity: 0.55;
  border-radius: 0 2px 2px 0;
}
.info-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 102, 0, 0.32);
  box-shadow: 0 12px 28px rgba(0,0,0,0.45), 0 0 14px rgba(255,102,0,0.12);
}
@media (prefers-reduced-motion: reduce) {
  .info-card { transition: none !important; }
  .info-card:hover { transform: none !important; }
}

.info-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.info-value {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text);
  font-family: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

/* Tables */
.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  text-align: left;
  padding: 10px 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}

tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

tbody tr:hover {
  background: rgba(88, 166, 255, 0.04);
}

/* Detail table (key-value) */
.detail-table {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
}

.detail-table table {
  margin: 0;
}

.detail-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.detail-table tr:last-child td {
  border-bottom: none;
}

.detail-table td.label {
  width: 200px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Links */
a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* Utilities */
.mono {
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.85rem;
}

.break-all {
  word-break: break-all;
}

.muted {
  color: var(--text-muted);
}

.text-green {
  color: var(--green);
  font-weight: 600;
}

.text-red {
  color: var(--red);
  font-weight: 600;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(88, 166, 255, 0.15);
  color: var(--accent);
}

.badge-asset {
  background: rgba(63, 185, 80, 0.15);
  color: var(--green);
}

.badge-warn {
  background: rgba(210, 153, 34, 0.15);
  color: var(--orange);
}

/* §19.15 — Gold verified badge */
.badge-verified {
  background: rgba(184, 134, 11, 0.2);
  color: var(--gold);
  border: 1px solid rgba(184, 134, 11, 0.4);
}

.badge-verified.badge-lg {
  font-size: 0.9rem;
  padding: 5px 14px;
}

/* Community token badge */
.badge-community {
  background: rgba(139, 148, 158, 0.15);
  color: var(--text-muted);
  border: 1px solid rgba(139, 148, 158, 0.3);
}

.badge-community.badge-lg {
  font-size: 0.9rem;
  padding: 5px 14px;
}

/* Clone warning badge */
.badge-clone-warning {
  background: rgba(248, 81, 73, 0.15);
  color: var(--red);
  border: 1px solid rgba(248, 81, 73, 0.3);
}

.badge-clone-warning.badge-lg {
  font-size: 0.9rem;
  padding: 5px 14px;
}

/* Bridge operation badge */
.badge-bridge {
  background: rgba(136, 98, 232, 0.15);
  color: #a78bfa;
  border: 1px solid rgba(136, 98, 232, 0.3);
}

/* Conversion badge */
.badge-conversion {
  background: rgba(63, 185, 80, 0.12);
  color: var(--green);
}

/* Supply rule badges */
.badge-supply-fixed {
  background: rgba(88, 166, 255, 0.12);
  color: var(--accent);
}

.badge-supply-mintable {
  background: rgba(63, 185, 80, 0.12);
  color: var(--green);
}

.badge-supply-deflationary {
  background: rgba(248, 81, 73, 0.12);
  color: var(--red);
}

/* Token page header row */
.token-header-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.token-header-row h2 {
  margin-bottom: 0;
}

/* Copy button */
.btn-copy {
  padding: 2px 8px;
  background: rgba(88, 166, 255, 0.1);
  color: var(--accent);
  border: 1px solid rgba(88, 166, 255, 0.3);
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.75rem;
  margin-left: 8px;
}

.btn-copy:hover {
  background: rgba(88, 166, 255, 0.2);
}

/* Token search results */
.token-results {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.token-result-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
}

.token-result-card:hover {
  border-color: var(--accent);
  background: rgba(88, 166, 255, 0.04);
}

.token-result-logo {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  overflow: hidden;
}

.token-result-logo img {
  width: 40px;
  height: 40px;
  max-width: 40px;
  max-height: 40px;
  border-radius: 50%;
  object-fit: contain;
}

.token-result-fallback {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #333;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  color: #999;
}

.token-result-info {
  flex: 1;
  min-width: 0;
}

.token-result-name {
  font-weight: 600;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.token-result-meta {
  font-size: 0.85rem;
  margin-top: 2px;
}

.token-result-sym {
  font-weight: 600;
  color: var(--accent);
}

.token-result-id {
  font-size: 0.75rem;
  margin-top: 2px;
}

.token-result-arrow {
  font-size: 1.2rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* Token search form */
.token-search {
  max-width: 400px;
}

/* Error box */
.error-box {
  background: rgba(248, 81, 73, 0.1);
  border: 1px solid rgba(248, 81, 73, 0.3);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 20px;
  color: var(--red);
}

.error-box p {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Privacy note */
.privacy-note {
  background: rgba(210, 153, 34, 0.08);
  border: 1px solid rgba(210, 153, 34, 0.2);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.privacy-note strong {
  color: var(--orange);
}

/* Block nav */
.nav-blocks {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

/* FCMP++ Transcript */
.hidden { display: none; }

.fcmp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.fcmp-header h3 { margin-bottom: 0; }

.btn-toggle {
  padding: 6px 16px;
  background: rgba(88, 166, 255, 0.12);
  color: var(--accent);
  border: 1px solid rgba(88, 166, 255, 0.3);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
}

.btn-toggle:hover {
  background: rgba(88, 166, 255, 0.2);
}

.badge-fcmp {
  background: rgba(210, 153, 34, 0.2);
  color: var(--orange);
  font-size: 0.85rem;
  padding: 4px 12px;
}

.badge-mining {
  background: rgba(255, 152, 0, 0.15);
  color: #ff9800;
  font-size: 0.85rem;
  padding: 4px 12px;
  border: 1px solid rgba(255, 152, 0, 0.3);
}

.fcmp-tree-diagram {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}

.fcmp-tree-diagram h4 {
  font-size: 1rem;
  margin-bottom: 10px;
  color: var(--orange);
}

.tree-ascii {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.82rem;
  color: var(--accent);
  line-height: 1.8;
  overflow-x: auto;
  white-space: pre;
}

.tree-desc {
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.tree-desc code {
  background: rgba(88, 166, 255, 0.1);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.82rem;
  color: var(--accent);
}

.fcmp-input-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}

.fcmp-input-card h4 {
  font-size: 1rem;
  margin-bottom: 12px;
  color: var(--text);
}

.fcmp-input-card .detail-table {
  margin-bottom: 10px;
}

.fcmp-nullifier-note {
  font-size: 0.82rem;
  color: var(--text-muted);
  padding: 8px 12px;
  background: rgba(210, 153, 34, 0.06);
  border-radius: var(--radius);
  line-height: 1.5;
}

.fcmp-nullifier-note strong {
  color: var(--orange);
}

.fcmp-nullifier-note code {
  background: rgba(88, 166, 255, 0.1);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.8rem;
  color: var(--accent);
}

.fcmp-section-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}

.fcmp-section-card h4 {
  font-size: 1rem;
  margin-bottom: 12px;
  color: var(--orange);
}

.sal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.sal-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sal-item strong {
  font-family: 'SF Mono', 'Fira Code', monospace;
  color: var(--accent);
  font-size: 1rem;
}

.sal-item span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.verification-steps {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.v-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.88rem;
}

.v-num {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(88, 166, 255, 0.12);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.v-step.done {
  border-color: rgba(63, 185, 80, 0.3);
}

.v-step.done .v-num {
  background: rgba(63, 185, 80, 0.15);
  color: var(--green);
}

.privacy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}

.priv-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.priv-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
}

.priv-value {
  font-size: 0.85rem;
  color: var(--text);
}

/* Code blocks for run-node instructions */
.code-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
}

.code-block pre {
  padding: 16px;
  margin: 0;
  color: var(--green);
  background: #010409;
  line-height: 1.6;
  font-size: 0.85rem;
  white-space: pre;
}

/* Responsive */
@media (max-width: 640px) {
  .header-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .search-form {
    max-width: 100%;
  }

  .info-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .detail-table td.label {
    width: 120px;
  }

  .token-header-row {
    flex-direction: column;
    align-items: flex-start;
  }
}
