/* =========================
   GLOBAL RESET
========================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #000000;
  color: #cfd6e4;
  font-family: "JetBrains Mono", Consolas, monospace;
}

/* =========================
   LOADING SCREEN
========================= */
#loader {
  position: fixed;
  inset: 0;
  background: #000000;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loader-inner {
  width: 320px;
  text-align: center;
}

.loader-logo {
  width: 88px;
  height: 88px;
  margin: 0 auto 22px;
  border-radius: 50%;
  border: 1px solid #2b6cff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  letter-spacing: 2px;
  animation: spin 5s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.loader-label {
  font-size: 0.75rem;
  color: #7f8899;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 16px;
}

.loader-bar {
  width: 100%;
  height: 6px;
  background: #0f141f;
  border-radius: 4px;
  overflow: hidden;
}

#loader-progress {
  height: 100%;
  width: 0%;
  background: linear-gradient(
    90deg,
    #2b6cff,
    #38d39f
  );
}

.loader-count {
  margin-top: 10px;
  font-size: 0.75rem;
  color: #5f6675;
}

/* =========================
   STICKY TERMINAL HEADER
========================= */
.terminal-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 58px;
  background: #000000;
  border-bottom: 1px solid #111827;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 20px;
}

.header-context {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #7f8899;
}

/* LOGO */
.header-logo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid #2b6cff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.logo-link:hover .header-logo {
  transform: rotate(180deg);
  box-shadow: 0 0 10px rgba(43,108,255,0.5);
}

/* BACK BUTTON */
.back-btn {
  font-size: 0.75rem;
  color: #7f8899;
  text-decoration: none;
  transition: color 0.3s ease;
}

.back-btn:hover {
  color: #2b6cff;
}

/* =========================
   PLACEHOLDER
========================= */
.page-placeholder {
  height: 200vh;
}



/* =========================
   HERO FUND SECTION
========================= */
.hero-fund {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 40px;
  padding: 40px 24px;
  background: #000000;
  border-bottom: 1px solid #111827;
}

.hero-left h1 {
  font-size: 1.2rem;
  font-weight: 500;
  margin-bottom: 8px;
}

.hero-sub {
  font-size: 0.75rem;
  color: #7f8899;
  margin-bottom: 20px;
}

.fund-total {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: #7f8899;
  letter-spacing: 1px;
  margin-bottom: 18px;
}

.fund-total span {
  display: block;
  font-size: 1.1rem;
  color: #e5e9f0;
  margin-top: 4px;
}

.allocation-legend {
  list-style: none;
  font-size: 0.75rem;
}

.allocation-legend li {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  color: #cfd6e4;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

/* =========================
   PIE CHART + TOOLTIP
========================= */
.hero-right {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.chart-tooltip {
  position: absolute;
  background: #0f141f;
  border: 1px solid #1f2937;
  padding: 6px 10px;
  font-size: 0.7rem;
  color: #e5e9f0;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -120%);
  white-space: nowrap;
}



/* =========================
   TRADES TERMINAL
========================= */
.trades-terminal {
  padding: 26px;
  border-top: 1px solid #111827;
}

.trades-header {
  display: flex;
  gap: 14px;
  align-items: baseline;
  margin-bottom: 14px;
}

.trades-header h2 {
  font-size: 0.95rem;
  font-weight: 500;
}

.trades-sub {
  font-size: 0.7rem;
  color: #7f8899;
}

.trades-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
}

.trades-table th {
  text-align: left;
  padding: 8px 6px;
  color: #7f8899;
  border-bottom: 1px solid #111827;
}

.trades-table td {
  padding: 8px 6px;
  border-bottom: 1px solid #0b1020;
  white-space: nowrap;
}

.trade-open { color: #38d39f; }
.trade-closed { color: #7f8899; }
.trade-pending { color: #f59e0b; }

.pl-up { color: #2ecc71; }
.pl-down { color: #e74c3c; }

.sparkline {
  width: 70px;
  height: 18px;
}



/* =========================
   EQUITY CURVE
========================= */
.equity-curve-section {
  padding: 28px 24px 34px;
  border-top: 1px solid #111827;
  background: #000000;
}

.equity-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
}

.equity-header h3 {
  font-size: 0.9rem;
  font-weight: 500;
}

.equity-sub {
  font-size: 0.7rem;
  color: #7f8899;
}

#equityCanvas {
  width: 100%;
  height: 220px;
  background: #05070d;
  border: 1px solid #0b1020;
}



/* =========================
   WIN / LOSS RATIO
========================= */
.winloss-section {
  padding: 26px 24px 30px;
  border-top: 1px solid #111827;
  background: #000000;
}

.winloss-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
}

.winloss-header h3 {
  font-size: 0.9rem;
  font-weight: 500;
}

.winloss-sub {
  font-size: 0.7rem;
  color: #7f8899;
}

/* BAR */
.winloss-bar {
  position: relative;
  height: 16px;
  width: 100%;
  background: #0b1020;
  border: 1px solid #111827;
  display: flex;
  overflow: hidden;
}

.wins-bar {
  height: 100%;
  background: linear-gradient(90deg, #2ecc71, #38d39f);
  width: 65%;
  transition: width 1.2s ease;
}

.losses-bar {
  height: 100%;
  background: linear-gradient(90deg, #e74c3c, #ef4444);
  width: 35%;
  transition: width 1.2s ease;
}

/* LABELS */
.winloss-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 0.75rem;
}

.wins-label {
  color: #2ecc71;
}

.losses-label {
  color: #e74c3c;
}



/* =========================
   CAPITAL FLOW
========================= */
.capital-flow-section {
  padding: 26px 24px 34px;
  border-top: 1px solid #111827;
  background: #000000;
}

.capital-flow-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 16px;
}

.capital-flow-header h3 {
  font-size: 0.9rem;
  font-weight: 500;
}

.capital-flow-sub {
  font-size: 0.7rem;
  color: #7f8899;
}

/* FLOW ROWS */
.flow-row {
  display: grid;
  grid-template-columns: 70px 1fr 70px;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.flow-label {
  font-size: 0.7rem;
  color: #7f8899;
  text-transform: uppercase;
}

.flow-bar {
  height: 12px;
  background: #0b1020;
  border: 1px solid #111827;
  overflow: hidden;
}

.flow-in {
  height: 100%;
  width: 40%;
  background: linear-gradient(90deg, #2ecc71, #38d39f);
  transition: width 1.2s ease;
}

.flow-out {
  height: 100%;
  width: 30%;
  background: linear-gradient(90deg, #e74c3c, #ef4444);
  transition: width 1.2s ease;
}

.flow-value {
  font-size: 0.75rem;
  text-align: right;
}

/* NET FLOW */
.flow-net {
  margin-top: 14px;
  font-size: 0.75rem;
  color: #7f8899;
}

.net-positive {
  color: #2ecc71;
}

.net-negative {
  color: #e74c3c;
}



/* =========================
   ASSET EXPOSURE
========================= */
.asset-exposure-section {
  padding: 26px 24px 36px;
  border-top: 1px solid #111827;
  background: #000000;
}

.asset-exposure-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 16px;
}

.asset-exposure-header h3 {
  font-size: 0.9rem;
  font-weight: 500;
}

.asset-exposure-sub {
  font-size: 0.7rem;
  color: #7f8899;
}

/* STACKED BAR */
.exposure-bar {
  display: flex;
  height: 18px;
  width: 100%;
  background: #0b1020;
  border: 1px solid #111827;
  overflow: hidden;
  margin-bottom: 14px;
}

.exposure-segment {
  height: 100%;
  transition: width 1.5s ease;
}

/* LEGEND */
.exposure-legend {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px 16px;
  font-size: 0.75rem;
}

.exposure-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.exposure-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}



/* =========================
   TRADE DURATION DISTRIBUTION
========================= */
.duration-section {
  padding: 26px 24px 36px;
  border-top: 1px solid #111827;
  background: #000000;
}

.duration-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 16px;
}

.duration-header h3 {
  font-size: 0.9rem;
  font-weight: 500;
}

.duration-sub {
  font-size: 0.7rem;
  color: #7f8899;
}

/* ROWS */
.duration-bars {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.duration-row {
  display: grid;
  grid-template-columns: 90px 1fr 50px;
  align-items: center;
  gap: 12px;
}

.duration-label {
  font-size: 0.7rem;
  color: #7f8899;
}

.duration-bar {
  height: 12px;
  background: #0b1020;
  border: 1px solid #111827;
  overflow: hidden;
}

.duration-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #2b6cff, #38d39f);
  transition: width 1.4s ease;
}

.duration-pct {
  font-size: 0.75rem;
  text-align: right;
  color: #cfd6e4;
}



/* =========================
   VOLATILITY INDEX
========================= */
.volatility-section {
  padding: 26px 24px 36px;
  border-top: 1px solid #111827;
  background: #000000;
}

.volatility-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
}

.volatility-header h3 {
  font-size: 0.9rem;
  font-weight: 500;
}

.volatility-sub {
  font-size: 0.7rem;
  color: #7f8899;
}

#volatilityCanvas {
  width: 100%;
  height: 180px;
  background: #05070d;
  border: 1px solid #0b1020;
}

/* REGIME LABEL */
.volatility-status {
  margin-top: 10px;
  font-size: 0.75rem;
  color: #7f8899;
}

.vol-state {
  margin-left: 6px;
  font-weight: 500;
}

.vol-low {
  color: #38d39f;
}

.vol-moderate {
  color: #f59e0b;
}

.vol-high {
  color: #ef4444;
}



/* =========================
   MINI SPARKLINES GRID
========================= */
.sparklines-section {
  padding: 26px 24px 40px;
  border-top: 1px solid #111827;
  background: #000000;
}

.sparklines-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 16px;
}

.sparklines-header h3 {
  font-size: 0.9rem;
  font-weight: 500;
}

.sparklines-sub {
  font-size: 0.7rem;
  color: #7f8899;
}

/* GRID */
.sparklines-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 14px;
}

.spark-tile {
  border: 1px solid #0b1020;
  background: #05070d;
  padding: 8px;
}

.spark-title {
  font-size: 0.65rem;
  color: #7f8899;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.spark-canvas {
  width: 100%;
  height: 30px;
  display: block;
}



/* =========================
   STRATEGY ALLOCATION
========================= */
.strategy-section {
  padding: 26px 24px 40px;
  border-top: 1px solid #111827;
  background: #000000;
}

.strategy-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 16px;
}

.strategy-header h3 {
  font-size: 0.9rem;
  font-weight: 500;
}

.strategy-sub {
  font-size: 0.7rem;
  color: #7f8899;
}

/* STACKED BAR */
.strategy-bar {
  display: flex;
  height: 18px;
  width: 100%;
  background: #0b1020;
  border: 1px solid #111827;
  overflow: hidden;
  margin-bottom: 14px;
}

.strategy-segment {
  height: 100%;
  transition: width 1.5s ease;
}

/* LABELS */
.strategy-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
}

.strategy-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.strategy-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}




/* =========================
   EDUCATIONAL DISCLAIMER
========================= */
.disclaimer-section {
  padding: 40px 24px 60px;
  background: #000000;
}

.disclaimer-box {
  max-width: 900px;
  margin: 0 auto;
  border: 1px solid #ef4444;
  background: #05070d;
  padding: 24px;
}

.disclaimer-box h4 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 14px;
  color: #ef4444;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.disclaimer-box p {
  font-size: 0.75rem;
  line-height: 1.6;
  color: #cfd6e4;
  margin-bottom: 12px;
}

.disclaimer-note {
  margin-top: 14px;
  font-size: 0.7rem;
  color: #9aa4b2;
}
