/* ==========================================================================
   BullionsX Explorer - Next-Gen Futuristic Web3 UI Design System
   ========================================================================== */

:root {
  /* Color Palette */
  --bg-dark: #050816;
  --bg-card: rgba(13, 20, 41, 0.55);
  --bg-card-hover: rgba(20, 30, 60, 0.75);
  --primary: #2563EB;
  --primary-glow: rgba(37, 99, 235, 0.4);
  --secondary: #8B5CF6;
  --secondary-glow: rgba(139, 92, 246, 0.4);
  --accent: #00FFAE;
  --accent-glow: rgba(0, 255, 174, 0.4);
  --gold: #FFD700;
  --gold-glow: rgba(255, 215, 0, 0.4);
  --white: #FFFFFF;
  --text-muted: #94A3B8;
  --text-dim: #64748B;
  --border-light: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(37, 99, 235, 0.3);
  
  /* Layout Dimensions */
  --sidebar-width: 260px;
  --header-height: 80px;
  --card-radius: 30px;
  --inner-radius: 20px;
  
  /* Fonts */
  --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-code: 'Space Grotesk', monospace;
  
  /* Transition timings */
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Light Theme Variables Fallback */
body.light-theme {
  --bg-dark: #0f172a;
  --bg-card: rgba(255, 255, 255, 0.07);
  --text-muted: #cbd5e1;
}

/* Reset & Global Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  overflow-x: hidden;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-dark);
  color: var(--white);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(5, 8, 22, 0.8);
}
::-webkit-scrollbar-thumb {
  background: rgba(37, 99, 235, 0.3);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
  box-shadow: 0 0 10px var(--primary);
}

/* Utility Classes */
.primary-text { color: var(--primary); }
.secondary-text { color: var(--secondary); }
.accent-text { color: var(--accent); }
.gold-text { color: var(--gold); }
.highlight { color: var(--accent); }
.text-accent { color: var(--accent); }
.text-primary { color: var(--primary); }

/* ==========================================================================
   Living Blockchain Background Canvas & Overlays
   ========================================================================== */

#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -2;
  pointer-events: auto;
}

.bg-gradient-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: 
    radial-gradient(circle at 20% 20%, rgba(37, 99, 235, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(0, 255, 174, 0.05) 0%, transparent 60%);
  z-index: -1;
  pointer-events: none;
}

.digital-rain-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  opacity: 0.15;
  overflow: hidden;
}

/* ==========================================================================
   App Layout Grid
   ========================================================================== */

.app-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
  position: relative;
  z-index: 1;
}

/* ==========================================================================
   Sidebar Component
   ========================================================================== */

.sidebar {
  width: var(--sidebar-width);
  background: rgba(8, 13, 30, 0.75);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform var(--transition-normal);
}

.sidebar-brand {
  height: var(--header-height);
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 0 24px;
  border-bottom: 1px solid var(--border-light);
}

.brand-logo-container {
  position: relative;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.3), rgba(139, 92, 246, 0.3));
  border: 1px solid rgba(0, 255, 174, 0.4);
  border-radius: 14px;
  box-shadow: 0 0 20px rgba(37, 99, 235, 0.4);
}

.brand-logo-glow {
  position: absolute;
  inset: -2px;
  background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent));
  border-radius: 16px;
  z-index: -1;
  opacity: 0.6;
  filter: blur(6px);
  animation: rotateGlow 6s linear infinite;
}

@keyframes rotateGlow {
  0% { filter: blur(6px) hue-rotate(0deg); }
  100% { filter: blur(6px) hue-rotate(360deg); }
}

.brand-icon {
  font-size: 22px;
  color: var(--accent);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 1px;
}

.brand-subtitle {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 1.5px;
}

/* Sidebar Menu */
.sidebar-menu {
  flex: 1;
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-radius: 14px;
  position: relative;
  transition: all var(--transition-fast);
}

.menu-icon {
  width: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: transform var(--transition-fast), color var(--transition-fast);
}

.menu-item:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 0 15px rgba(37, 99, 235, 0.15);
}

.menu-item:hover .menu-icon {
  color: var(--accent);
  transform: scale(1.2);
  text-shadow: 0 0 10px var(--accent);
}

.menu-item.active {
  color: var(--white);
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.25), rgba(139, 92, 246, 0.1));
  border: 1px solid rgba(37, 99, 235, 0.4);
  font-weight: 600;
}

.menu-item.active .menu-icon {
  color: var(--primary);
}

.menu-active-pill {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 20px;
  background: var(--accent);
  border-radius: 4px;
  box-shadow: 0 0 10px var(--accent);
}

.sidebar-footer {
  padding: 18px 24px;
  border-top: 1px solid var(--border-light);
}

.network-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0, 255, 174, 0.08);
  border: 1px solid rgba(0, 255, 174, 0.3);
  padding: 8px 14px;
  border-radius: 12px;
}

.status-indicator.online {
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent);
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.5; }
}

.network-name {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--accent);
}

/* ==========================================================================
   Main Wrapper & Top Navigation Header
   ========================================================================== */

.main-wrapper {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.header {
  height: var(--header-height);
  background: rgba(5, 8, 22, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 90;
}

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

.mobile-toggle-btn {
  display: none;
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--white);
  font-size: 18px;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.header-title-group {
  display: flex;
  flex-direction: column;
}

.header-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(90deg, #FFFFFF 0%, #94A3B8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-tagline {
  font-size: 12px;
  color: var(--accent);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Header Telemetry Bar */
.header-metrics {
  display: flex;
  align-items: center;
  gap: 20px;
  background: rgba(13, 20, 41, 0.6);
  border: 1px solid var(--border-light);
  padding: 8px 20px;
  border-radius: 16px;
}

.header-stat {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.stat-value {
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-code);
}

.health-text { color: var(--accent); }
.badge-chain {
  background: rgba(37, 99, 235, 0.2);
  color: var(--primary);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
}

.header-stat-divider {
  width: 1px;
  height: 24px;
  background: var(--border-light);
}

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

.action-icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.action-icon-btn:hover {
  color: var(--white);
  border-color: var(--primary);
  box-shadow: 0 0 15px var(--primary-glow);
  transform: translateY(-2px);
}

.notif-pulse {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 7px;
  height: 7px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent);
}

.user-profile-badge {
  position: relative;
  cursor: pointer;
}

.user-avatar {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 18px;
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.3);
}

.user-status-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  background: var(--accent);
  border: 2px solid var(--bg-dark);
  border-radius: 50%;
}

/* ==========================================================================
   Dashboard Content & Section Styling
   ========================================================================== */

.dashboard-content {
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* Glassmorphism Card Core Class */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid var(--border-light);
  border-radius: var(--card-radius);
  position: relative;
  overflow: hidden;
  transition: transform var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal);
  box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.5);
}

.glass-card:hover {
  border-color: rgba(37, 99, 235, 0.4);
  box-shadow: 0 15px 50px -10px rgba(37, 99, 235, 0.25), inset 0 0 20px rgba(37, 99, 235, 0.05);
}

/* ==========================================================================
   Premium Search Box Section
   ========================================================================== */

.search-section {
  width: 100%;
}

.search-glass-card {
  position: relative;
  background: rgba(13, 20, 41, 0.65);
  backdrop-filter: blur(30px);
  border: 1px solid rgba(37, 99, 235, 0.3);
  border-radius: 24px;
  padding: 10px 14px 10px 24px;
  overflow: hidden;
  box-shadow: 0 0 30px rgba(37, 99, 235, 0.15);
  transition: all var(--transition-normal);
}

.search-glass-card:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 40px rgba(0, 255, 174, 0.25);
}

.search-laser-line {
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: laserScan 3s infinite ease-in-out;
}

@keyframes laserScan {
  0% { left: -100%; }
  100% { left: 200%; }
}

.search-input-wrapper {
  display: flex;
  align-items: center;
  gap: 16px;
}

.search-icon {
  font-size: 20px;
  color: var(--primary);
}

#global-search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--white);
  font-family: var(--font-main);
  font-size: 15px;
  font-weight: 500;
}

#global-search-input::placeholder {
  color: var(--text-dim);
}

.search-types-tags {
  display: flex;
  align-items: center;
  gap: 6px;
}

.search-tag {
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-light);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.search-tag:hover, .search-tag.active {
  color: var(--white);
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 0 10px var(--primary-glow);
}

.search-submit-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border: none;
  border-radius: 16px;
  color: var(--white);
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 0 20px var(--primary-glow);
  transition: all var(--transition-fast);
}

.search-submit-btn:hover {
  transform: scale(1.03);
  box-shadow: 0 0 30px var(--accent-glow);
}

/* ==========================================================================
   Stats Overview Grid (11 Cards)
   ========================================================================== */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.stat-card {
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 120px;
}

.stat-card-wide {
  grid-column: span 2;
}

@media (max-width: 1200px) {
  .stat-card-wide {
    grid-column: span 1;
  }
}

.stat-card-border-glow {
  position: absolute;
  inset: 0;
  border-radius: var(--card-radius);
  padding: 1px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent, rgba(37, 99, 235, 0.3));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.stat-icon-box {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.stat-icon-box.primary {
  background: rgba(37, 99, 235, 0.15);
  border: 1px solid rgba(37, 99, 235, 0.3);
  color: var(--primary);
  box-shadow: 0 0 20px rgba(37, 99, 235, 0.2);
}

.stat-icon-box.secondary {
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.3);
  color: var(--secondary);
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.2);
}

.stat-icon-box.accent {
  background: rgba(0, 255, 174, 0.15);
  border: 1px solid rgba(0, 255, 174, 0.3);
  color: var(--accent);
  box-shadow: 0 0 20px rgba(0, 255, 174, 0.2);
}

.stat-icon-box.gold {
  background: rgba(255, 215, 0, 0.15);
  border: 1px solid rgba(255, 215, 0, 0.3);
  color: var(--gold);
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.2);
}

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

.stat-card-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-card-value {
  font-size: 22px;
  font-weight: 800;
  font-family: var(--font-code);
  color: var(--white);
  line-height: 1.2;
}

.stat-card-value .unit {
  font-size: 13px;
  color: var(--text-dim);
  font-weight: 600;
}

.stat-subtext {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 4px;
}

/* ==========================================================================
   Visuals Section: Live Network Topology & 3D Validator Globe
   ========================================================================== */

.visuals-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 1024px) {
  .visuals-grid {
    grid-template-columns: 1fr;
  }
}

.visual-card {
  height: 480px;
  display: flex;
  flex-direction: column;
}

.card-header {
  padding: 20px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-light);
}

.card-title-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.card-icon {
  font-size: 20px;
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--white);
}

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

.pulse-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 255, 174, 0.1);
  border: 1px solid rgba(0, 255, 174, 0.3);
  color: var(--accent);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent);
  animation: pulseDot 1.5s infinite;
}

.canvas-container {
  flex: 1;
  position: relative;
  width: 100%;
  height: 100%;
}

#network-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.network-legend {
  position: absolute;
  bottom: 16px;
  left: 20px;
  display: flex;
  gap: 16px;
  background: rgba(5, 8, 22, 0.7);
  border: 1px solid var(--border-light);
  padding: 6px 14px;
  border-radius: 12px;
}

.legend-item {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.legend-dot.val { background: var(--primary); box-shadow: 0 0 6px var(--primary); }
.legend-dot.mem { background: var(--secondary); box-shadow: 0 0 6px var(--secondary); }
.legend-dot.pkt { background: var(--accent); box-shadow: 0 0 6px var(--accent); }

/* Globe Container */
.globe-viewport {
  flex: 1;
  position: relative;
  width: 100%;
  height: 100%;
}

.globe-overlay-stats {
  position: absolute;
  top: 16px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  z-index: 10;
}

.globe-stat-chip {
  background: rgba(5, 8, 22, 0.7);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-light);
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 8px;
}

.hero-coin-container {
  width: 44px;
  height: 44px;
  position: relative;
}

#hero-coin-canvas {
  width: 100%;
  height: 100%;
}

/* ==========================================================================
   Twin Streams: Latest Blocks & Transactions
   ========================================================================== */

.streams-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 1024px) {
  .streams-grid {
    grid-template-columns: 1fr;
  }
}

.stream-card {
  height: 480px;
  display: flex;
  flex-direction: column;
}

.live-counter-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  background: rgba(37, 99, 235, 0.1);
  border: 1px solid rgba(37, 99, 235, 0.3);
  padding: 4px 10px;
  border-radius: 10px;
}

.accent-badge {
  color: var(--accent);
  background: rgba(0, 255, 174, 0.1);
  border-color: rgba(0, 255, 174, 0.3);
}

.stream-list {
  flex: 1;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
}

.stream-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-light);
  padding: 14px 18px;
  border-radius: 16px;
  transition: all var(--transition-fast);
  animation: slideInDown 0.4s ease-out;
}

@keyframes slideInDown {
  from { opacity: 0; transform: translateY(-15px); }
  to { opacity: 1; transform: translateY(0); }
}

.stream-item:hover {
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.3);
  transform: translateX(4px);
}

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

.item-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.item-icon.block { background: rgba(37, 99, 235, 0.15); color: var(--primary); }
.item-icon.tx { background: rgba(0, 255, 174, 0.15); color: var(--accent); }

.item-details {
  display: flex;
  flex-direction: column;
}

.item-title {
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font-code);
  color: var(--white);
}

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

.item-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.item-value {
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-code);
  color: var(--gold);
}

.item-badge {
  font-size: 10px;
  color: var(--accent);
  font-weight: 600;
}

/* ==========================================================================
   Telemetry Section (TPS Gauge, Gas Semicircle, Network Health)
   ========================================================================== */

.telemetry-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 24px;
}

@media (max-width: 1100px) {
  .telemetry-grid {
    grid-template-columns: 1fr;
  }
}

.gauge-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.gauge-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  width: 100%;
}

.circular-gauge-wrapper, .semicircle-gauge-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gauge-center-readout {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.gauge-value {
  font-size: 26px;
  font-weight: 800;
  font-family: var(--font-code);
  color: var(--white);
}

.gauge-label {
  font-size: 11px;
  color: var(--primary);
  font-weight: 700;
  letter-spacing: 1px;
}

.gauge-sub-info {
  margin-top: 14px;
  display: flex;
  gap: 20px;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}

.semicircle-readout {
  position: absolute;
  bottom: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.gas-tier-label {
  font-size: 14px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 1px;
}

.gas-numeric {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-code);
}

.gas-tiers-indicator {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.tier {
  padding: 4px 12px;
  font-size: 10px;
  font-weight: 700;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-dim);
}

.tier.low.active { background: rgba(0, 255, 174, 0.2); color: var(--accent); border: 1px solid var(--accent); }
.tier.med.active { background: rgba(255, 215, 0, 0.2); color: var(--gold); border: 1px solid var(--gold); }
.tier.high.active { background: rgba(239, 68, 68, 0.2); color: #ef4444; border: 1px solid #ef4444; }

/* Network Health Card */
.health-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  width: 100%;
  padding-top: 10px;
}

.heartbeat-box {
  position: relative;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.heartbeat-icon {
  font-size: 32px;
  color: var(--accent);
  z-index: 2;
  animation: pulseBeat 1.2s infinite ease-in-out;
}

@keyframes pulseBeat {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.18); text-shadow: 0 0 20px var(--accent); }
}

.heartbeat-pulse-ring {
  position: absolute;
  inset: 0;
  border: 2px solid var(--accent);
  border-radius: 50%;
  animation: ringPulse 2s infinite ease-out;
  opacity: 0;
}

.heartbeat-pulse-ring.delay {
  animation-delay: 0.6s;
}

@keyframes ringPulse {
  0% { transform: scale(0.5); opacity: 0.8; }
  100% { transform: scale(1.6); opacity: 0; }
}

.health-score-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 12px;
}

.health-score-number {
  font-size: 28px;
  font-weight: 900;
  font-family: var(--font-code);
  color: var(--white);
}

.health-status-text {
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
}

.health-metrics-list {
  margin-top: 16px;
  width: 100%;
  display: flex;
  justify-content: space-around;
  background: rgba(255, 255, 255, 0.03);
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 11px;
  color: var(--text-muted);
}

/* ==========================================================================
   Charts Grid (ApexCharts Line Chart & Token Analytics)
   ========================================================================== */

.charts-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

@media (max-width: 1100px) {
  .charts-grid {
    grid-template-columns: 1fr;
  }
}

.chart-card {
  height: 400px;
  display: flex;
  flex-direction: column;
}

.chart-time-filter {
  display: flex;
  gap: 4px;
  background: rgba(255, 255, 255, 0.04);
  padding: 4px;
  border-radius: 10px;
}

.time-btn {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.time-btn.active {
  background: var(--primary);
  color: var(--white);
  box-shadow: 0 0 10px var(--primary-glow);
}

.chart-container {
  flex: 1;
  width: 100%;
  height: 100%;
  padding: 10px 16px;
}

/* ==========================================================================
   Bottom Grid: AI Insights & Activity Stream
   ========================================================================== */

.bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 1024px) {
  .bottom-grid {
    grid-template-columns: 1fr;
  }
}

.ai-insights-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.ai-sparkle-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--secondary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 18px;
  box-shadow: 0 0 20px var(--secondary-glow);
}

.ai-live-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--secondary);
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.4);
  padding: 4px 12px;
  border-radius: 12px;
}

.ai-metrics-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ai-metric-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ai-metric-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.ai-metric-bar-wrapper {
  height: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.ai-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 4px;
  transition: width 1s ease-in-out;
}

.secondary-fill { background: linear-gradient(90deg, var(--secondary), var(--primary)); }
.accent-fill { background: linear-gradient(90deg, var(--accent), var(--gold)); }
.gold-fill { background: linear-gradient(90deg, var(--gold), var(--accent)); }

.ai-metric-val {
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-code);
  color: var(--white);
  align-self: flex-end;
}

.ai-predictions-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-light);
  padding: 16px;
  border-radius: 16px;
}

.pred-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 12px;
}

.pred-title {
  display: block;
  font-weight: 700;
  color: var(--white);
}

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

/* Timeline Card */
.timeline-card {
  height: 480px;
  display: flex;
  flex-direction: column;
}

.timeline-container {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.timeline-stream {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
}

.timeline-stream::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 19px;
  width: 2px;
  background: rgba(255, 255, 255, 0.08);
}

.timeline-item {
  display: flex;
  gap: 16px;
  position: relative;
}

.timeline-dot {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-dark);
  border: 2px solid var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--primary);
  z-index: 2;
  box-shadow: 0 0 10px var(--primary-glow);
}

.timeline-dot.block { border-color: var(--primary); color: var(--primary); }
.timeline-dot.tx { border-color: var(--accent); color: var(--accent); }
.timeline-dot.contract { border-color: var(--secondary); color: var(--secondary); }
.timeline-dot.validator { border-color: var(--gold); color: var(--gold); }

.timeline-body {
  flex: 1;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-light);
  padding: 12px 16px;
  border-radius: 14px;
}

.timeline-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--white);
}

.timeline-time {
  font-size: 10px;
  color: var(--text-dim);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
  margin-top: 40px;
  background: rgba(5, 8, 22, 0.85);
  border-top: 1px solid var(--border-light);
  padding: 32px;
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 800;
}

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

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

.footer-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: color var(--transition-fast);
}

.footer-link:hover {
  color: var(--accent);
}

.footer-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.version-tag {
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-code);
  color: var(--primary);
  background: rgba(37, 99, 235, 0.1);
  padding: 2px 8px;
  border-radius: 6px;
}

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

/* ==========================================================================
   Toast Notification Popups
   ========================================================================== */

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: rgba(13, 20, 41, 0.9);
  backdrop-filter: blur(20px);
  border: 1px solid var(--accent);
  padding: 14px 20px;
  border-radius: 16px;
  color: var(--white);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 0 25px var(--accent-glow);
  display: flex;
  align-items: center;
  gap: 12px;
  animation: toastSlideIn 0.3s ease-out;
}

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateX(50px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ==========================================================================
   Media Queries & Responsiveness
   ========================================================================== */

@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-wrapper {
    margin-left: 0;
  }

  .mobile-toggle-btn {
    display: flex;
  }

  .header-metrics {
    display: none;
  }

  .dashboard-content {
    padding: 16px;
  }
}

/* Connect Wallet Button */
.connect-wallet-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.25), rgba(0, 255, 174, 0.15));
  border: 1px solid rgba(0, 255, 174, 0.4);
  border-radius: 14px;
  color: var(--white);
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 0 0 15px rgba(0, 255, 174, 0.2);
  transition: all var(--transition-fast);
}

.connect-wallet-btn:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 0 25px var(--accent-glow);
}

/* Modal Overlay Styling */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 22, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: 100%;
  max-width: 680px;
  background: rgba(13, 20, 41, 0.95);
  border: 1px solid rgba(37, 99, 235, 0.4);
  border-radius: 24px;
  box-shadow: 0 0 50px rgba(37, 99, 235, 0.3);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: scale(0.9);
  transition: transform var(--transition-normal);
}

.modal-overlay.open .modal-card {
  transform: scale(1);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.modal-close:hover {
  color: var(--accent);
}

.modal-body {
  padding: 24px;
  max-height: 500px;
  overflow-y: auto;
  font-family: var(--font-code);
  font-size: 13px;
}

.loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px 0;
  color: var(--accent);
  font-size: 16px;
}

.rpc-detail-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rpc-detail-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  word-break: break-all;
}

.rpc-label {
  color: var(--text-muted);
  font-weight: 600;
  min-width: 140px;
}

.rpc-val {
  color: var(--white);
  font-weight: 700;
  text-align: right;
}

