/* ------------------
   STATS CARDS (authoritative)
   ------------------ */
:root {
  /* Local fallbacks only used if main :root isn't loaded */
  --primary: #ff9a3c;
  --primary-glow: rgba(255,154,60,0.28);
  --glass-border: rgba(255,154,60,0.12);
  --positive: #4caf50;
  --negative: #f44336;
  --muted: #90a4ae;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  padding: 20px;
  align-items: stretch;
}

.stat-card {
  position: relative;
  border-radius: 14px;
  padding: 24px;
  min-height: 120px;
  background: rgba(20, 30, 50, 0.8);
  border: 1px solid rgba(255, 154, 60, 0.3);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  transition: transform 260ms cubic-bezier(.2,.9,.2,1), box-shadow 260ms ease, border-color 260ms ease;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: -40%;
  left: -40%;
  width: 180%;
  height: 180%;
  background: conic-gradient(rgba(255,255,255,0), var(--primary-glow), rgba(255,255,255,0) 30%);
  animation: rotate 6s linear infinite;
  opacity: 0;
  transition: opacity 260ms ease;
  filter: blur(14px);
}

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

.stat-card::after {
  content: '';
  position: absolute;
  inset: 1px;
  background: transparent;
  border-radius: 12px;
  z-index: 1;
  pointer-events: none;
}

.stat-card:hover { transform: translateY(-8px) scale(1.004); border-color: var(--primary); box-shadow: 0 26px 60px rgba(0,0,0,0.6), 0 8px 30px rgba(255,154,60,0.06); }
.stat-card:hover::before { opacity: 1; }

.stat-content { position: relative; z-index: 2; text-align: center; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:6px; }

.stat-value {
  font-weight: 800;
  font-size: 2.2rem;
  line-height: 1;
  background: linear-gradient(135deg, var(--primary), #ffd700);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  display: inline-block;
  margin-bottom: 6px;
  letter-spacing: -0.6px;
}

/* Variants keep the gradient for the text only */
.stat-value.positive {
  background: linear-gradient(135deg, var(--positive), #81c784);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.stat-value.negative {
  background: linear-gradient(135deg, var(--negative), #e57373);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.stat-value.neutral { 
  background: linear-gradient(135deg, #90a4ae, #b0bec5);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* 🆕 Specific gradients for Trades and Win Rate */
#totalTrades {
  background: linear-gradient(135deg, #ffa500, #ffd700) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
}

#winRate {
  background: linear-gradient(135deg, #ff9a3c, #ffa500) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
}

/* Force any parent or other rules from leaking a solid background into the number */
.stat-card .stat-value { background-color: transparent !important; color: inherit !important; }

/* Defensive: ensure positive stats render with correct colors */
#fundedAccounts,
#profitAccounts,
#totalBalance {
  color: var(--primary) !important;
  background-color: transparent !important;
}

.stat-label { color: var(--muted); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: 1px; opacity: 0.95; }

/* Responsive tweaks */
@media (min-width: 1400px) { .stat-value { font-size: 2.8rem; } }
@media (max-width: 1024px) { .stat-value { font-size: 2.2rem; } .stat-card { padding: 20px; } }
@media (max-width: 768px) { .stats-grid { grid-template-columns: 1fr; padding: 14px; } .stat-value { font-size: 1.9rem; } }
@media (max-width: 480px) { .stat-value { font-size: 1.6rem; } .stat-card { padding: 14px; min-height: 96px; } }

/* Defensive: Ensure these two stats render with correct colors */
#totalResult,
#totalProfitUSD {
  color: inherit !important;
  background-color: transparent !important;
}

/* 🆕 CLICKEABLE STAT CARDS - Agregar efecto visual */
.stat-card[onclick] {
  transition: all 260ms cubic-bezier(.2,.9,.2,1);
}

.stat-card[onclick]:hover {
  cursor: pointer !important;
  transform: translateY(-10px) scale(1.01) !important;
  border-color: var(--primary) !important;
}

/* Efecto de pulsación suave */
.stat-card[onclick]:active {
  transform: translateY(-6px) scale(0.98) !important;
}