/**
 * StarTON - Global Exchange Terminal Stylesheet
 * Financial Market Intelligence, Charting, Depth, and Calculators
 */

:root {
  --ex-card-bg: #ffffff;
  --ex-border: #e2e8f0;
  --ex-border-bottom: #cbd5e1;
  --ex-text: #0f172a;
  --ex-muted: #64748b;
  --ex-green: #059669;
  --ex-green-bg: #ecfdf5;
  --ex-red: #dc2626;
  --ex-red-bg: #fef2f2;
  --ex-blue: #0284c7;
  --ex-blue-bg: #f0f9ff;
}

/* Live Market Dashboard Banner */
.ex-market-banner {
  background: #ffffff;
  border: 1px solid var(--ex-border);
  border-bottom: 4px solid var(--ex-border-bottom);
  border-radius: 20px;
  padding: 24px 28px;
  margin-bottom: 30px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
}

.ex-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.ex-kpi-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 16px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ex-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
}

.ex-kpi-lbl {
  font-size: 0.76rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ex-kpi-val {
  font-size: 1.35rem;
  font-weight: 900;
  color: #0f172a;
  margin: 4px 0 2px;
  font-family: 'JetBrains Mono', monospace;
}

/* Shortcut Pills */
.ex-shortcut-strip {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #f1f5f9;
}

.ex-shortcut-btn {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #334155;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.ex-shortcut-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
  border-color: #cbd5e1;
}

/* Market Pair Cards Grid */
.ex-pairs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 18px;
}

.ex-pair-card {
  background: #ffffff;
  border: 1px solid var(--ex-border);
  border-bottom: 3.5px solid var(--ex-border-bottom);
  border-radius: 16px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.ex-pair-card:hover, .ex-pair-card.active {
  transform: translateY(-3px);
  border-color: #0284c7;
  border-bottom-color: #0369a1;
  box-shadow: 0 8px 24px rgba(2, 132, 199, 0.12);
}

.ex-pair-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.ex-pair-sym {
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
}

.ex-pair-change {
  font-size: 0.8rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 6px;
}

.ex-pair-change.pos {
  background: #ecfdf5;
  color: #059669;
}

.ex-pair-change.neg {
  background: #fef2f2;
  color: #dc2626;
}

.ex-pair-price {
  font-size: 1.45rem;
  font-weight: 900;
  font-family: 'JetBrains Mono', monospace;
  color: #0f172a;
  margin-bottom: 8px;
}

.ex-pair-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.76rem;
  color: #64748b;
  border-top: 1px dashed #e2e8f0;
  padding-top: 8px;
}

/* Professional Chart Container */
.ex-chart-container {
  background: #ffffff;
  border: 1px solid var(--ex-border);
  border-bottom: 4px solid var(--ex-border-bottom);
  border-radius: 20px;
  padding: 24px;
  margin-bottom: 28px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
}

.ex-chart-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f1f5f9;
}

.ex-pill-group {
  display: inline-flex;
  background: #f1f5f9;
  padding: 3px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
}

.ex-pill-btn {
  background: transparent;
  border: none;
  font-size: 0.78rem;
  font-weight: 700;
  color: #64748b;
  padding: 5px 12px;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.ex-pill-btn.active {
  background: #0284c7;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.3);
}

.ex-canvas-wrap {
  position: relative;
  width: 100%;
  height: 420px;
  background: #fafafa;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
}

/* Orderbook Grid */
.ex-orderbook-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 16px;
}

.ex-book-panel {
  background: #ffffff;
  border: 1px solid var(--ex-border);
  border-bottom: 3.5px solid var(--ex-border-bottom);
  border-radius: 16px;
  padding: 20px;
}

.ex-book-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1.2fr;
  padding: 6px 8px;
  font-size: 0.82rem;
  font-family: 'JetBrains Mono', monospace;
  position: relative;
  align-items: center;
  border-radius: 6px;
  margin-bottom: 2px;
}

.ex-depth-bar {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  opacity: 0.12;
  border-radius: 4px;
  pointer-events: none;
}

.ex-depth-bar.bid { background: #059669; }
.ex-depth-bar.ask { background: #dc2626; }

/* Trading Tools / Calculator Box */
.ex-tool-card {
  background: #ffffff;
  border: 1px solid var(--ex-border);
  border-bottom: 3.5px solid var(--ex-border-bottom);
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
}

.ex-tool-result-box {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  padding: 20px;
  margin-top: 20px;
  text-align: center;
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .ex-orderbook-grid {
    grid-template-columns: 1fr;
  }
  .ex-canvas-wrap {
    height: 320px;
  }
}
