/* ===== ARC TESTNET EXPLORER — Premium Dark Theme ===== */

/* ===== CSS Variables ===== */
:root {
  --arc-green: #00D47E;
  --arc-green-light: #33E09B;
  --arc-cyan: #06B6D4;
  --arc-purple: #8B5CF6;
  --bg-primary: #030509;
  --bg-secondary: #0A0F1C;
  --bg-card: rgba(10, 15, 28, 0.4);
  --bg-card-hover: rgba(15, 22, 40, 0.7);
  --bg-glass: rgba(10, 15, 28, 0.5);
  --bg-input: rgba(16, 23, 42, 0.6);
  --text-primary: #FFFFFF;
  --text-secondary: #A1A1AA;
  --text-muted: #52525B;
  --text-accent: #00D47E;
  --border-primary: rgba(255, 255, 255, 0.08);
  --border-glass: rgba(255, 255, 255, 0.05);
  --gradient-arc: linear-gradient(135deg, #00D47E 0%, #06B6D4 50%, #8B5CF6 100%);
  --shadow-glow: 0 0 24px rgba(0, 212, 126, 0.2);
  --shadow-cyan: 0 0 20px rgba(6, 182, 212, 0.15);
  --header-height: 80px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 32px;
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Outfit', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

button {
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  font-family: inherit;
}

/* ===== Layout ===== */
.main-wrapper {
  min-height: 100vh;
  padding-top: var(--header-height);
  background-attachment: fixed;
  background-image: 
    radial-gradient(circle at 0% 0%, rgba(0, 212, 126, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 100% 100%, rgba(139, 92, 246, 0.05) 0%, transparent 40%);
}

/* ===== Header ===== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background: rgba(10, 14, 23, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-glass);
  z-index: 1000;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.logo-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--gradient-arc);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.logo-icon::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 60%);
}

.logo-text {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.logo-text span {
  background: var(--gradient-arc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
  background: rgba(0, 212, 126, 0.12);
  color: var(--arc-green);
  border: 1px solid rgba(0, 212, 126, 0.2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Search Bar */
.search-container {
  flex: 1;
  max-width: 600px;
  margin: 0 32px;
  position: relative;
}

@media (max-width: 900px) {
  :root {
    --header-height: 120px;
  }

  .two-col {
    grid-template-columns: 1fr;
  }
  
  .header-left {
    order: 1;
  }
  
  .header-right {
    order: 2;
  }
  
  .search-container {
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 12px 0 0 0;
    order: 3;
  }
  
  .header {
    padding: 12px 16px;
    flex-wrap: wrap;
  }
  
  .page-content {
    padding: 16px;
  }
  
  .nav-tabs {
    padding: 12px 16px 0;
    overflow-x: auto;
  }
  
  .data-table th, .data-table td {
    padding: 10px 14px;
  }
}

.search-bar {
  width: 100%;
  height: 44px;
  padding: 0 16px 0 44px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-primary);
  background: var(--bg-input);
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  transition: all var(--transition-base);
  outline: none;
}

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

.search-bar:focus {
  border-color: var(--arc-green);
  background: rgba(30, 41, 59, 0.8);
  box-shadow: 0 0 0 3px rgba(0, 212, 126, 0.1);
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 16px;
  pointer-events: auto;
  transition: color var(--transition-fast);
}

.search-bar:focus ~ .search-icon {
  color: var(--arc-green);
}

.search-hint {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  color: var(--text-muted);
  padding: 3px 6px;
  border-radius: 4px;
  border: 1px solid var(--border-primary);
  background: rgba(0, 0, 0, 0.2);
  pointer-events: none;
  opacity: 0.7;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.network-status {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  background: rgba(0,0,0,0.2);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-glass);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #9ca3af;
  box-shadow: 0 0 8px rgba(156, 163, 175, 0.5);
}

.status-dot.online {
  background: var(--arc-green);
  box-shadow: 0 0 10px rgba(0, 212, 126, 0.6);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.5; }
  100% { opacity: 1; }
}

/* ===== Navigation ===== */
.nav-tabs {
  display: flex;
  gap: 8px;
  padding: 0 28px;
  margin-top: 16px;
  border-bottom: 1px solid var(--border-glass);
}

.nav-tab {
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-tab:hover {
  color: var(--text-secondary);
}

.nav-tab.active {
  color: var(--arc-green);
  border-bottom-color: var(--arc-green);
}

.nav-tab .tab-icon {
  font-size: 16px;
}

/* ===== Page Content ===== */
.page-content {
  padding: 24px 28px;
  max-width: 1440px;
  margin: 0 auto;
}

.page-section {
  display: none;
}

.page-section.active {
  display: block;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Stats Grid ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

@media (max-width: 1200px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-base);
  backdrop-filter: blur(24px) saturate(180%);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--gradient-arc);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.stat-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.stat-card:hover::before {
  opacity: 1;
}

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

.stat-label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.stat-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.stat-icon.green {
  background: rgba(0, 212, 126, 0.12);
  color: var(--arc-green);
}

.stat-icon.cyan {
  background: rgba(6, 182, 212, 0.12);
  color: var(--arc-cyan);
}

.stat-icon.purple {
  background: rgba(139, 92, 246, 0.12);
  color: #8B5CF6;
}

.stat-icon.orange {
  background: rgba(251, 146, 60, 0.12);
  color: #FB923C;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 640px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .stat-value {
    font-size: 22px;
  }
}

.stat-value.gradient {
  background: var(--gradient-arc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-sub {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-change {
  color: var(--arc-green);
  font-weight: 600;
}

/* ===== Data Tables ===== */
.data-section {
  margin-bottom: 24px;
}

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

.section-title {
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title .title-icon {
  font-size: 20px;
}

.section-badge {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(0, 212, 126, 0.1);
  color: var(--arc-green);
  font-weight: 600;
  animation: pulse 2s ease-in-out infinite;
}

.view-all-btn {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-primary);
  background: transparent;
  font-family: inherit;
  transition: all var(--transition-fast);
}

.view-all-btn:hover {
  color: var(--arc-green);
  border-color: var(--arc-green);
  background: rgba(0, 212, 126, 0.05);
}

.data-table-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  overflow: hidden;
  backdrop-filter: blur(24px) saturate(180%);
}

.data-table {
  width: 100%;
  border-collapse: separate; border-spacing: 0;
}

.data-table th {
  text-align: left;
  padding: 14px 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(30, 41, 59, 0.4);
  border-bottom: 1px solid var(--border-glass);
}

.data-table td {
  padding: 14px 20px;
  font-size: 14px;
  border-bottom: 1px solid var(--border-glass);
  transition: background var(--transition-fast);
}

.data-table tbody tr {
  cursor: pointer;
  transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
  background: rgba(0, 212, 126, 0.05); transform: translateY(-1px); box-shadow: inset 3px 0 0 var(--arc-cyan);
}

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

/* Table cell variants */
.mono {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
}

.hash-cell {
  color: var(--arc-green);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hash-cell:hover {
  color: var(--arc-green-light);
}

.address-cell {
  color: var(--arc-cyan);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
}

.block-number {
  color: var(--arc-green);
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
}

.tx-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.tx-badge.success {
  background: rgba(0, 212, 126, 0.1);
  color: var(--arc-green);
}

.tx-badge.pending {
  background: rgba(251, 146, 60, 0.1);
  color: #FB923C;
}

.tx-badge.failed {
  background: rgba(239, 68, 68, 0.1);
  color: #EF4444;
}

.time-ago {
  color: var(--text-muted);
  font-size: 13px;
}

.value-cell {
  font-weight: 500;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
}

/* ===== Two Column Layout ===== */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

/* ===== Detail Page ===== */
.detail-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.back-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-primary);
  background: var(--bg-input);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all var(--transition-fast);
  font-family: inherit;
}

.back-btn:hover {
  border-color: var(--arc-green);
  color: var(--arc-green);
}

.detail-title {
  font-size: 24px;
  font-weight: 700;
}

.detail-title span {
  color: var(--text-muted);
  font-weight: 400;
}

.detail-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  overflow: hidden;
  backdrop-filter: blur(24px) saturate(180%);
  margin-bottom: 24px;
}

.detail-card-header {
  padding: 16px 24px;
  background: rgba(30, 41, 59, 0.4);
  border-bottom: 1px solid var(--border-glass);
  font-weight: 600;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.detail-row {
  display: flex;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border-glass);
  align-items: flex-start;
  gap: 16px;
  transition: background var(--transition-fast);
}

@media (max-width: 640px) {
  .detail-row {
    flex-direction: column;
    gap: 6px;
  }
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-row:hover {
  background: rgba(0, 212, 126, 0.02);
}

.detail-label {
  min-width: 180px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  flex-shrink: 0;
}

.detail-value {
  font-size: 14px;
  word-break: break-all;
  flex: 1;
}

.detail-value .mono {
  font-size: 13px;
}

.copy-btn {
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-primary);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  transition: all var(--transition-fast);
  font-family: inherit;
  margin-left: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.copy-btn:hover {
  color: var(--arc-green);
  border-color: var(--arc-green);
}

/* ===== Loading States ===== */
.skeleton {
  background: linear-gradient(90deg, var(--bg-secondary) 25%, rgba(55, 65, 81, 0.5) 50%, var(--bg-secondary) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: 6px;
  height: 20px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.loading-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  gap: 16px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-primary);
  border-top-color: var(--arc-green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

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

/* ===== Error/Empty States ===== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  gap: 12px;
  color: var(--text-muted);
}

.empty-state .empty-icon {
  font-size: 48px;
  opacity: 0.5;
  margin-bottom: 8px;
}

.empty-state .empty-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-secondary);
}

.empty-state .empty-desc {
  font-size: 14px;
  text-align: center;
  max-width: 400px;
}

/* ===== Error Banner ===== */
.error-banner {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  margin-bottom: 16px;
  border-radius: var(--radius-md);
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #FCA5A5;
  font-size: 14px;
}

.error-banner.visible {
  display: flex;
}

.error-banner .error-icon {
  font-size: 18px;
  color: #EF4444;
}

/* ===== Tooltip ===== */
.tooltip {
  position: fixed;
  padding: 6px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-primary);
  pointer-events: none;
  z-index: 9999;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.tooltip.show {
  opacity: 1;
}

/* ===== Footer ===== */
.footer {
  padding: 24px 28px;
  margin-top: 40px;
  border-top: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-muted);
  font-size: 13px;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-main {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-social {
  display: flex;
  align-items: center;
  gap: 16px;
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition-base);
  border: 1px solid var(--border-primary);
}

.social-link.twitter {
  color: #E7E9EA;
  background: rgba(239, 243, 244, 0.05);
}

.social-link.twitter:hover {
  color: #1D9BF0;
  background: rgba(29, 155, 240, 0.1);
  border-color: rgba(29, 155, 240, 0.3);
  transform: translateY(-1px);
}

.social-link.discord {
  color: #B8BEF8;
  background: rgba(88, 101, 242, 0.05);
}

.social-link.discord:hover {
  color: #5865F2;
  background: rgba(88, 101, 242, 0.1);
  border-color: rgba(88, 101, 242, 0.3);
  transform: translateY(-1px);
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-links a {
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: var(--arc-green);
}

/* ===== Pagination ===== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  border-top: 1px solid var(--border-glass);
}

.page-btn {
  min-width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-primary);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.page-btn:hover:not(:disabled) {
  border-color: var(--arc-green);
  color: var(--arc-green);
}

.page-btn.active {
  background: var(--arc-green);
  border-color: var(--arc-green);
  color: #fff;
}

.page-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* ===== Chain Info bar ===== */
.chain-info-bar {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 10px 28px;
  background: rgba(0, 212, 126, 0.03);
  border-bottom: 1px solid var(--border-glass);
  font-size: 12px;
  color: var(--text-muted);
  overflow-x: auto;
}

.chain-info-item .value {
  color: var(--text-secondary);
  font-weight: 500;
  font-family: 'JetBrains Mono', monospace;
}

/* ===== Address Page ===== */
.address-overview {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

@media (max-width: 768px) {
  .address-overview {
    grid-template-columns: 1fr;
  }
}

.address-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  backdrop-filter: blur(24px) saturate(180%);
}

.address-card .card-value {
  font-size: 22px;
  font-weight: 700;
}
