/* African Forex Academy - True Stock Equity Chart Styling */
:root {
  --asc-bg: #070e1c;
  --asc-card: #0b1628;
  --asc-card-border: #1a2a42;
  --asc-gold: #f5c451;
  --asc-gold2: #ffd978;
  --asc-green: #36e39a;
  --asc-red: #ff5c73;
  --asc-cyan: #3ddcff;
  --asc-silver: #c0c9d4;
  --asc-text: #f0f4fa;
  --asc-muted: #8498b0;
  --asc-subtle: #485c75;
}

.afa-stock-widget {
  background: var(--asc-card);
  border: 1px solid var(--asc-card-border);
  border-radius: 16px;
  padding: 24px 22px 20px;
  color: var(--asc-text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.afa-stock-topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}

.afa-stock-title-group h2 {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--asc-gold);
  margin: 0 0 6px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.afa-stock-badge-pulse {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 9.5px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 99px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.afa-stock-badge-pulse.live {
  background: rgba(54, 227, 154, 0.12);
  border: 1px solid rgba(54, 227, 154, 0.35);
  color: var(--asc-green);
}

.afa-stock-badge-pulse.recorded {
  background: rgba(245, 196, 81, 0.12);
  border: 1px solid rgba(245, 196, 81, 0.35);
  color: var(--asc-gold);
}

.afa-stock-badge-pulse.coming {
  background: rgba(192, 201, 212, 0.12);
  border: 1px solid rgba(192, 201, 212, 0.35);
  color: var(--asc-silver);
}

.afa-stock-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.afa-stock-badge-pulse.live .afa-stock-dot {
  box-shadow: 0 0 8px var(--asc-green);
  animation: afaPulseDot 1.8s infinite;
}

@keyframes afaPulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.8); }
}

/* Tier Switcher Tabs */
.afa-tier-switcher {
  display: inline-flex;
  background: #060b14;
  border: 1px solid #1c2b40;
  border-radius: 10px;
  padding: 3px;
  gap: 3px;
}

.afa-tier-btn {
  background: transparent;
  border: none;
  color: var(--asc-muted);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 7px 14px;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.18s ease;
  text-transform: uppercase;
}

.afa-tier-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.afa-tier-btn.active {
  background: #152438;
  color: var(--asc-gold);
  border: 1px solid rgba(245, 196, 81, 0.4);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.afa-tier-btn[data-tier="silver"].active {
  color: #fff;
  border-color: rgba(192, 201, 212, 0.5);
}

.afa-tier-btn[data-tier="elite"].active {
  color: var(--asc-cyan);
  border-color: rgba(61, 220, 255, 0.5);
}

/* Primary Stock Stats Strip */
.afa-stock-stats-hero {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 8px;
}

.afa-stock-price-main {
  font-size: 38px;
  font-weight: 950;
  color: #fff;
  letter-spacing: -0.5px;
  line-height: 1;
}

.afa-stock-price-main span {
  font-size: 18px;
  font-weight: 700;
  color: var(--asc-muted);
  margin-left: 4px;
}

.afa-stock-change-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 6px;
}

.afa-stock-change-pill.pos {
  background: rgba(54, 227, 154, 0.14);
  color: var(--asc-green);
  border: 1px solid rgba(54, 227, 154, 0.35);
}

.afa-stock-change-pill.neg {
  background: rgba(255, 92, 115, 0.14);
  color: var(--asc-red);
  border: 1px solid rgba(255, 92, 115, 0.35);
}

.afa-stock-subtitle {
  font-size: 11px;
  color: var(--asc-muted);
  margin-bottom: 20px;
}

/* Secondary KPI Strip (Apple Stock Metric Row) */
.afa-stock-metrics-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.afa-stock-metric-cell {
  background: rgba(6, 12, 22, 0.6);
  border: 1px solid rgba(26, 42, 66, 0.7);
  border-radius: 8px;
  padding: 10px 12px;
}

.afa-stock-metric-cell .label {
  font-size: 9px;
  font-weight: 700;
  color: var(--asc-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 4px;
}

.afa-stock-metric-cell .val {
  font-size: 14px;
  font-weight: 800;
  color: #fff;
}

.afa-stock-metric-cell .val.green { color: var(--asc-green); }
.afa-stock-metric-cell .val.gold { color: var(--asc-gold); }

/* SVG Chart Canvas */
.afa-stock-chart-wrap {
  position: relative;
  width: 100%;
  height: 310px;
  user-select: none;
  touch-action: pan-y;
}

.afa-stock-svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

/* Floating Crosshair & Tooltip */
.afa-stock-tooltip {
  position: absolute;
  top: 10px;
  left: 0;
  pointer-events: none;
  background: rgba(5, 10, 20, 0.94);
  border: 1px solid var(--asc-gold);
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 11px;
  color: #fff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  white-space: nowrap;
  transform: translate(-50%, -100%);
  transition: opacity 0.12s ease;
  z-index: 20;
  display: none;
}

.afa-stock-tooltip .tt-equity {
  font-size: 13px;
  font-weight: 900;
  color: var(--asc-gold2);
  margin-bottom: 2px;
}

.afa-stock-tooltip .tt-date {
  font-size: 9.5px;
  color: var(--asc-muted);
}

/* Coming Soon / Locked State Card */
.afa-stock-coming-card {
  padding: 50px 24px;
  text-align: center;
  background: rgba(6, 12, 22, 0.5);
  border: 1px dashed rgba(26, 42, 66, 0.9);
  border-radius: 12px;
  margin: 10px 0;
}

.afa-stock-coming-card h3 {
  font-size: 18px;
  font-weight: 850;
  color: #fff;
  margin-bottom: 8px;
}

.afa-stock-coming-card p {
  font-size: 12.5px;
  color: var(--asc-muted);
  max-width: 520px;
  margin: 0 auto 18px;
  line-height: 1.6;
}

.afa-stock-req-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(245, 196, 81, 0.1);
  border: 1px solid rgba(245, 196, 81, 0.3);
  color: var(--asc-gold2);
  font-size: 11px;
  font-weight: 800;
  padding: 6px 16px;
  border-radius: 99px;
}

@media (max-width: 768px) {
  .afa-stock-widget {
    padding: 18px 14px 16px;
  }
  .afa-stock-price-main {
    font-size: 30px;
  }
  .afa-stock-chart-wrap {
    height: 250px;
  }
}
