@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;600&family=IBM+Plex+Mono:wght@400;600&display=swap');

:root {
  --bg: #0b1116;
  --bg-2: #111a21;
  --bg-3: #1a2732;
  --accent: #6ee7d8;
  --accent-2: #f6c177;
  --accent-3: #a6e3a1;
  --text: #e6edf3;
  --muted: #9fb0bd;
  --danger: #ff6b6b;
  --neutral: #ffffff;
  --ok: #4ade80;
  --top-purple: #b461ff;
  --card: rgba(17, 26, 33, 0.85);
  --border: rgba(110, 231, 216, 0.15);
  --great: #cba6f7;
  /* Lavender/Light Purple */
}

.level-bad {
  color: var(--danger) !important;
}

.level-neutral {
  color: var(--neutral) !important;
}

.level-good {
  color: var(--ok) !important;
}

.level-top {
  color: var(--top-purple) !important;
  text-shadow: 0 0 10px rgba(180, 97, 255, 0.3);
  font-weight: bold;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Space Grotesk', system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  position: relative;
}

.bg {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 10% 10%, rgba(110, 231, 216, 0.15), transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(246, 193, 119, 0.12), transparent 40%),
    radial-gradient(circle at 50% 80%, rgba(166, 227, 161, 0.1), transparent 45%);
  z-index: -1;
}

.hero {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 2rem 6vw 1.5rem;
  background: linear-gradient(to bottom, rgba(13, 21, 27, 0.4), transparent);
}

/* Row 1: Top Bar */
.hero-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(110, 231, 216, 0.1);
  padding-bottom: 1rem;
}

.top-branding {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-logo-mini {
  width: 40px;
  height: 40px;
  border-radius: 0.6rem;
  box-shadow: 0 0 15px rgba(110, 231, 216, 0.2);
}

.badge-mini {
  font-size: 0.65rem;
  text-transform: uppercase;
  color: var(--accent);
  letter-spacing: 0.1em;
  font-weight: 600;
}

.brand-name-mini {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
}

.top-status-bar {
  display: flex;
  gap: 1.5rem;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.5rem 1.2rem;
  border-radius: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.status-node-mini {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.status-node-mini span {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--muted);
  font-family: 'IBM Plex Mono', monospace;
}

.status-light-mini {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 5px rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.status-online {
  background: var(--ok) !important;
  box-shadow: 0 0 12px var(--ok) !important;
  animation: statusPulse 2s infinite ease-in-out;
}

@keyframes statusPulse {
  0% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.7;
    transform: scale(1.1);
    box-shadow: 0 0 18px var(--ok) !important;
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.status-offline {
  background: var(--danger) !important;
  box-shadow: 0 0 12px var(--danger) !important;
}

/* Row 2: Main Content */
.hero-main-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  align-items: center;
  gap: 3rem;
  padding: 1rem 0;
}

.summary-text {
  font-size: 1.15rem;
  line-height: 1.6;
  color: var(--text);
  max-width: 600px;
  opacity: 0.9;
  font-weight: 400;
  letter-spacing: 0.01em;
}

.hero-action-center {
  display: flex;
  justify-content: flex-end;
}

.hero-action-card {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 1.8rem 2.5rem;
  border-radius: 1.8rem;
  width: 100%;
  max-width: 450px;
  text-align: center;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  position: relative;
  overflow: hidden;
}

.hero-action-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--accent);
  opacity: 0.3;
}

.hero-action-header {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.5rem;
}

.hero-action-title {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--muted);
}

.hero-action-value {
  font-size: 4rem;
  font-weight: 600;
  line-height: 1;
  margin: 0.5rem 0;
  letter-spacing: -0.02em;
}

.hero-action-sub {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.9rem;
  color: var(--accent-2);
  opacity: 0.8;
}

/* Row 3: Stats Bar */
.hero-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.mini-stat-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 1.2rem;
  border-radius: 1.2rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.mini-title {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.4rem;
  display: flex;
  justify-content: space-between;
}

.mini-value {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.2rem;
}

.mini-sub {
  font-size: 0.75rem;
  color: var(--accent);
  font-family: 'IBM Plex Mono', monospace;
  opacity: 0.7;
}

.grid {
  display: grid;
  gap: 2.5rem;
  padding: 1rem 6vw 4rem;
}

.card {
  background: rgba(17, 26, 33, 0.7);
  border: 1px solid var(--border);
  border-radius: 1.8rem;
  padding: 1.8rem;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  animation: floatIn 0.6s cubic-bezier(0.23, 1, 0.32, 1) both;
}

@keyframes floatIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.card-header h2 {
  margin: 0;
}

.card-header p {
  color: var(--muted);
  margin: 0.2rem 0 0;
}

.pill {
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  font-size: 0.8rem;
  background: rgba(255, 255, 255, 0.08);
  color: var(--accent-2);
}

/* Unified Monitor Grid */
.monitor-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
  margin-top: 1rem;
}

/* Secondary Highlight Row (Bottom) */
.monitor-row-highlight {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
  margin-top: 1.5rem;
  padding: 1.2rem;
  border-radius: 1.5rem;
  border: 3px solid var(--accent);
  background: rgba(110, 231, 216, 0.08);
  box-shadow: 0 0 20px rgba(110, 231, 216, 0.1);
}

.live-metric {
  background: rgba(255, 255, 255, 0.03);
  padding: 1.2rem;
  border-radius: 1.2rem;
  border: 1px dashed rgba(110, 231, 216, 0.2);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 120px;
  transition: transform 0.2s ease, background 0.2s ease;
}

.live-metric:hover {
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-2px);
}

.metric-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.metric-header span {
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.metric-value-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0.2rem 0;
}

.live-metric strong {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.metric-footer {
  margin-top: 0.4rem;
  display: block;
  min-height: 1rem;
}

.trend-arrow {
  display: inline-block;
  font-size: 1.2rem;
  font-weight: bold;
  transition: all 0.3s ease;
  min-width: 1.2rem;
  text-align: center;
}

.live-metric small {
  color: var(--accent);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.85rem;
}

.trend-up {
  color: var(--ok);
}

.trend-down {
  color: var(--danger);
}

.trend-neutral {
  color: var(--muted);
  opacity: 0.5;
}

.sparkline-wrap {
  margin-top: 1.5rem;
  background: rgba(255, 255, 255, 0.02);
  padding: 1rem;
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.console-actions {
  display: flex;
  gap: 0.6rem;
}

button {
  background: rgba(110, 231, 216, 0.15);
  border: 1px solid rgba(110, 231, 216, 0.4);
  color: var(--text);
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.trend-cell {
  text-align: center;
  font-weight: 600;
}

.trend-up {
  color: var(--ok);
}

.trend-down {
  color: var(--danger);
}

.trend-flat {
  color: var(--muted);
}

button:hover {
  transform: translateY(-1px);
  background: rgba(110, 231, 216, 0.25);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.85rem;
}

thead {
  text-align: left;
  color: var(--muted);
}

th,
td {
  padding: 0.6rem 0.4rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

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

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.chart-card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.2);
}

.chart-card h3 {
  margin: 0 0 0.6rem;
}

.top-list {
  display: grid;
  gap: 0.5rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.9rem;
}

.top-item {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.4rem 0.6rem;
  border-radius: 0.6rem;
  background: rgba(255, 255, 255, 0.05);
}

.heatmap-wrap {
  overflow-x: auto;
}

.heatmap-grid {
  display: grid;
  grid-template-columns: repeat(25, minmax(22px, 1fr));
  gap: 4px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  align-items: center;
}

.heatmap-cell {
  height: 22px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.05);
}

.heatmap-label {
  background: transparent;
  color: var(--muted);
}

.lab-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

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

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip {
  background: rgba(246, 193, 119, 0.2);
  color: var(--accent-2);
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-size: 0.8rem;
}

.rules {
  color: var(--muted);
  font-size: 0.9rem;
}

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

.action-card {
  border: 1px solid rgba(110, 231, 216, 0.3);
}

.action-buy .hero-action-value {
  color: var(--ok);
  text-shadow: 0 0 30px rgba(78, 201, 176, 0.4);
}

.action-sell .hero-action-value {
  color: var(--danger);
  text-shadow: 0 0 30px rgba(255, 107, 107, 0.4);
}

.action-wait .hero-action-value {
  color: var(--accent-2);
}

.mini {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.2);
}

.mini span {
  color: var(--muted);
  font-size: 0.85rem;
}

.mini strong {
  display: block;
  font-size: 1.3rem;
  margin-top: 0.3rem;
}

body {
  margin: 0;
  font-family: 'Space Grotesk', system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  min-height: -webkit-fill-available;
  position: relative;
  overflow-x: hidden;
}

html {
  height: -webkit-fill-available;
}

.footer {
  margin-top: 4rem;
  padding: 2rem 5vw;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  background: rgba(10, 10, 20, 0.4);
}

.footer-left,
.footer-right {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.footer-center {
  flex: 1;
  text-align: center;
}

.version-tag {
  background: rgba(110, 231, 216, 0.1);
  color: var(--accent);
  padding: 0.4rem 1rem;
  border-radius: 2rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  border: 1px solid rgba(110, 231, 216, 0.2);
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

#page-info {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.9rem;
  color: var(--muted);
}

/* Tooltip System */
.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid var(--muted);
  color: var(--muted);
  font-size: 10px;
  font-family: 'IBM Plex Mono', monospace;
  margin-left: 6px;
  cursor: help;
  vertical-align: middle;
  transition: all 0.2s ease;
  position: relative;
}

.info-icon:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(110, 231, 216, 0.1);
}

.info-icon::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 150%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-3);
  color: var(--text);
  padding: 0.8rem 1rem;
  border-radius: 0.8rem;
  border: 1px solid var(--border);
  font-size: 0.8rem;
  width: 240px;
  line-height: 1.4;
  z-index: 1000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  text-align: left;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 400;
}

.info-icon:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(-5px);
}

/* Responsive Design Overhaul */
@media (max-width: 1024px) {
  .hero {
    padding: 2rem 5vw 1.5rem;
    gap: 1.5rem;
  }

  .hero-main-layout {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding: 0.5rem 0;
  }

  .hero-summary-box {
    order: 2;
    width: 100%;
  }

  .hero-action-center {
    order: 1;
    width: 100%;
    justify-content: center;
  }

  .hero-action-card {
    max-width: 100%;
    padding: 1.5rem;
  }

  .hero-action-value {
    font-size: 3.2rem;
  }

  .hero-stats-row {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .grid {
    grid-template-columns: 1fr !important;
    padding: 0 5vw 3rem;
    gap: 2rem;
  }
}

@media (max-width: 640px) {
  .hero h1 {
    font-size: 2.2rem;
    line-height: 1.1;
  }

  .hero p {
    font-size: 1rem;
  }

  .live-row {
    flex-direction: column;
    gap: 1.8rem;
  }

  .live-metric {
    width: 100%;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }

  .live-metric:last-child {
    border-bottom: none;
  }

  .table-wrap {
    margin: 0 -1rem;
    padding: 0 1rem;
    width: calc(100% + 2rem);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table {
    min-width: 700px;
  }

  .analytics-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .card {
    padding: 1.5rem;
  }
}

/* Real-Time Flash Animations */
@keyframes pulseHighlight {
  0% {
    background: rgba(110, 231, 216, 0.4);
    transform: scale(1.02);
  }

  100% {
    background: transparent;
    transform: scale(1);
  }
}

.updated-flash {
  animation: pulseHighlight 1s cubic-bezier(0.23, 1, 0.32, 1);
  border-radius: 4px;
}

.updated-flash-green {
  animation: pulseHighlightGreen 1s cubic-bezier(0.23, 1, 0.32, 1);
  border-radius: 4px;
}

.updated-flash-red {
  animation: pulseHighlightRed 1s cubic-bezier(0.23, 1, 0.32, 1);
  border-radius: 4px;
}

@keyframes pulseHighlightGreen {
  0% {
    background: rgba(78, 201, 176, 0.4);
  }

  100% {
    background: transparent;
  }
}

@keyframes pulseHighlightRed {
  0% {
    background: rgba(255, 107, 107, 0.4);
  }

  100% {
    background: transparent;
  }
}