/* ============================================================
   Polla Mundial 2026 ? Custom CSS (Tabler + Bootstrap 5 base)
   ============================================================ */

/* ?? Tipografía global ?????????????????????????????????????? */
:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
body {
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  background-color: #f1f5f9;
}

/* ?? Bottom Navigation ?????????????????????????????????????? */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  z-index: 1030;
  box-shadow: 0 -2px 12px rgba(0,0,0,.08);
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-decoration: none;
  color: #94a3b8;
  font-size: 0.65rem;
  font-weight: 500;
  transition: color .15s;
  padding: 8px 4px;
}

.bottom-nav-item.active {
  color: #1a56db;
}

.bottom-nav-item svg {
  stroke: currentColor;
  transition: stroke .15s;
}

/* Padding para que el contenido no quede bajo el bottom nav */
.pb-bottom-nav {
  padding-bottom: calc(68px + env(safe-area-inset-bottom, 0));
}

/* ?? Input Stepper (para pronósticos) ??????????????????????? */
.input-stepper {
  display: flex;
  align-items: center;
  border: 1.5px solid #cbd5e1;
  border-radius: 0.5rem;
  overflow: hidden;
  background: #fff;
}

.btn-step {
  background: #f8fafc;
  border: none;
  color: #374151;
  font-size: 1.2rem;
  font-weight: 700;
  width: 40px;
  min-height: 44px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .12s;
  line-height: 1;
  padding: 0;
}

.btn-step:hover:not(:disabled) {
  background: #e2e8f0;
}

.btn-step:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.step-input {
  flex: 1;
  border: none;
  text-align: center;
  font-size: 1.15rem;
  font-weight: 700;
  min-width: 0;
  background: transparent;
  color: #1e3a8a;
  padding: 0;
  -moz-appearance: textfield;
  appearance: textfield;
  min-height: 44px;
}

.step-input::-webkit-inner-spin-button,
.step-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
}

/* ?? Marcador resultado ?????????????????????????????????????? */
.score-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: #1e3a8a;
  border-radius: 0.4rem;
  padding: 4px 6px;
}

.score-num {
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  min-width: 20px;
  text-align: center;
}

.score-sep {
  color: rgba(255,255,255,.6);
  font-weight: 700;
  font-size: .9rem;
}

/* ?? Tarjetas partido ??????????????????????????????????????? */
.partido-card {
  transition: box-shadow .15s, transform .1s;
}
.partido-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0,0,0,.1) !important;
}

/* ?? Hover card (admin links) ??????????????????????????????? */
.hover-card {
  transition: box-shadow .15s, transform .1s;
}
.hover-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0,0,0,.12) !important;
}

/* ?? Navbar ????????????????????????????????????????????????? */
.navbar .nav-link.active {
  position: relative;
}
.navbar .nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
}

/* ?? Flag icons sizing ?????????????????????????????????????? */
.fi {
  display: inline-block;
  border-radius: 2px;
}

/* ?? Grupos table (responsive) ?????????????????????????????? */
@media (max-width: 400px) {
  .table th, .table td {
    padding: 0.3rem 0.2rem;
    font-size: .75rem;
  }
}

/* ?? Utilidades ????????????????????????????????????????????? */
.text-white-75 { color: rgba(255,255,255,.75); }
.opacity-60 { opacity: .6; }
.rounded-4 { border-radius: 0.75rem !important; }
.rounded-5 { border-radius: 1rem !important; }

/* Tabla de grupos subtle highlight */
.table-success-subtle { background-color: rgba(5,150,105,.06) !important; }

/* ?? Spinner en botón guardar ??????????????????????????????? */
.btn-guardar-pron.loading .spinner-border,
.btn-guardar-resultado.loading .spinner-border {
  display: inline-block !important;
}
.btn-guardar-pron.loading,
.btn-guardar-resultado.loading {
  pointer-events: none;
  opacity: .75;
}

/* ?? Flash message animación ???????????????????????????????? */
#global-flash.fade {
  animation: fadeOut .5s forwards;
}

@keyframes fadeOut {
  to { opacity: 0; transform: translateX(-50%) translateY(-20px); }
}

/* -- Page title override ----------------------------------------- */
.page-title {
  letter-spacing: -0.02em;
}

/* -- Filtros sticky (fecha + proximos/jugados) ------------------- */
.filtros-sticky {
  margin-left: -0.75rem;
  margin-right: -0.75rem;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

/* Fila de fechas con scroll horizontal */
.date-scroll-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.date-scroll-row::-webkit-scrollbar { display: none; }

.date-btn {
  flex-shrink: 0;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 500;
  text-decoration: none;
  color: #64748b;
  border: 1.5px solid #e2e8f0;
  background: #fff;
  white-space: nowrap;
  transition: all .12s;
}
.date-btn:hover {
  border-color: #1a56db;
  color: #1a56db;
}
.date-btn.active {
  background: #1a56db;
  border-color: #1a56db;
  color: #fff;
  font-weight: 600;
}
.date-btn.today-btn {
  border-color: #f59e0b;
  color: #d97706;
}
.date-btn.today-btn.active {
  background: #f59e0b;
  border-color: #f59e0b;
  color: #fff;
}

/* -- Partido bloqueado ------------------------------------------- */
.partido-bloqueado {
  border-left: 3px solid #fbbf24 !important;
}

/* -- Reveal panel ----------------------------------------------- */
.btn-reveal {
  transition: all .15s;
}
.btn-reveal.open {
  background: #eff6ff;
  border-color: #1a56db;
  color: #1a56db;
}
.reveal-chevron {
  transition: transform .2s;
  flex-shrink: 0;
}
.btn-reveal.open .reveal-chevron {
  transform: rotate(90deg);
}
.reveal-list {
  max-height: 280px;
  overflow-y: auto;
  scrollbar-width: thin;
}
.reveal-list::-webkit-scrollbar { width: 4px; }
.reveal-list::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
