/* ============================================================
   Neural Frontier — markets-widget.css
   Widget de mercados: versión compacta (sin mapa SVG)
   ============================================================ */

/* ========== Versión compacta (en cards-col) ========== */
.markets-widget-compact {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 10px 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.06);
  flex-shrink: 0;
}

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

.mwc-title {
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
}

.mwc-time {
  font-size: 10px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.mwc-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.mwc-item {
  display: grid;
  grid-template-columns: 7px 14px 1fr auto auto;
  align-items: center;
  gap: 5px;
}

.mwc-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
}

.mwc-dot.is-open    { background: var(--positive); box-shadow: 0 0 4px var(--positive); }
.mwc-dot.is-closing { background: var(--warning); animation: markerBlink 1s ease-in-out infinite; }
.mwc-dot.is-closed  { background: var(--text-muted); }

.mwc-flag { font-size: 11px; }

.mwc-name {
  font-size: 9.5px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mwc-bar-track {
  height: 3px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  overflow: hidden;
  min-width: 44px;
}

.mwc-bar-fill {
  height: 100%;
  border-radius: 2px;
  width: 0%;
  transition: width 1s linear;
}

.mwc-status {
  font-size: 8.5px;
  font-weight: 500;
  white-space: nowrap;
  min-width: 30px;
  text-align: right;
}

/* ========== Versión con mapa SVG (legacy — oculta) ========== */

.markets-widget-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 12px 14px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.06);
  flex-shrink: 0;
}

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

.mw-title {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
}

.mw-time {
  font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* ---------- Mapa SVG ---------- */
.mw-map-container {
  width: 100%;
  margin-bottom: 10px;
}

.mw-map {
  width: 100%;
  height: auto;
}

.mw-map .continent circle {
  fill: var(--text-secondary);
}

.marker-label {
  font-size: 6px;
  fill: var(--text-secondary);
  font-family: inherit;
}

.market-marker .marker-dot {
  transition: r 0.3s ease;
}

.market-marker.is-open .marker-pulse {
  animation: marketPulse 2s ease-out infinite;
}

.market-marker.is-closing .marker-dot {
  animation: markerBlink 1s ease-in-out infinite;
}

.market-marker.is-closed .marker-dot {
  fill: var(--text-muted) !important;
}

@keyframes marketPulse {
  0%   { r: 4; opacity: 0.8; }
  100% { r: 10; opacity: 0; }
}

@keyframes markerBlink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}

/* ---------- Lista de mercados ---------- */
.mw-markets-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mw-market-item {
  display: grid;
  grid-template-columns: 16px 1fr auto auto;
  align-items: center;
  gap: 6px;
}

.mw-flag { font-size: 12px; }

.mw-name {
  font-size: 10px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mw-bar-track {
  height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  overflow: hidden;
  min-width: 60px;
}

.mw-bar-fill {
  height: 100%;
  border-radius: 2px;
  width: 0%;
  transition: width 1s linear;
}

.mw-status {
  font-size: 9px;
  font-weight: 500;
  white-space: nowrap;
  min-width: 36px;
  text-align: right;
}
