/* ══════════════════════════════════════════════════════════════════════════════
   SCT Bot Dashboard Styles
   Add this to your main stylesheet or include as a separate file
   ══════════════════════════════════════════════════════════════════════════════ */

/* ── Variables ─────────────────────────────────────────────────────────────── */
:root {
  --bot-bg: #0a0a0f;
  --bot-card: rgba(255,255,255,0.03);
  --bot-border: rgba(255,255,255,0.08);
  --bot-text: #f0f0f5;
  --bot-muted: #55556a;
  --bot-accent: #00d4aa;
  --bot-danger: #ff4757;
  --bot-warning: #ffa502;
  --bot-info: #70a1ff;
  --bot-btc: #f7931a;
  --bot-eth: #627eea;
  --bot-ltc: #bfbbbb;
}

/* ── Dashboard Container ───────────────────────────────────────────────────── */
.bot-dashboard {
  padding: 20px;
  max-width: 1400px;
  margin: 0 auto;
}

/* ── Header ────────────────────────────────────────────────────────────────── */
.bot-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding: 16px 20px;
  background: var(--bot-card);
  border: 1px solid var(--bot-border);
  border-radius: 12px;
}

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

.bot-header-left h1 {
  font-size: 24px;
  font-weight: 700;
  margin: 0;
  color: var(--bot-text);
}

.bot-mode {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.mode-shadow {
  background: rgba(255,165,2,0.15);
  color: var(--bot-warning);
}

.mode-live {
  background: rgba(255,71,87,0.15);
  color: var(--bot-danger);
}

.bot-status {
  font-size: 13px;
  font-weight: 600;
}

.status-running {
  color: var(--bot-accent);
}

.status-stopped {
  color: var(--bot-muted);
}

.bot-header-right {
  display: flex;
  gap: 24px;
}

.bot-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

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

.bot-stat .stat-value {
  font-size: 16px;
  font-weight: 600;
  font-family: 'SF Mono', monospace;
}

.ws-connected {
  color: var(--bot-accent);
}

/* ── Asset Tabs ────────────────────────────────────────────────────────────── */
.asset-tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.asset-tab {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bot-card);
  border: 1px solid var(--bot-border);
  border-radius: 10px;
  color: var(--bot-text);
  cursor: pointer;
  transition: all 0.2s;
}

.asset-tab:hover {
  background: rgba(255,255,255,0.05);
}

.asset-tab.active {
  border-color: var(--bot-accent);
  background: rgba(0,212,170,0.08);
}

.asset-icon {
  font-size: 24px;
  font-weight: 700;
}

.asset-tab:nth-child(1) .asset-icon { color: var(--bot-btc); }
.asset-tab:nth-child(2) .asset-icon { color: var(--bot-eth); }
.asset-tab:nth-child(3) .asset-icon { color: var(--bot-ltc); }

.asset-name {
  font-weight: 600;
}

.asset-price {
  font-family: 'SF Mono', monospace;
  font-size: 14px;
  margin-left: auto;
}

.asset-regime {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  font-weight: 600;
}

.regime-ranging {
  background: rgba(112,161,255,0.15);
  color: var(--bot-info);
}

.regime-volatile {
  background: rgba(255,71,87,0.15);
  color: var(--bot-danger);
}

/* ── Period Selector ───────────────────────────────────────────────────────── */
.period-selector {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.period-btn {
  padding: 8px 16px;
  background: transparent;
  border: 1px solid var(--bot-border);
  border-radius: 6px;
  color: var(--bot-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.period-btn:hover {
  color: var(--bot-text);
  border-color: var(--bot-text);
}

.period-btn.active {
  background: var(--bot-accent);
  border-color: var(--bot-accent);
  color: #000;
}

/* ── Charts ────────────────────────────────────────────────────────────────── */
.charts-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.chart-card {
  background: var(--bot-card);
  border: 1px solid var(--bot-border);
  border-radius: 12px;
  padding: 16px;
}

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

.chart-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--bot-text);
  margin: 0;
}

.chart-legend {
  display: flex;
  gap: 12px;
  font-size: 11px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.legend-item::before {
  content: '';
  width: 12px;
  height: 3px;
  border-radius: 2px;
}

.legend-price::before { background: var(--bot-accent); }
.legend-ema-short::before { background: var(--bot-warning); }
.legend-ema-long::before { background: #ff6b81; }
.legend-sma::before { background: var(--bot-info); border-style: dashed; }

.chart-container {
  height: 250px;
  position: relative;
}

.chart-signals {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.signal-marker {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 4px;
}

/* ── Data Cards ────────────────────────────────────────────────────────────── */
.data-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.data-card {
  background: var(--bot-card);
  border: 1px solid var(--bot-border);
  border-radius: 12px;
  padding: 16px;
  max-height: 400px;
  overflow-y: auto;
}

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

.card-header h3 {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
}

.badge {
  background: var(--bot-accent);
  color: #000;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
}

/* ── Positions ─────────────────────────────────────────────────────────────── */
.position-item {
  padding: 12px;
  background: rgba(255,255,255,0.02);
  border-radius: 8px;
  margin-bottom: 8px;
}

.position-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.position-asset {
  font-weight: 700;
  font-size: 14px;
}

.position-strategy {
  font-size: 11px;
  color: var(--bot-muted);
  text-transform: uppercase;
}

.position-details {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

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

.position-stat .label {
  font-size: 10px;
  color: var(--bot-muted);
  text-transform: uppercase;
}

.position-stat .value {
  font-size: 13px;
  font-family: 'SF Mono', monospace;
}

.pnl-positive { color: var(--bot-accent); }
.pnl-negative { color: var(--bot-danger); }

/* ── Signals ───────────────────────────────────────────────────────────────── */
.signal-item {
  display: grid;
  grid-template-columns: 70px 80px 50px 70px 60px 80px 30px;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--bot-border);
  font-size: 12px;
}

.signal-time {
  color: var(--bot-muted);
  font-family: 'SF Mono', monospace;
}

.signal-action {
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  text-align: center;
  font-size: 11px;
}

.action-buy {
  background: rgba(0,212,170,0.15);
  color: var(--bot-accent);
}

.action-sell {
  background: rgba(255,71,87,0.15);
  color: var(--bot-danger);
}

.action-hold {
  background: rgba(255,255,255,0.05);
  color: var(--bot-muted);
}

.signal-strategy {
  color: var(--bot-muted);
  text-transform: uppercase;
  font-size: 10px;
}

.signal-confidence {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  text-align: center;
}

.conf-high { background: rgba(0,212,170,0.15); color: var(--bot-accent); }
.conf-medium { background: rgba(255,165,2,0.15); color: var(--bot-warning); }
.conf-low { background: rgba(255,255,255,0.05); color: var(--bot-muted); }

.signal-price {
  font-family: 'SF Mono', monospace;
  text-align: right;
}

.executed-yes { color: var(--bot-accent); }
.executed-no { color: var(--bot-muted); }

.empty-state {
  text-align: center;
  padding: 40px;
  color: var(--bot-muted);
}

/* ── Summary ───────────────────────────────────────────────────────────────── */
.summary-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.summary-card {
  background: var(--bot-card);
  border: 1px solid var(--bot-border);
  border-radius: 12px;
  padding: 16px;
}

.summary-card h3 {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 16px 0;
}

.summary-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.summary-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.summary-stat .stat-value {
  font-size: 20px;
  font-weight: 700;
  font-family: 'SF Mono', monospace;
}

.summary-stat .stat-label {
  font-size: 10px;
  color: var(--bot-muted);
  text-transform: uppercase;
  margin-top: 4px;
}

.by-asset-grid,
.by-strategy-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.asset-summary,
.strategy-summary {
  display: grid;
  grid-template-columns: 1fr 80px 60px;
  gap: 8px;
  align-items: center;
  padding: 8px;
  background: rgba(255,255,255,0.02);
  border-radius: 6px;
}

.strategy-weight-bar {
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  overflow: hidden;
}

.weight-fill {
  height: 100%;
  background: var(--bot-accent);
  border-radius: 3px;
}

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .charts-row {
    grid-template-columns: 1fr;
  }
  
  .data-row {
    grid-template-columns: 1fr;
  }
  
  .summary-row {
    grid-template-columns: 1fr;
  }
  
  .bot-header {
    flex-direction: column;
    gap: 16px;
  }
  
  .bot-header-right {
    flex-wrap: wrap;
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .asset-tabs {
    flex-direction: column;
  }
  
  .position-details {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .signal-item {
    grid-template-columns: 60px 60px 45px 1fr;
    font-size: 11px;
  }
  
  .signal-item > :nth-child(n+5) {
    display: none;
  }
}
