/* ============================================================
   Design system MaxiPrograma — Prode Mundial 2026
   Sobreescribe Bootstrap (cargar DESPUÉS de bootstrap.min.css).
   ============================================================ */

:root {
  --mp-black: #0D0D0D;
  --mp-surface: #1A1A1A;
  --mp-surface2: #242424;
  --mp-border: rgba(255, 255, 255, 0.08);
  --mp-border-hover: rgba(255, 255, 255, 0.18);
  --mp-yellow: #FBFB9A;
  --mp-yellow-dim: rgba(251, 251, 154, 0.12);
  --mp-orange: #F97316;
  --mp-orange-dim: rgba(249, 115, 22, 0.12);
  --mp-green: #22C55E;
  --mp-green-dim: rgba(34, 197, 94, 0.12);
  --mp-red: #EF4444;
  --mp-red-dim: rgba(239, 68, 68, 0.12);
  --mp-blue: #60A5FA;
  --mp-blue-dim: rgba(96, 165, 250, 0.12);
  --mp-text: #FFFFFF;
  --mp-text-secondary: rgba(255, 255, 255, 0.55);
  --mp-text-tertiary: rgba(255, 255, 255, 0.30);
  --font-sans: Inter, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ---------- Base ---------- */

* {
  box-shadow: none !important;
}

body {
  background: var(--mp-black);
  color: var(--mp-text);
  font-family: var(--font-sans);
}

h1, h2, h3, h4, h5, h6 {
  color: var(--mp-text);
  font-weight: 500;
}

a {
  color: var(--mp-blue);
  text-decoration: none;
}

a:hover {
  color: var(--mp-text);
}

code {
  font-family: var(--font-mono);
  color: var(--mp-yellow);
}

hr {
  border-color: var(--mp-border);
  opacity: 1;
}

.text-muted {
  color: var(--mp-text-secondary) !important;
}

:focus-visible {
  outline: 2px solid var(--mp-yellow);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

/* ---------- Navbar ---------- */

.navbar {
  background: var(--mp-black) !important;
  border-bottom: 0.5px solid var(--mp-border);
  min-height: 50px;
  padding-top: 0;
  padding-bottom: 0;
}

.navbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--mp-text) !important;
  height: 50px;
}

.mp-logo-img {
  height: 30px;
  width: auto;
}

.navbar .nav-link {
  color: var(--mp-text-secondary) !important;
  font-size: 13px;
}

.navbar .nav-link:hover,
.navbar .nav-link.activo {
  color: var(--mp-text) !important;
}

.navbar .nav-link.nav-admin {
  color: var(--mp-orange) !important;
}

.navbar .nav-link strong {
  color: var(--mp-text);
  font-weight: 500;
}

.navbar-toggler {
  border-color: var(--mp-border-hover);
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255,255,255,0.7)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* ---------- Cards / contenedores ---------- */

.card {
  background: var(--mp-surface);
  border: 0.5px solid var(--mp-border);
  border-radius: 10px;
  color: var(--mp-text);
}

.card-body {
  padding: 0.75rem 1rem;
}

.card-header {
  background: transparent;
  border-bottom: 0.5px solid var(--mp-border);
  color: var(--mp-text-secondary);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 0.5rem 1rem;
}

.list-group-item {
  background: var(--mp-surface);
  border-color: var(--mp-border);
  color: var(--mp-text);
}

.list-group-item-action:hover,
.list-group-item-action:focus {
  background: var(--mp-surface2);
  color: var(--mp-text);
}

.list-group-flush .list-group-item {
  background: transparent;
}

/* ---------- Botones ---------- */

.btn {
  border-radius: 8px;
  font-weight: 500;
}

/* Primario: amarillo MaxiPrograma (mata el azul Bootstrap) */
.btn-primary,
.btn-success {
  background: var(--mp-yellow);
  color: var(--mp-black);
  border: none;
}

.btn-primary:hover, .btn-primary:focus, .btn-primary:active,
.btn-success:hover, .btn-success:focus, .btn-success:active {
  background: var(--mp-yellow);
  color: var(--mp-black);
  border: none;
  opacity: 0.85;
}

/* Plantarme y acciones de riesgo: naranja */
.btn-warning, .btn-danger {
  background: var(--mp-orange);
  color: #fff;
  border: none;
}

.btn-warning:hover, .btn-warning:focus, .btn-warning:active,
.btn-danger:hover, .btn-danger:focus, .btn-danger:active {
  background: var(--mp-orange);
  color: #fff;
  opacity: 0.85;
}

/* Ghost / secundario */
.btn-outline-primary, .btn-outline-secondary, .btn-outline-dark,
.btn-outline-success, .btn-outline-danger, .btn-secondary {
  background: transparent;
  color: var(--mp-text);
  border: 1px solid var(--mp-border-hover);
}

.btn-outline-primary:hover, .btn-outline-secondary:hover, .btn-outline-dark:hover,
.btn-outline-success:hover, .btn-outline-danger:hover, .btn-secondary:hover,
.btn-outline-primary:focus, .btn-outline-secondary:focus, .btn-outline-dark:focus,
.btn-outline-success:focus, .btn-outline-danger:focus, .btn-secondary:focus {
  background: var(--mp-surface2);
  color: var(--mp-text);
  border-color: var(--mp-border-hover);
}

/* Semántica sutil en admin: el texto conserva el color, el botón sigue ghost */
.btn-outline-success { color: var(--mp-green); }
.btn-outline-danger { color: var(--mp-red); }

.btn-sm {
  border-radius: 6px;
}

.btn-link {
  color: var(--mp-text-secondary);
}

/* ---------- Formularios ---------- */

.form-control, .form-select, textarea.form-control {
  background: var(--mp-surface2);
  border: 1px solid var(--mp-border);
  border-radius: 8px;
  color: var(--mp-text);
}

.form-control:focus, .form-select:focus {
  background: var(--mp-surface2);
  border-color: var(--mp-border-hover);
  color: var(--mp-text);
}

.form-control::placeholder {
  color: var(--mp-text-tertiary);
}

.form-select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='rgba(255,255,255,0.55)' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px 12px;
}

.form-check-input {
  background-color: var(--mp-surface2);
  border-color: var(--mp-border-hover);
}

.form-check-input:checked {
  background-color: var(--mp-yellow);
  border-color: var(--mp-yellow);
}

.form-check-input:checked[type="checkbox"] {
  /* tilde oscura sobre amarillo */
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%230D0D0D' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e");
}

.form-label {
  color: var(--mp-text-secondary);
  font-size: 13px;
}

/* Inputs de goles (fixture y admin) */
input.goles {
  width: 36px;
  height: 36px;
  background: var(--mp-surface2);
  border: 1px solid var(--mp-border-hover);
  border-radius: 8px;
  text-align: center;
  font-size: 16px;
  font-weight: 500;
  color: var(--mp-text);
  padding: 0;
  -moz-appearance: textfield;
  appearance: textfield;
}

input.goles::-webkit-outer-spin-button,
input.goles::-webkit-inner-spin-button {
  display: none;
}

/* ---------- Badges ---------- */

.badge {
  border-radius: 99px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 500;
}

.badge-exacto {
  background: var(--mp-green-dim);
  color: var(--mp-green);
  border: 0.5px solid rgba(34, 197, 94, 0.25);
}

.badge-1x2 {
  background: var(--mp-blue-dim);
  color: var(--mp-blue);
  border: 0.5px solid rgba(96, 165, 250, 0.25);
}

.badge-fallo {
  background: var(--mp-red-dim);
  color: var(--mp-red);
  border: 0.5px solid rgba(239, 68, 68, 0.25);
}

.badge-pendiente {
  background: var(--mp-yellow-dim);
  color: var(--mp-yellow);
  border: 0.5px solid rgba(251, 251, 154, 0.2);
}

.badge-cerrado {
  background: rgba(255, 255, 255, 0.05);
  color: var(--mp-text-tertiary);
  border: 0.5px solid var(--mp-border);
}

.badge-racha {
  background: var(--mp-orange-dim);
  color: var(--mp-orange);
  border: 0.5px solid rgba(249, 115, 22, 0.25);
}

/* ---------- Alerts ---------- */

.alert {
  border-radius: 10px;
  border-width: 0.5px;
}

.alert-success {
  background: var(--mp-green-dim);
  color: var(--mp-green);
  border-color: rgba(34, 197, 94, 0.25);
}

.alert-danger {
  background: var(--mp-red-dim);
  color: var(--mp-red);
  border-color: rgba(239, 68, 68, 0.25);
}

.alert-warning {
  background: var(--mp-yellow-dim);
  color: var(--mp-yellow);
  border-color: rgba(251, 251, 154, 0.2);
}

.alert-info {
  background: var(--mp-blue-dim);
  color: var(--mp-blue);
  border-color: rgba(96, 165, 250, 0.25);
}

.alert-secondary {
  background: var(--mp-surface);
  color: var(--mp-text-secondary);
  border-color: var(--mp-border);
}

.alert .alert-link {
  color: inherit;
  text-decoration: underline;
}

/* ---------- Tablas ---------- */

.table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--mp-text);
  --bs-table-border-color: var(--mp-border);
  --bs-table-hover-bg: var(--mp-surface2);
  --bs-table-hover-color: var(--mp-text);
  color: var(--mp-text);
  border-color: var(--mp-border);
}

.table thead th {
  color: var(--mp-text-secondary);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  border-bottom-color: var(--mp-border-hover);
}

/* Filas alternadas: impares con surface, pares al fondo */
.tabla-rayada > tbody > tr:nth-child(odd) > * {
  background: var(--mp-surface);
}

.table-danger > * {
  --bs-table-bg: var(--mp-red-dim);
  --bs-table-color: var(--mp-text);
  color: var(--mp-text);
}

/* ---------- Modal ---------- */

.modal-content {
  background: var(--mp-surface);
  border: 0.5px solid var(--mp-border);
  border-radius: 10px;
  color: var(--mp-text);
}

.modal-header, .modal-footer {
  border-color: var(--mp-border);
}

.btn-close {
  filter: invert(1) grayscale(100%) brightness(200%);
}

/* ---------- Fixture ---------- */

/* Tabs de semanas: scrolleables en mobile */
.week-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 8px;
  -webkit-overflow-scrolling: touch;
}

.week-tab {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 6px 14px;
  border: 1px solid var(--mp-border-hover);
  border-radius: 8px;
  background: transparent;
  color: var(--mp-text-secondary);
  text-decoration: none;
}

.week-tab:hover {
  background: var(--mp-surface2);
  color: var(--mp-text);
}

.week-tab.activa {
  background: var(--mp-yellow);
  border-color: var(--mp-yellow);
  color: var(--mp-black);
}

.week-tab-nombre {
  font-size: 13px;
  font-weight: 500;
}

.week-tab-rango {
  font-size: 10px;
  opacity: 0.7;
}


.day-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--mp-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 24px 0 8px;
  border: none;
}

/* Las tarjetas de un día: 1 columna; 2 por fila en pantallas grandes */
.day-matches {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

/* Grid de 3 zonas con laterales fijos: el centro queda alineado entre cards */
.match {
  background: var(--mp-surface);
  border: 0.5px solid var(--mp-border);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  display: grid;
  grid-template-columns: 120px 1fr 120px;
  align-items: center;
  gap: 0;
  margin-bottom: 0;
  transition: border-color 0.15s;
}

.match:hover {
  border-color: var(--mp-border-hover);
}

.match-liq {
  opacity: 0.45;
}

.match-meta {
  font-size: 11px;
  color: var(--mp-text-tertiary);
  line-height: 1.5;
  overflow: hidden;
}

.match-meta strong {
  display: block;
  color: var(--mp-text-secondary);
  font-size: 11px;
  font-weight: 500;
}

.match-hora-mobile {
  display: none;
}

.match-teams {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
}

.team {
  font-size: 14px;
  font-weight: 500;
  color: var(--mp-text);
}

.team.local { text-align: right; }
.team.visitor { text-align: left; }

/* Zona derecha: acción arriba, cierre/estado abajo, alineados a la derecha */
.match-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
}

.team.sin-definir {
  color: var(--mp-text-tertiary);
  font-style: italic;
  font-weight: 400;
}

.score-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
}

.score-sep {
  font-size: 16px;
  color: var(--mp-text-tertiary);
}

.bandera {
  font-size: 18px;
  line-height: 1;
}

.bandera:empty {
  display: none;
}

/* Próximos partidos en la landing: angosto y centrado, una columna */
.proximos {
  max-width: 640px;
  margin: 24px auto 0;
  display: grid;
  gap: 6px;
}

.score-final {
  font-size: 16px;
  font-weight: 500;
  color: var(--mp-text);
  min-width: 36px;
  text-align: center;
}

.match-cierre {
  font-size: 11px;
  color: var(--mp-text-tertiary);
  text-align: right;
  white-space: nowrap;
}

.cierre-hot {
  color: var(--mp-orange);
  font-weight: 500;
}

.mi-prediccion {
  font-size: 11px;
  color: var(--mp-text-secondary);
  white-space: nowrap;
}

/* ---------- Perfil ---------- */

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--mp-surface);
  border: 0.5px solid var(--mp-border);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 10px;
  font-weight: 500;
  color: var(--mp-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 32px;
  font-weight: 500;
  line-height: 1;
}

.stat-value.orange { color: var(--mp-orange); }
.stat-value.yellow { color: var(--mp-yellow); }
.stat-value.apagado { color: var(--mp-text-tertiary); }

.stat-sub {
  font-size: 12px;
  color: var(--mp-text-tertiary);
  margin-top: 8px;
}

.progress-wrap {
  background: var(--mp-surface2);
  border-radius: 99px;
  height: 6px;
  margin-top: 8px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 99px;
  background: var(--mp-orange);
}

.coupon {
  border: 1.5px dashed rgba(251, 251, 154, 0.4);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--mp-yellow-dim);
  margin-top: 8px;
  flex: 1;
}

.coupon-pct {
  font-size: 36px;
  font-weight: 500;
  color: var(--mp-yellow);
  line-height: 1;
}

.coupon-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--mp-yellow);
}

.coupon-code {
  font-family: var(--font-mono);
  font-size: 12px;
  color: rgba(251, 251, 154, 0.65);
  margin-top: 4px;
}

.coupon-exp {
  font-size: 11px;
  color: var(--mp-text-tertiary);
  margin-top: 2px;
}

.coupon-vacio {
  border-color: var(--mp-border-hover);
  background: transparent;
  color: var(--mp-text-tertiary);
  font-size: 13px;
  justify-content: center;
}

/* ---------- Ranking ---------- */

.rank-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0.6rem 0;
  border-bottom: 0.5px solid var(--mp-border);
}

.rank-pos {
  font-size: 13px;
  font-weight: 500;
  color: var(--mp-text-tertiary);
  width: 24px;
  text-align: center;
}

.rank-pos.top { color: var(--mp-yellow); }

.rank-alias {
  font-size: 14px;
  font-weight: 500;
  color: var(--mp-text);
  flex: 1;
}

.rank-pct {
  font-size: 14px;
  font-weight: 500;
  color: var(--mp-text-secondary);
  text-align: right;
}

.rank-pct.top { color: var(--mp-yellow); }

.rank-sub {
  font-size: 12px;
  color: var(--mp-text-tertiary);
  text-align: right;
}

/* ---------- Sección "aprendé conmigo" (home) ---------- */

.aprende {
  border-top: 0.5px solid var(--mp-border);
  margin-top: 32px;
  padding: 32px 16px 24px;
  text-align: center;
}

.aprende-redes {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}

/* ---------- Footer ---------- */

.footer {
  border-top: 0.5px solid var(--mp-border);
  color: var(--mp-text-tertiary);
  font-size: 12px;
  background: var(--mp-black);
}

.footer a {
  color: var(--mp-text-secondary);
}

/* ---------- Mobile (< 768px) ---------- */

/* Pantallas grandes (>= 1200px): dos tarjetas por fila */
@media (min-width: 1200px) {
  .day-matches {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 767.98px) {
  .match {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
  }

  .match-meta {
    display: none;
  }

  .match-hora-mobile {
    display: block;
    width: 100%;
    font-size: 11px;
    color: var(--mp-text-tertiary);
    text-align: center;
  }

  .match-teams {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
  }

  .team.local, .team.visitor {
    text-align: center;
  }

  .match-right {
    align-items: center;
  }

  .match-cierre {
    text-align: center;
  }

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