/* ============================================
   Base Mini Scan — Clean Aesthetic Theme
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #080b12;
  --surface: rgba(255, 255, 255, 0.03);
  --surface-2: rgba(255, 255, 255, 0.05);
  --surface-3: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.15);
  --text: #e8eaf0;
  --text-secondary: rgba(255, 255, 255, 0.65);
  --text-muted: rgba(255, 255, 255, 0.4);
  --accent: #0066ff;
  --accent-soft: rgba(0, 102, 255, 0.15);
  --accent-glow: rgba(0, 102, 255, 0.3);
  --green: #22c55e;
  --red: #ef4444;
  --purple: #a855f7;
  --radius: 16px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

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

html, body {
  height: 100%;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* subtle background glow */
body::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(ellipse at 30% 20%, rgba(0, 102, 255, 0.06) 0%, transparent 50%),
              radial-gradient(ellipse at 70% 80%, rgba(168, 85, 247, 0.04) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* =====================
   LAYOUT
===================== */

.wrap {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  position: relative;
  z-index: 1;
}

.card {
  width: 100%;
  max-width: 640px;
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 28px;
  box-shadow: var(--shadow);
  position: relative;
}

/* =====================
   PROFILE
===================== */

.profile {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--border);
  margin-bottom: 24px;
  transition: border-color 0.2s;
}

.profile:hover {
  border-color: var(--border-hover);
}

.pfp {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  background: var(--surface-3);
}

.profileInfo {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.profileName {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}

.profileUsername {
  font-size: 12px;
  color: var(--text-muted);
}

.profileBadges {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  flex-wrap: wrap;
}

/* =====================
   BADGES
===================== */

.badge {
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.3px;
  background: var(--accent-soft);
  color: #5b9cff;
  border: 1px solid rgba(0, 102, 255, 0.2);
}

.badge.neynar {
  background: rgba(168, 85, 247, 0.12);
  color: #c084fc;
  border-color: rgba(168, 85, 247, 0.2);
}

/* =====================
   FORM & BUTTONS
===================== */

h1 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
  letter-spacing: -0.4px;
  color: var(--text);
}

.row {
  display: grid;
  gap: 10px;
}

input {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

input::placeholder {
  color: var(--text-muted);
}

button {
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  cursor: pointer;
  background: var(--accent);
  transition: all 0.15s ease;
}

button:hover {
  background: #1a75ff;
  box-shadow: 0 4px 16px var(--accent-glow);
}

button:active {
  transform: scale(0.97);
}

button.secondary {
  background: var(--surface-2);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  box-shadow: none;
}

button.secondary:hover {
  background: var(--surface-3);
  border-color: var(--border-hover);
  color: var(--text);
  box-shadow: none;
}

/* =====================
   TOP TABS
===================== */

.topTabs {
  display: flex;
  gap: 2px;
  margin-bottom: 24px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 3px;
  border: 1px solid var(--border);
}

.topTabs .topTab {
  flex: 1;
  padding: 9px 14px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-xs);
  min-width: 0;
  letter-spacing: 0.2px;
}

.topTabs .topTab:not(.secondary) {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px var(--accent-glow);
}

.topTabs .topTab.secondary {
  background: transparent;
  border: none;
  color: var(--text-muted);
}

.topTabs .topTab.secondary:hover {
  color: var(--text);
  background: var(--surface-3);
  box-shadow: none;
}

body[data-page="detail"] .topTabs {
  display: none;
}

/* =====================
   SECTIONS
===================== */

.sectionHead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.sectionTitle {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-secondary);
}

.cardTitle {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-secondary);
  padding: 0;
  margin-bottom: 4px;
}

/* =====================
   DETAIL - BACK BAR
===================== */

.detailTop {
  display: none;
}

.detailBar {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
}

.backBtn {
  padding: 7px 14px;
  font-size: 12px;
  border-radius: var(--radius-xs);
}

#link {
  display: none !important;
}

body[data-page="detail"] .profile {
  display: none;
}

/* =====================
   TABS (detail)
===================== */

.tabs {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
  margin-top: 16px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 3px;
  border: 1px solid var(--border);
}

.tabs button {
  flex: 1;
  min-width: 0;
  padding: 8px 6px;
  font-size: 11px;
  border-radius: var(--radius-xs);
  letter-spacing: 0.2px;
}

.tabs button:not(.secondary) {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px var(--accent-glow);
}

/* =====================
   CONTENT / UTILITIES
===================== */

.muted {
  font-size: 11px;
  color: var(--text-muted);
}

a {
  color: #5b9cff;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.click {
  cursor: pointer;
  color: #5b9cff;
  transition: color 0.15s;
}

.click:hover {
  color: #80b4ff;
}

.small {
  font-size: 11px;
  color: var(--text-muted);
}

.resultCard {
  margin-top: 14px;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--border);
}

/* =====================
   DETAIL HEADER
===================== */

.detailHeader {
  padding: 18px;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.detailLabel {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
  margin-bottom: 8px;
}

.detailAddress {
  font-size: 12px;
  font-weight: 500;
  word-break: break-all;
  line-height: 1.5;
  font-family: 'SF Mono', 'Fira Code', 'JetBrains Mono', monospace;
  color: var(--text-secondary);
}

.detailStats {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.statBox {
  padding: 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  border: 1px solid var(--border);
}

.statBox .muted {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.statValue {
  margin-top: 6px;
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.fcUser {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #5b9cff;
}

/* =====================
   TABLE
===================== */

.tableWrap {
  margin-top: 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-2);
  overflow: hidden;
}

.tableScroll {
  max-height: 360px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

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

th, td {
  padding: 10px 12px;
  text-align: left;
  font-size: 11px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  background: rgba(8, 11, 18, 0.95);
  backdrop-filter: blur(8px);
  font-weight: 600;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  z-index: 1;
}

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

/* =====================
   INTERNAL TX
===================== */

.internalBadge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 600;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #5b9cff;
}

.tableWrap.internal .valueMinus {
  color: var(--red);
  font-weight: 600;
}

.tableWrap.internal .valuePlus {
  color: var(--green);
  font-weight: 600;
}

.tableWrap.internal .addr {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 10px;
}

#tabInternal:not(.secondary),
#tabNft:not(.secondary) {
  background: var(--accent);
  color: #fff;
}

.internalNote {
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-muted);
}

/* =====================
   GAS TRACKER
===================== */

.gasWrap {
  margin-top: 10px;
}

.gasTopBar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  gap: 10px;
  flex-wrap: wrap;
}

.gasTitle {
  font-weight: 700;
  font-size: 13px;
}

.gasNext {
  font-size: 11px;
  color: var(--text-muted);
}

.gasGrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.gasCard {
  padding: 16px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  text-align: center;
  transition: border-color 0.2s;
}

.gasCard:hover {
  border-color: var(--border-hover);
}

.gasLabel {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.gasValue {
  font-size: 20px;
  font-weight: 800;
  margin: 8px 0 4px;
  letter-spacing: -0.5px;
  font-variant-numeric: tabular-nums;
}

.gasValue .unit {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  margin-left: 2px;
}

.gasSub {
  font-size: 10px;
  color: var(--text-muted);
}

.gasInfoGrid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.gasInfoCard {
  padding: 10px;
  border-radius: var(--radius-xs);
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.gasInfoLabel {
  font-size: 10px;
  color: var(--text-muted);
}

.gasInfoValue {
  font-size: 13px;
  font-weight: 700;
}

/* =====================
   FEATURED ACTIONS
===================== */

.featuredCard {
  margin-top: 20px;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--border);
  overflow: hidden;
}

.featuredCard .card {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}

.tbl {
  width: 100%;
  border-collapse: collapse;
}

.tbl th,
.tbl td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}

.tbl th {
  text-align: left;
  font-weight: 600;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  background: rgba(8, 11, 18, 0.8);
}

.tbl .num {
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.tbl tbody tr:last-child td {
  border-bottom: none;
}

.tbl tbody tr {
  transition: background 0.15s;
}

.tbl tbody tr:hover {
  background: var(--surface-3);
}

#featuredActions {
  margin-top: 20px;
}

/* =====================
   AI MODE
===================== */

.aiChat {
  margin-top: 12px;
  height: 460px;
  overflow: auto;
  padding: 14px;
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
}

.aiMsg {
  display: flex;
  margin: 8px 0;
}

.aiMsg.user {
  justify-content: flex-end;
}

.aiMsg.assistant {
  justify-content: flex-start;
}

.aiBubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  line-height: 1.5;
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-word;
}

.aiMsg.user .aiBubble {
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-sm) var(--radius-sm) 4px var(--radius-sm);
}

.aiMsg.assistant .aiBubble {
  background: var(--surface-3);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: var(--radius-sm) var(--radius-sm) var(--radius-sm) 4px;
}

.aiComposer {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.aiComposer input {
  flex: 1;
}

body[data-page="ai"] .profileCard {
  display: none;
}

/* =====================
   SKELETON LOADING
===================== */

.skeleton .sk-line {
  height: 10px;
  border-radius: 5px;
  background: var(--surface-3);
  margin: 8px 0;
  animation: pulse 1.8s ease-in-out infinite;
}

.sk-line.w30 { width: 30%; }
.sk-line.w40 { width: 40%; }
.sk-line.w50 { width: 50%; }
.sk-line.w60 { width: 60%; }
.sk-line.w70 { width: 70%; }
.sk-line.w80 { width: 80%; }

@keyframes pulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.7; }
}

/* =====================
   SCROLLBAR
===================== */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--surface-3);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* =====================
   RESPONSIVE
===================== */

@media (max-width: 520px) {
  .wrap {
    padding: 8px;
    align-items: flex-start;
  }

  .card {
    border-radius: 20px;
    padding: 18px;
  }

  .gasGrid {
    grid-template-columns: 1fr;
  }

  .detailStats {
    grid-template-columns: 1fr;
  }

  .tabs button {
    font-size: 10px;
    padding: 7px 4px;
  }

  .topTabs .topTab {
    font-size: 11px;
    padding: 8px 10px;
  }
}
