/* Inversión Apalancada - Estilos */

:root {
  --primary: #2c3e50;
  --primary-light: #3498db;
  --success: #27ae60;
  --warning: #f39c12;
  --danger: #e74c3c;
  --light: #ecf0f1;
  --text: #333;
  --text-light: #555;
  --text-muted: #777;
  --border: #ddd;
  --bg-light: #f8f8f0;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

body {
  background-color: #fafafa;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 20px;
  background-color: white;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
}

h1,
h2,
h3 {
  margin-top: 1.5em;
  margin-bottom: 0.5em;
  color: var(--primary);
}

h1 {
  font-size: 28px;
  font-weight: bold;
}

h2 {
  font-size: 20px;
  font-weight: 600;
  border-bottom: 2px solid var(--primary-light);
  padding-bottom: 10px;
}

/* ── Controles ─────────────────────────────── */

.controls {
  margin-bottom: 30px;
  padding: 15px;
  background-color: var(--light);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.strategy-toggles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}

.strategy-toggles label {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  background-color: white;
  border: 2px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
}

.strategy-toggles label:hover {
  background-color: #f0f0f0;
}

.strategy-toggles label input[type="checkbox"] {
  margin-right: 8px;
  cursor: pointer;
}

.strategy-toggles label input[type="checkbox"]:checked + .label-text {
  font-weight: 600;
}

.playback {
  display: flex;
  align-items: center;
  gap: 15px;
}

button#btn-play {
  padding: 10px 20px;
  background-color: var(--primary-light);
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
}

button#btn-play:hover {
  background-color: #2980b9;
}

button#btn-play.playing {
  background-color: var(--danger);
}

#month-slider {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, var(--primary-light), var(--primary));
  outline: none;
  -webkit-appearance: none;
}

#month-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  border: 2px solid var(--primary-light);
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#month-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  border: 2px solid var(--primary-light);
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#month-label {
  min-width: 80px;
  font-weight: 600;
  color: var(--primary-light);
}

/* ── Chart Area ────────────────────────────── */

.chart-wrapper {
  position: relative;
  margin: 30px 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 20px;
  background-color: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

#chart {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
}

#chart svg {
  width: 100%;
  height: auto;
}

.stats-panel {
  margin-top: 20px;
  padding: 15px;
  background-color: var(--bg-light);
  border-left: 4px solid var(--primary-light);
  border-radius: 4px;
  font-size: 13px;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
  margin-bottom: 10px;
}

.stat-item {
  padding: 8px;
}

.stat-label {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
}

.stat-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  margin-top: 4px;
}

/* ── Analysis Section ──────────────────────── */

.analysis-section {
  margin-top: 50px;
  padding-top: 30px;
  border-top: 2px solid var(--border);
}

.analysis-section > h1 {
  margin-top: 0;
}

.analysis-block {
  margin: 40px 0;
  padding: 20px;
  background-color: var(--bg-light);
  border-radius: 6px;
}

.analysis-block h2 {
  margin-top: 0;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}

.analysis-context {
  font-size: 13px;
  color: var(--text-light);
  margin: 10px 0;
  line-height: 1.6;
}

.analysis-block img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 20px 0;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.analysis-findings {
  font-size: 13px;
  color: var(--text);
  margin: 15px 0;
  line-height: 1.7;
}

/* ── Responsive ────────────────────────────── */

@media (max-width: 768px) {
  .controls {
    flex-direction: column;
  }

  .strategy-toggles {
    grid-template-columns: repeat(2, 1fr);
  }

  .playback {
    flex-direction: column;
  }

  .container {
    padding: 15px;
  }

  h1 {
    font-size: 24px;
  }

  h2 {
    font-size: 18px;
  }
}
