/* Premium styling for Arbitrage Terminal */
:root {
  --surface: #0b0e11;
  --surface-2: #181a20;
  --surface-3: #2b2f36;
  --success: #0ecb81;
  --danger: #f6465d;
  --warning: #f0b90b;
  --accent: #3b82f6;
  --glass: rgba(24, 26, 32, 0.65);
  --shadow-soft: 0 8px 32px 0 rgba(0, 0, 0, 0.35);
  --shadow-large: 0 16px 48px 0 rgba(0, 0, 0, 0.6);
  --line: #2b2f36;
  --text: #eaecef;
  --text-muted: #848e9c;
}

body[data-theme="light"] {
  /* Light mode fallback variables that still maintain a slightly futuristic/neon look */
  --surface: #f3f4f6;
  --surface-2: #ffffff;
  --surface-3: #e5e7eb;
  --success: #03a66d;
  --danger: #cf304a;
  --warning: #df9b00;
  --accent: #2563eb;
  --glass: rgba(255, 255, 255, 0.7);
  --shadow-soft: 0 8px 32px 0 rgba(0, 0, 0, 0.08);
  --shadow-large: 0 16px 48px 0 rgba(0, 0, 0, 0.15);
  --line: #e5e7eb;
  --text: #1f2937;
  --text-muted: #6b7280;
}

.arb-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 16px 4px;
}

/* Glassmorphic cards */
.arb-card {
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
  padding: 24px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.arb-card:hover {
  box-shadow: var(--shadow-large);
  border-color: rgba(59, 130, 246, 0.3);
}

.arb-header-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.arb-title-block h1 {
  font-size: 28px;
  font-weight: 800;
  margin: 0;
  background: linear-gradient(135deg, var(--text) 30%, var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.arb-title-block p {
  color: var(--text-muted);
  font-size: 14px;
  margin: 4px 0 0 0;
}

/* Control Panel */
.arb-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 700;
  background: rgba(132, 142, 156, 0.1);
  color: var(--text-muted);
  border: 1px solid var(--line);
}

.status-badge.active {
  background: rgba(14, 203, 129, 0.15);
  color: var(--success);
  border-color: rgba(14, 203, 129, 0.3);
}

.status-badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
}

.status-badge.active .dot {
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
  animation: pulse 1.5s infinite;
}

.btn-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 14px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-toggle.start {
  background: var(--success);
  color: #ffffff;
}

.btn-toggle.start:hover {
  background: #0bb371;
  transform: translateY(-1px);
}

.btn-toggle.stop {
  background: var(--danger);
  color: #ffffff;
}

.btn-toggle.stop:hover {
  background: #e03f53;
  transform: translateY(-1px);
}

/* Dashboard Grid Layouts */
.arb-dashboard-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 24px;
}

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

/* Circular visualization area */
.circular-visual-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  position: relative;
  overflow: hidden;
}

.circular-loop {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  border: 4px dashed var(--line);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: spin 30s linear infinite;
  transition: all 0.5s;
}

.circular-loop.active {
  border-color: var(--accent);
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.15);
}

.node {
  position: absolute;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--surface-3);
  border: 2px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  color: var(--text);
  box-shadow: var(--shadow-soft);
  animation: keep-upright 30s linear infinite;
}

.node.usdt { top: -24px; left: calc(50% - 24px); border-color: #26a17b; background: rgba(38, 161, 123, 0.15); }
.node.xrp  { bottom: 10px; left: -10px; border-color: #3b82f6; background: rgba(59, 130, 246, 0.15); }
.node.btc  { bottom: 10px; right: -10px; border-color: #f0b90b; background: rgba(240, 185, 11, 0.15); }

.circular-center {
  position: absolute;
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  text-align: center;
}

/* Pseudo Monospace CLI log screen */
.terminal-window {
  background: #06080a;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  font-family: 'JetBrains Mono', 'Courier New', Courier, monospace;
  font-size: 12px;
  color: #39ff14; /* Matrix Green */
  height: 300px;
  overflow-y: auto;
  box-shadow: inset 0 0 16px rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.terminal-line {
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-all;
}

/* Tables styling */
.arb-table-container {
  overflow-x: auto;
}

.arb-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.arb-table th {
  padding: 12px 16px;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1.5px solid var(--line);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
}

.arb-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
}

.arb-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.text-success { color: var(--success) !important; font-weight: 600; }
.text-danger  { color: var(--danger) !important; font-weight: 600; }
.text-warning { color: var(--warning) !important; }

/* Badges */
.badge-status {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.badge-status.executed {
  background: rgba(14, 203, 129, 0.15);
  color: var(--success);
}

.badge-status.found {
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent);
}

/* Animations */
@keyframes pulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.5; }
  100% { transform: scale(1); opacity: 1; }
}

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

@keyframes keep-upright {
  from { transform: rotate(0deg); }
  to { transform: rotate(-360deg); }
}
