/* ============================================
   TABLA.CSS — Tabla de picks y filtros página principal
   ============================================ */

/* ── Indicador en vivo ── */
.live-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--color-primary);
  font-weight: 500;
  margin-right: 8px;
}

.live-dot::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-primary);
  display: block;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}

/* ── Barra de filtros de deportes y casas ── */
.filtros-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: var(--color-bg-dark);
  border-bottom: 1px solid var(--color-border);
  min-height: 44px;
}

.filtros-deportes,
.filtros-casas-bar {
  display: flex;
  align-items: center;
}

/* ── Tabs de filtro ── */
.sport-tab,
.casa-tab {
  font-size: 12px;
  padding: 10px 12px;
  color: var(--color-text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
  user-select: none;
}

.sport-tab:hover,
.casa-tab:hover {
  color: var(--color-text);
}

.sport-tab.active,
.casa-tab.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  font-weight: 500;
}

/* ── Dropdowns de filtro ── */
.dropdown {
  position: relative;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #1e293b;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  min-width: 170px;
  z-index: 100;
  padding: 4px 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.dropdown-menu-right {
  left: auto;
  right: 0;
}

.dropdown-menu.open {
  display: block;
}

.dropdown-item {
  padding: 8px 16px;
  font-size: 12px;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-text);
}

.dropdown-item.active {
  color: var(--color-primary);
  font-weight: 500;
}

/* ── Info de la tabla ── */
.table-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 24px;
  font-size: 12px;
  color: var(--color-text-muted);
  background: var(--color-bg-dark);
  border-bottom: 1px solid var(--color-border);
}

/* ── Tabla de picks ── */
.tabla-wrap {
  overflow-x: auto;
}

.tabla-picks {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}

.tabla-picks thead tr {
  background: rgba(255, 255, 255, 0.03);
}

.tabla-picks th {
  font-size: 11px;
  font-weight: 500;
  color: var(--color-text-muted);
  text-align: left;
  padding: 8px 14px;
  border-bottom: 1px solid var(--color-border);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

/* Columnas numéricas alineadas a la derecha */
.tabla-picks th:nth-child(5),
.tabla-picks th:nth-child(6),
.tabla-picks th:nth-child(7) {
  text-align: right;
}

.tabla-picks th:nth-child(8),
.tabla-picks td:nth-child(8) {
  width: 60px;
  text-align: center;
}

.tabla-picks th:nth-child(9),
.tabla-picks td:nth-child(9) {
  width: 70px;
  text-align: center;
}

.tabla-picks td {
  font-size: 12px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
  color: var(--color-text);
}

.tabla-picks td:nth-child(5),
.tabla-picks td:nth-child(6),
.tabla-picks td:nth-child(7) {
  text-align: right;
}

.tabla-picks tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* ── Celdas de casa ── */
.casa-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Círculo de color con iniciales (fallback sin logo) */
.casa-logo {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

/* Imagen real del logo de la casa */
.casa-logo-img {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: contain;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.06);
}

.casa-nombre {
  font-weight: 500;
  font-size: 12px;
}
.casa-deporte {
  font-size: 10px;
  color: var(--color-text-muted);
  margin-top: 1px;
}

/* ── Celdas de evento ── */
.evento-link {
  font-weight: 500;
  font-size: 12px;
  color: var(--color-primary);
  text-decoration: none;
}

.evento-link:hover {
  text-decoration: underline;
}
.evento-comp {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: 2px;
}
.evento-fecha {
  font-size: 11px;
  color: var(--color-text-muted);
}

.timer {
  font-size: 11px;
  color: var(--color-warning);
  font-weight: 500;
  margin-top: 2px;
}

.cuota-val {
  font-weight: 600;
  font-size: 13px;
}
.prob-val {
  color: var(--color-text-muted);
  font-size: 12px;
}

/* ── Fila con candado ── */
.fila-candado {
  opacity: 0.75;
}
.fila-candado td {
  background: rgba(255, 255, 255, 0.02);
}

.candado-msg {
  font-size: 12px;
  color: var(--color-text-muted);
}

.candado-msg a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 500;
}

.candado-msg a:hover {
  text-decoration: underline;
}

/* ── Cards mobile — ocultas en desktop ── */
#cards-mobile {
  display: none;
}

.pick-card {
  margin: 8px 12px;
  padding: 14px 16px;
  background: var(--color-bg-dark);
  border: 1px solid var(--color-border);
  border-radius: 10px;
}

.pick-card.candado {
  opacity: 0.8;
}

.pick-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.pick-card-partido {
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
}
.pick-card-partido a {
  color: var(--color-primary);
  text-decoration: none;
}

.pick-card-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--color-text-muted);
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.pick-card-fecha {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-bottom: 10px;
}

.pick-card-enlace {
  display: inline-block;
  padding: 7px 14px;
  background: var(--color-primary);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--border-radius);
  text-decoration: none;
  transition: opacity 0.2s;
}

.pick-card-enlace:hover {
  opacity: 0.85;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .filtros-bar {
    flex-direction: column;
    align-items: flex-start;
    padding: 0 12px;
  }

  .filtros-deportes,
  .filtros-casas-bar {
    overflow-x: auto;
    width: 100%;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .filtros-deportes::-webkit-scrollbar,
  .filtros-casas-bar::-webkit-scrollbar {
    display: none;
  }

  .tabla-wrap {
    display: none;
  }
  #cards-mobile {
    display: block;
  }

  .table-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 8px 12px;
  }

  /* Tabs desktop ocultos en móvil */
  .sport-tab-desktop,
  .casa-tab-desktop {
    display: none;
  }
}

/* ── Tabs móvil ocultos en desktop ── */
@media (min-width: 769px) {
  .sport-tab-mobile-only,
  .casa-tab-mobile-only {
    display: none;
  }
}
