@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@400;600;700&family=Open+Sans:wght@400;600&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --black:  #0d0d0d;
  --red:    #c0392b;
  --red-dk: #922b21;
  --gray:   #2c2c2c;
  --lgray:  #4a4a4a;
  --silver: #f4f4f4;
  --white:  #ffffff;
  --accent: #e74c3c;
  --gold:   #d4ac0d;
  --bg:     #1a1a1a;
}

body {
  font-family: 'Open Sans', Arial, sans-serif;
  background: var(--bg);
  color: var(--white);
  min-height: 100vh;
  font-size: 14px;
}

/* ── HEADER ── */
header {
  background: var(--black);
  border-bottom: 3px solid var(--red);
  padding: 28px 40px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.header-bar { width: 6px; height: 60px; background: var(--red); flex-shrink: 0; }
header h1 {
  font-family: 'Oswald', sans-serif;
  font-size: 36px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--white);
  line-height: 1;
}
header h1 span { color: var(--red); }
header p {
  font-family: 'Oswald', sans-serif;
  font-size: 13px;
  letter-spacing: 5px;
  text-transform: uppercase;
  color: #888;
  margin-top: 4px;
}

/* ── LAYOUT ── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 36px 24px 60px;
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 32px;
  align-items: start;
}

/* ── PANEL CONFIGURADOR ── */
.config-panel {
  background: var(--gray);
  border-radius: 4px;
  border-top: 4px solid var(--red);
  padding: 28px 24px;
  position: sticky;
  top: 20px;
}
.panel-title {
  font-family: 'Oswald', sans-serif;
  font-size: 16px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--red);
  margin-bottom: 22px;
}

.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-family: 'Oswald', sans-serif;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #aaa;
  margin-bottom: 8px;
}

/* Toggle modo */
.mode-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--lgray);
  border-radius: 3px;
  overflow: hidden;
}
.mode-btn {
  padding: 10px;
  background: transparent;
  border: none;
  color: #888;
  font-family: 'Oswald', sans-serif;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  cursor: pointer;
  transition: all 0.2s;
}
.mode-btn.active { background: var(--red); color: var(--white); }
.mode-btn:hover:not(.active) { background: var(--lgray); color: var(--white); }

select, input[type="number"] {
  width: 100%;
  background: var(--black);
  border: 1px solid var(--lgray);
  border-radius: 3px;
  color: var(--white);
  padding: 9px 12px;
  font-family: 'Open Sans', sans-serif;
  font-size: 13px;
  appearance: none;
  cursor: pointer;
}
select:focus, input[type="number"]:focus {
  outline: none;
  border-color: var(--red);
}
select option { background: var(--black); }

/* Checkboxes de movimientos */
.checkbox-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 3px;
  border: 1px solid transparent;
  transition: border-color 0.2s;
}
.checkbox-item:hover { border-color: var(--lgray); }
.checkbox-item input[type="checkbox"] { display: none; }
.checkbox-box {
  width: 16px; height: 16px;
  border: 2px solid var(--lgray);
  border-radius: 2px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.checkbox-item input:checked ~ .checkbox-box {
  background: var(--red);
  border-color: var(--red);
}
.checkbox-item input:checked ~ .checkbox-box::after {
  content: '✓';
  font-size: 11px;
  color: white;
  font-weight: 700;
}
.checkbox-label {
  font-size: 12px;
  color: #ccc;
  font-family: 'Open Sans', sans-serif;
}

/* Equipo config */
.team-config { display: none; }
.team-config.visible { display: block; }

/* Botón generar */
.btn-generate {
  width: 100%;
  padding: 14px;
  background: var(--red);
  border: none;
  border-radius: 3px;
  color: var(--white);
  font-family: 'Oswald', sans-serif;
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 3px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  margin-top: 8px;
}
.btn-generate:hover { background: var(--accent); }
.btn-generate:active { transform: scale(0.98); }

/* ── PANEL WOD ── */
.wod-panel { min-height: 400px; }

.wod-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  color: #444;
  text-align: center;
  gap: 12px;
}
.wod-empty .icon { font-size: 60px; opacity: 0.3; }
.wod-empty p {
  font-family: 'Oswald', sans-serif;
  font-size: 16px;
  letter-spacing: 3px;
  text-transform: uppercase;
}

.wod-card {
  background: var(--black);
  border-radius: 4px;
  border-top: 4px solid var(--red);
  overflow: hidden;
  animation: slideIn 0.3s ease;
}
@keyframes slideIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.wod-header {
  background: var(--gray);
  padding: 20px 28px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.wod-date-badge {
  font-family: 'Oswald', sans-serif;
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #888;
  margin-bottom: 6px;
}
.wod-title-row { display: flex; align-items: center; gap: 14px; }
.wod-format-badge {
  background: var(--red);
  color: var(--white);
  font-family: 'Oswald', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 2px;
  flex-shrink: 0;
}
.wod-name {
  font-family: 'Oswald', sans-serif;
  font-size: 28px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--white);
  letter-spacing: 1px;
}
.wod-type-badge {
  font-family: 'Oswald', sans-serif;
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 2px;
  border: 1px solid;
  flex-shrink: 0;
}
.type-individual { color: #5dade2; border-color: #5dade2; }
.type-equipo { color: var(--gold); border-color: var(--gold); }

.wod-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.meta-pill {
  background: var(--lgray);
  color: #ccc;
  font-size: 11px;
  font-family: 'Oswald', sans-serif;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 20px;
}
.meta-pill.highlight { background: rgba(192,57,43,0.2); color: var(--red); }

.wod-body { padding: 28px; }

.section-label {
  font-family: 'Oswald', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 14px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--lgray);
}

/* WOD description */
.wod-description {
  background: var(--gray);
  border-radius: 3px;
  padding: 18px 22px;
  margin-bottom: 20px;
  font-family: 'Oswald', sans-serif;
  font-size: 14px;
  color: #bbb;
  line-height: 1.7;
  font-style: italic;
}

/* Movimientos */
.movements-list { margin-bottom: 24px; }
.movement-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid #1e1e1e;
  transition: background 0.15s;
}
.movement-item:last-child { border-bottom: none; }
.movement-item:hover { background: rgba(255,255,255,0.03); }
.movement-left { display: flex; align-items: center; gap: 14px; }
.movement-num {
  font-family: 'Oswald', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--red);
  width: 22px;
  text-align: right;
  flex-shrink: 0;
}
.movement-name {
  font-family: 'Oswald', sans-serif;
  font-size: 17px;
  font-weight: 600;
  color: var(--white);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.movement-cat {
  font-size: 10px;
  color: #666;
  font-family: 'Open Sans', sans-serif;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.movement-right { text-align: right; }
.movement-reps {
  font-family: 'Oswald', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
}
.movement-weight {
  font-size: 11px;
  color: #777;
  font-family: 'Open Sans', sans-serif;
  margin-top: 2px;
}

/* Score / Objetivo */
.wod-score-box {
  background: var(--gray);
  border-left: 3px solid var(--red);
  padding: 14px 18px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.score-icon { font-size: 22px; }
.score-label {
  font-family: 'Oswald', sans-serif;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #888;
  margin-bottom: 2px;
}
.score-value {
  font-family: 'Oswald', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--white);
}

/* Notas equipo */
.team-notes {
  background: rgba(212,172,13,0.08);
  border: 1px solid rgba(212,172,13,0.3);
  border-radius: 3px;
  padding: 14px 18px;
  margin-bottom: 20px;
}
.team-notes-title {
  font-family: 'Oswald', sans-serif;
  font-size: 12px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 10px;
}
.team-notes ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.team-notes ul li {
  font-size: 13px;
  color: #ccc;
  padding-left: 14px;
  position: relative;
}
.team-notes ul li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--gold);
  font-size: 11px;
}

/* Scaling */
.scaling-section { margin-top: 8px; }
.scaling-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.scaling-card {
  background: var(--gray);
  border-radius: 3px;
  padding: 12px 14px;
  border-top: 2px solid;
}
.scaling-rx { border-color: var(--red); }
.scaling-scaled { border-color: #5dade2; }
.scaling-beginner { border-color: #58d68d; }
.scaling-title {
  font-family: 'Oswald', sans-serif;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.scaling-rx .scaling-title { color: var(--red); }
.scaling-scaled .scaling-title { color: #5dade2; }
.scaling-beginner .scaling-title { color: #58d68d; }
.scaling-items { font-size: 11px; color: #bbb; line-height: 1.8; }

/* Acciones */
.wod-actions {
  padding: 16px 28px;
  border-top: 1px solid var(--lgray);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}
.btn-action {
  padding: 9px 20px;
  border-radius: 3px;
  font-family: 'Oswald', sans-serif;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}
.btn-secondary {
  background: var(--gray);
  color: #ccc;
  border: 1px solid var(--lgray);
}
.btn-secondary:hover { background: var(--lgray); color: var(--white); }
.btn-primary {
  background: var(--red);
  color: var(--white);
}
.btn-primary:hover { background: var(--accent); }

/* Historial */
.history-section { margin-top: 32px; }
.history-title {
  font-family: 'Oswald', sans-serif;
  font-size: 12px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: #555;
  margin-bottom: 12px;
}
.history-grid { display: flex; flex-direction: column; gap: 8px; }
.history-item {
  background: var(--gray);
  border-radius: 3px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: background 0.2s;
  border-left: 3px solid transparent;
}
.history-item:hover { background: var(--lgray); border-left-color: var(--red); }
.history-item-format {
  background: var(--lgray);
  color: var(--red);
  font-family: 'Oswald', sans-serif;
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 2px;
  flex-shrink: 0;
  min-width: 60px;
  text-align: center;
}
.history-item-name {
  font-family: 'Oswald', sans-serif;
  font-size: 13px;
  color: var(--white);
  text-transform: uppercase;
  flex: 1;
}
.history-item-meta { font-size: 11px; color: #666; }

.divider {
  height: 1px;
  background: var(--lgray);
  margin: 16px 0;
}

.range-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* ── PRINT ── */
@media print {
  body { background: white; color: black; }
  header, .config-panel, .wod-actions, .history-section { display: none !important; }
  .container { grid-template-columns: 1fr; padding: 0; }
  .wod-card { border: 1px solid #ccc; }
  .wod-name, .section-label, .movement-name, .wod-format-badge { color: black !important; }
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .container {
    grid-template-columns: 1fr;
    padding: 16px 12px 40px;
    gap: 20px;
  }
  .config-panel { position: static; padding: 20px 16px; }

  header { padding: 16px; gap: 12px; }
  .header-bar { height: 44px; }
  header h1 { font-size: 22px; letter-spacing: 1px; }
  header p { font-size: 10px; letter-spacing: 3px; }

  select, input[type="number"] { font-size: 16px; }

  .wod-header {
    flex-direction: column;
    padding: 16px;
    gap: 10px;
  }
  .wod-type-badge { align-self: flex-start; }
  .wod-title-row { flex-wrap: wrap; gap: 8px; }
  .wod-name { font-size: 22px; }
  .wod-format-badge { font-size: 11px; padding: 3px 8px; }

  .wod-body { padding: 16px; }
  .wod-description { padding: 12px 14px; font-size: 13px; }

  .movement-item { padding: 10px 12px; flex-wrap: wrap; gap: 6px; }
  .movement-left { flex: 1; min-width: 0; }
  .movement-name { font-size: 15px; }
  .movement-right { text-align: right; flex-shrink: 0; }
  .movement-weight { font-size: 10px; max-width: 120px; word-break: break-word; }

  .wod-score-box { flex-wrap: wrap; gap: 8px; padding: 12px 14px; }
  .score-value { font-size: 13px; }

  .scaling-grid { grid-template-columns: 1fr; }

  .wod-actions {
    padding: 14px 16px;
    flex-wrap: wrap;
    justify-content: stretch;
    gap: 8px;
  }
  .btn-action {
    flex: 1;
    min-width: 0;
    text-align: center;
    padding: 11px 8px;
    font-size: 11px;
  }

  .history-item { flex-wrap: wrap; gap: 6px; }
  .history-item-meta { flex-basis: 100%; padding-left: 74px; }
}

@media (max-width: 380px) {
  header h1 { font-size: 18px; }
  .wod-name { font-size: 18px; }
  .btn-action { font-size: 10px; letter-spacing: 1px; }
  .movement-weight { display: none; }
}
