/* ==========================================================================
   VNC CHAIN — INSTITUTIONAL WEB3 DESIGN SYSTEM (DARK & DAYLIGHT THEMES)
   Shared by vncchain.info (Protocol Portal) & vncscan.info (Block Explorer)
   ========================================================================== */

:root,
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #080a10;
  --bg-elevated: #0e121c;
  --surface: #121723;
  --surface-2: #182032;
  --surface-hover: #1d263b;
  --code-bg: #090c14;
  --border: rgba(255, 255, 255, 0.085);
  --border-strong: rgba(255, 255, 255, 0.16);
  --border-accent: rgba(245, 185, 66, 0.38);
  --text: #f1f5f9;
  --text-soft: #cbd5e1;
  --muted: #8b9bb4;
  --accent: #f5b942;
  --accent-contrast: #080a10;
  --accent-hover: #fbcf68;
  --accent-soft: rgba(245, 185, 66, 0.13);
  --cyan: #38bdf8;
  --cyan-soft: rgba(56, 189, 248, 0.13);
  --emerald: #10b981;
  --emerald-soft: rgba(16, 185, 129, 0.13);
  --rose: #f43f5e;
  --rose-soft: rgba(244, 63, 94, 0.13);
  --purple: #a855f7;
  --purple-soft: rgba(168, 85, 247, 0.13);
  --header-bg: rgba(8, 10, 16, 0.88);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.35), 0 10px 28px -14px rgba(0, 0, 0, 0.65);
  --shadow-modal: 0 24px 64px rgba(0, 0, 0, 0.72);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f8fb;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --surface-hover: #e8eef5;
  --code-bg: #0f172a;
  --border: rgba(15, 23, 42, 0.09);
  --border-strong: rgba(15, 23, 42, 0.17);
  --border-accent: rgba(180, 83, 9, 0.35);
  --text: #0f172a;
  --text-soft: #334155;
  --muted: #64748b;
  --accent: #b45309;
  --accent-contrast: #ffffff;
  --accent-hover: #92400e;
  --accent-soft: rgba(217, 119, 6, 0.11);
  --cyan: #0284c7;
  --cyan-soft: rgba(2, 132, 199, 0.11);
  --emerald: #059669;
  --emerald-soft: rgba(5, 150, 105, 0.11);
  --rose: #e11d48;
  --rose-soft: rgba(225, 29, 72, 0.10);
  --purple: #7c3aed;
  --purple-soft: rgba(124, 58, 237, 0.10);
  --header-bg: rgba(255, 255, 255, 0.90);
  --shadow-card: 0 1px 3px rgba(15, 23, 42, 0.05), 0 6px 20px -8px rgba(15, 23, 42, 0.08);
  --shadow-modal: 0 24px 60px rgba(15, 23, 42, 0.20);
}

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

body {
  font-family: 'Inter', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s ease, color 0.2s ease;
}

:root[data-theme="dark"] body {
  background-image:
    radial-gradient(ellipse 80% 50% at 18% -10%, rgba(245, 185, 66, 0.09), transparent 55%),
    radial-gradient(ellipse 65% 45% at 88% -5%, rgba(56, 189, 248, 0.08), transparent 52%);
}

code, pre, .mono {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.tnum {
  font-variant-numeric: tabular-nums;
}

a { color: inherit; }

/* Inline SVG Icon Utility */
.vnc-ico {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}
.vnc-ico-lg { width: 18px; height: 18px; }
.vnc-ico-xl { width: 22px; height: 22px; }

/* Sticky Institutional Navbar */
.vnc-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.vnc-nav-inner {
  max-width: 1340px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.vnc-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.vnc-brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border-accent);
  background: #090c14;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(245, 185, 66, 0.16);
}
.vnc-brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.vnc-brand-name {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.vnc-brand-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 15.5px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}
.vnc-brand-sub {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
}

.chain-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--border-accent);
  letter-spacing: 0.02em;
}

.vnc-menu {
  display: flex;
  align-items: center;
  gap: 4px;
}

.vnc-menu-link,
.vnc-drop-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 11px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.vnc-menu-link:hover,
.vnc-drop-btn:hover {
  color: var(--accent);
  background: var(--surface-2);
}

.vnc-drop {
  position: relative;
}
.vnc-drop-panel {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 225px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 6px;
  box-shadow: var(--shadow-modal);
  z-index: 120;
}
.vnc-drop.open .vnc-drop-panel,
.vnc-drop:hover .vnc-drop-panel {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.vnc-drop-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 11px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-soft);
  text-decoration: none;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: all 0.12s ease;
}
.vnc-drop-item:hover {
  background: var(--surface-2);
  color: var(--accent);
}
.vnc-drop-item small {
  font-size: 10.5px;
  color: var(--muted);
  font-weight: 500;
}

.vnc-nav-controls {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}

/* Unified Buttons & Controls */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 9px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.btn:hover {
  border-color: var(--border-accent);
  background: var(--surface-2);
  transform: translateY(-1px);
}
.btn-sm { padding: 5px 9px; font-size: 11.5px; border-radius: 7px; }
.btn-lg { padding: 10px 16px; font-size: 13.5px; border-radius: 10px; font-weight: 700; }

.btn-primary {
  background: var(--accent);
  color: var(--accent-contrast);
  border-color: transparent;
  font-weight: 700;
}
.btn-primary:hover {
  background: var(--accent-hover);
  color: var(--accent-contrast);
  border-color: transparent;
}

.btn-outline-accent {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--border-accent);
}
.btn-outline-accent:hover {
  background: var(--accent);
  color: var(--accent-contrast);
}

.btn-cyan {
  background: var(--cyan-soft);
  color: var(--cyan);
  border-color: rgba(56, 189, 248, 0.35);
}
.btn-emerald {
  background: var(--emerald-soft);
  color: var(--emerald);
  border-color: rgba(16, 185, 129, 0.35);
}

.icon-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 9px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}
.icon-btn:hover {
  color: var(--accent);
  border-color: var(--border-accent);
  background: var(--surface-2);
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  padding: 2px;
  gap: 2px;
}
.lang-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.lang-btn.active {
  background: var(--accent);
  color: var(--accent-contrast);
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--emerald);
  display: inline-block;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.22);
  animation: vncPulse 2s infinite;
}
@keyframes vncPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.65; transform: scale(0.9); }
}

/* Badges & Method Pills */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-soft);
}
.status-badge.ok {
  background: var(--emerald-soft);
  color: var(--emerald);
  border-color: rgba(16, 185, 129, 0.35);
}
.status-badge.warn {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--border-accent);
}

.method-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid transparent;
  letter-spacing: 0.01em;
}
.method-pill.mint { background: var(--emerald-soft); color: var(--emerald); border-color: rgba(16, 185, 129, 0.26); }
.method-pill.burn { background: var(--rose-soft); color: var(--rose); border-color: rgba(244, 63, 94, 0.26); }
.method-pill.transfer { background: var(--cyan-soft); color: var(--cyan); border-color: rgba(56, 189, 248, 0.26); }
.method-pill.nft { background: var(--purple-soft); color: var(--purple); border-color: rgba(168, 85, 247, 0.26); }
.method-pill.bridge { background: var(--accent-soft); color: var(--accent); border-color: var(--border-accent); }
.method-pill.vault { background: var(--surface-2); color: var(--text-soft); border-color: var(--border-strong); }

/* Structural Containers & Cards */
.vnc-container {
  max-width: 1340px;
  margin: 0 auto;
  padding: 0 20px;
}

.surface-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-card);
}

.copy-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.14s ease;
}
.copy-chip:hover {
  border-color: var(--border-accent);
  color: var(--accent);
}

/* Modal System */
.vnc-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 16, 0.72);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 250;
}
.vnc-modal-backdrop.open {
  display: flex;
}
.vnc-modal-card {
  width: 100%;
  max-width: 640px;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  padding: 20px 22px;
  box-shadow: var(--shadow-modal);
  color: var(--text);
}
.vnc-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.vnc-modal-head h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15.5px;
  font-weight: 800;
}

/* Wallet Picker Grid */
.wallet-provider-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.wallet-provider-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 11px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  cursor: pointer;
  transition: all 0.15s ease;
}
.wallet-provider-row:hover {
  border-color: var(--border-accent);
  background: var(--surface-hover);
}
.wallet-provider-info {
  display: flex;
  align-items: center;
  gap: 11px;
}
.wallet-provider-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  object-fit: contain;
  background: #fff;
  padding: 2px;
}

/* Toast Notifications */
.vnc-toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 400;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 380px;
  pointer-events: none;
}
.vnc-toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 11px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-modal);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  animation: vncSlideIn 0.2s ease;
}
.vnc-toast.ok { border-left: 3px solid var(--emerald); }
.vnc-toast.err { border-left: 3px solid var(--rose); }
.vnc-toast.info { border-left: 3px solid var(--accent); }
@keyframes vncSlideIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Mobile Responsive Nav */
.vnc-mobile-toggle { display: none; }
@media (max-width: 960px) {
  .vnc-menu { display: none; }
  .vnc-menu.mobile-open {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border-strong);
    padding: 12px 18px;
    box-shadow: var(--shadow-modal);
  }
  .vnc-menu.mobile-open .vnc-drop-panel {
    position: static;
    display: flex;
    box-shadow: none;
    border: none;
    padding-left: 14px;
    background: transparent;
  }
  .vnc-mobile-toggle { display: inline-flex; }
}
@media (max-width: 600px) {
  .vnc-nav-inner { padding: 9px 12px; gap: 8px; }
  .vnc-container { padding: 0 12px; }
  .vnc-brand { gap: 8px; }
  .vnc-brand-logo { width: 32px; height: 32px; border-radius: 8px; }
  .vnc-brand-sub { display: none; }
  .vnc-nav-controls { gap: 5px; }
  #btn-connect-wallet { padding: 6px 9px; font-size: 11.5px; }
  .vnc-modal-backdrop { padding: 10px; }
  .vnc-modal-card { padding: 15px 14px; border-radius: 13px; }
}

