/* ============================================================
   J-SIMULADOR DEMO – Tema Oscuro Profesional
   Paleta: Azul #3b82f6 · Slate #1e293b · Dark #0f172a
   ============================================================ */

/* --- ROOT VARIABLES --- */
:root {
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-subtle: rgba(59, 130, 246, 0.15);
  --slate: #1e293b;
  --slate-light: #334155;
  --dark: #0f172a;
  --dark-card: #1a2332;
  --dark-section: #162032;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --border: #475569;
  --success: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #06b6d4;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --transition: 0.2s ease;
}

/* --- RESET & BASE --- */
* { box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-hover); }

/* --- BACKGROUNDS --- */
.bg-slate { background-color: var(--slate) !important; }
.bg-dark { background-color: var(--dark) !important; }
.bg-dark-card { background-color: var(--dark-card) !important; }
.bg-dark-section { background-color: var(--dark-section) !important; }
.bg-primary-custom { background-color: var(--primary) !important; }

/* --- TEXT --- */
.text-primary-custom { color: var(--primary) !important; }
.text-slate { color: var(--slate) !important; }

/* --- BUTTONS --- */
.btn-primary-custom {
  background: var(--primary);
  color: #fff;
  border: none;
  font-weight: 600;
  border-radius: 8px;
  padding: 10px 24px;
  transition: var(--transition);
  cursor: pointer;
}
.btn-primary-custom:hover {
  background: var(--primary-hover);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(59,130,246,0.4);
}
.btn-primary-custom:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-outline-primary-custom {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
  font-weight: 600;
  border-radius: 8px;
  padding: 8px 20px;
  transition: var(--transition);
}
.btn-outline-primary-custom:hover {
  background: var(--primary);
  color: #fff;
}

/* --- BADGES --- */
.badge.bg-primary-custom-subtle {
  background: var(--primary-subtle) !important;
}
.text-primary-custom { color: var(--primary) !important; }

/* --- NAVBAR --- */
.navbar.bg-primary-custom {
  background: linear-gradient(135deg, #1d4ed8, #3b82f6) !important;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

/* --- HERO --- */
.hero-section {
  background: linear-gradient(135deg, var(--dark) 0%, var(--slate) 100%);
  padding: 80px 0 100px;
  position: relative;
  overflow: hidden;
}
.hero-section::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(59,130,246,0.12) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.min-vh-75 { min-height: 75vh; }

/* --- HERO CARD --- */
.hero-card {
  backdrop-filter: blur(12px);
  border: 1px solid rgba(59,130,246,0.2);
}
.hero-card .sim-preview .metric-box {
  background: rgba(30,41,59,0.8);
  border-radius: 8px;
  padding: 8px;
  text-align: center;
  border: 1px solid var(--border);
}

/* --- STEP ICONS --- */
.step-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 24px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(59,130,246,0.4);
}

/* --- CARDS --- */
.card {
  border-radius: var(--radius);
  transition: var(--transition);
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

.career-card { border-left: 4px solid var(--primary) !important; }
.career-card:hover { border-left-color: #60a5fa !important; }

.career-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
}

.stat-card {
  border-left: 4px solid var(--primary);
}

/* --- FORMS --- */
.form-control {
  background-color: var(--slate) !important;
  border: 1px solid var(--border) !important;
  color: var(--text) !important;
  border-radius: 8px !important;
  padding: 10px 14px !important;
  transition: var(--transition);
}
.form-control:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.2) !important;
  background-color: #233549 !important;
}
.form-control::placeholder { color: var(--text-muted) !important; }

.form-label {
  font-weight: 500;
  margin-bottom: 4px;
}

/* --- GLOSSARY --- */
.glossary-item {
  padding: 12px;
  border-radius: 8px;
  background: rgba(30,41,59,0.5);
  border: 1px solid var(--border);
  transition: var(--transition);
}
.glossary-item:hover {
  background: rgba(59,130,246,0.08);
  border-color: var(--primary);
}

/* --- MODALS --- */
.modal-content.bg-dark-card { border: 1px solid var(--border); }
.cursor-pointer { cursor: pointer; }

/* --- GAME PAGE --- */
.game-layout {
  display: grid;
  grid-template-columns: 1fr 350px;
  gap: 24px;
  min-height: calc(100vh - 60px);
}
@media (max-width: 992px) {
  .game-layout { grid-template-columns: 1fr; }
}

.game-main { }
.game-sidebar { }

.round-indicator {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}
.round-dot {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  background: var(--slate-light);
  color: var(--text-muted);
  border: 2px solid var(--border);
}
.round-dot.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 12px rgba(59,130,246,0.5);
}
.round-dot.done {
  background: var(--success);
  color: #fff;
  border-color: var(--success);
}

.decision-field {
  margin-bottom: 18px;
}
.decision-field label {
  display: block;
  font-weight: 600;
  margin-bottom: 5px;
  color: var(--text);
}
.decision-field .hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Slider */
.slider-container input[type="range"] {
  width: 100%;
  accent-color: var(--primary);
}
.slider-value {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
}

/* Toggle */
.toggle-field {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
}
.toggle-switch {
  position: relative;
  width: 48px;
  height: 26px;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--slate-light);
  border-radius: 26px;
  transition: var(--transition);
  border: 1px solid var(--border);
}
.toggle-slider:before {
  content: "";
  position: absolute;
  height: 20px; width: 20px;
  left: 2px; bottom: 2px;
  background: #fff;
  border-radius: 50%;
  transition: var(--transition);
}
.toggle-switch input:checked + .toggle-slider {
  background: var(--primary);
}
.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(22px);
}

/* KPI cards in game */
.kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.kpi-card {
  background: var(--slate);
  border-radius: 8px;
  padding: 14px;
  border: 1px solid var(--border);
  text-align: center;
}
.kpi-card .kpi-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
}
.kpi-card .kpi-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Results panel */
.result-panel {
  background: var(--dark-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-top: 20px;
}
.result-panel.profit { border-left: 4px solid var(--success); }
.result-panel.loss { border-left: 4px solid var(--danger); }

/* Score bar */
.score-bar {
  height: 8px;
  background: var(--slate);
  border-radius: 4px;
  overflow: hidden;
  margin: 8px 0;
}
.score-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}

/* Market event */
.event-banner {
  background: linear-gradient(135deg, rgba(245,158,11,0.2), rgba(239,68,68,0.1));
  border: 1px solid var(--warning);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.event-banner i { font-size: 22px; color: var(--warning); }

/* Loading */
.loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.85);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
}
.loading-overlay.show { display: flex; }
.loading-spinner {
  width: 48px; height: 48px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Feedback toast */
.feedback-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--dark-card);
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  padding: 16px 20px;
  box-shadow: var(--shadow);
  z-index: 1000;
  max-width: 380px;
  animation: slideIn 0.3s ease;
}
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Footer */
footer {
  border-top: 1px solid var(--border);
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--dark); }
::-webkit-scrollbar-thumb { background: var(--slate-light); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--border); }
