/**
 * Estilos para Series de Liguilla
 */

/* Sección de series */
#seriesSection {
  margin: 2rem 0;
}

#seriesWeekInfo {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

/* Botón de reglas visible en fondo claro */
#seriesSection .btn-outline {
  color: var(--primary-color);
  border-color: var(--primary-color);
  background: transparent;
}

#seriesSection .btn-outline:hover {
  color: white;
  background: var(--primary-color);
  border-color: var(--primary-color);
}

/* Contenedor de series */
#seriesContainer {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 350px), 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

@media (max-width: 400px) {
  #seriesContainer {
    grid-template-columns: 1fr;
  }
}

/* Tarjeta de serie */
.series-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.series-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Estados de la serie */
.series-card.series-live {
  border-left: 4px solid #22c55e;
  background: linear-gradient(to right, rgba(34, 197, 94, 0.05), transparent);
}

.series-card.series-finished {
  opacity: 0.9;
}

.series-card.series-locked {
  opacity: 0.7;
}

/* Header de la serie */
.series-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.series-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

/* Equipos */
.series-teams {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 1.5rem 0;
  gap: 1rem;
}

.series-team {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.series-team.home {
  text-align: right;
}

.series-team.away {
  text-align: left;
}

.series-team .team-logo {
  width: 50px;
  height: 50px;
  object-fit: contain;
}

.series-team .team-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.series-team .team-tbd {
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
}

.series-vs {
  font-weight: bold;
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 0 0.5rem;
}

/* Marcador agregado */
.series-aggregate {
  background: var(--bg-secondary);
  border-radius: 8px;
  padding: 0.75rem;
  margin: 1rem 0;
  text-align: center;
}

.aggregate-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.aggregate-score {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--accent-color);
}

/* Ganador de la serie */
.series-winner {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  color: white;
  border-radius: 8px;
  padding: 0.75rem;
  margin: 1rem 0;
  text-align: center;
  font-weight: 600;
}

.winner-label {
  margin-right: 0.5rem;
}

.winner-team {
  font-size: 1.1rem;
}

/* Juegos de ida y vuelta */
.series-games {
  background: var(--bg-secondary);
  border-radius: 8px;
  padding: 0.75rem;
  margin: 1rem 0;
}

.series-game {
  display: grid;
  grid-template-columns: 50px 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.5rem 0;
  font-size: 0.85rem;
}

.series-game:not(:last-child) {
  border-bottom: 1px solid var(--border-color);
}

.game-leg {
  font-weight: 600;
  color: var(--text-muted);
}

.game-matchup {
  font-weight: 500;
  color: var(--text-primary);
}

.game-date {
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* Predicción del usuario */
.series-prediction {
  background: var(--bg-secondary);
  border-radius: 8px;
  padding: 0.75rem;
  margin: 1rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.series-prediction.correct {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.series-prediction.incorrect {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.series-prediction.pending {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.prediction-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.prediction-team {
  font-weight: 600;
  color: var(--text-primary);
}

.prediction-score {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.prediction-points {
  margin-left: auto;
  background: var(--accent-color);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
}

/* Botones de predicción */
.series-prediction-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 1rem;
}

.btn-predict {
  padding: 0.75rem 1rem;
  border: 2px solid var(--border-color);
  background: var(--card-bg);
  color: var(--text-primary);
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-predict:hover {
  border-color: var(--accent-color);
  background: var(--accent-light);
  transform: translateY(-2px);
}

.btn-predict.selected {
  border-color: var(--accent-color);
  background: var(--accent-color);
  color: white;
}

.btn-predict:active {
  transform: translateY(0);
}

/* Login prompt */
.login-prompt {
  text-align: center;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: 8px;
  margin-top: 1rem;
}

.login-prompt a {
  color: var(--accent-color);
  text-decoration: none;
  font-weight: 600;
}

.login-prompt a:hover {
  text-decoration: underline;
}

/* Sin series */
.no-series {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
  font-size: 1.1rem;
}

/* Responsive */
@media (max-width: 768px) {
  #seriesContainer {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  #seriesSection {
    margin: 1.5rem 0;
  }

  .series-card {
    padding: 1rem;
  }

  .series-header {
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
  }

  .series-name {
    font-size: 1rem;
  }

  /* Equipos en móvil - layout vertical compacto */
  .series-teams {
    flex-direction: column;
    gap: 0.5rem;
    margin: 1rem 0;
  }

  .series-team {
    width: 100%;
    text-align: center !important;
    flex-direction: row;
    justify-content: center;
    gap: 0.75rem;
  }

  .series-team .team-logo {
    width: 35px;
    height: 35px;
  }

  .series-team .team-name {
    font-size: 0.9rem;
  }

  .series-team .team-tbd {
    font-size: 0.8rem;
  }

  /* VS sin rotar */
  .series-vs {
    font-size: 0.8rem;
    padding: 0.25rem 0;
    margin: 0;
    transform: none;
  }

  /* Juegos de ida y vuelta más compactos */
  .series-games {
    padding: 0.5rem;
    margin: 0.75rem 0;
  }

  .series-game {
    grid-template-columns: 35px 1fr;
    gap: 0.5rem;
    padding: 0.4rem 0;
    font-size: 0.8rem;
  }

  .game-leg {
    font-size: 0.75rem;
  }

  .game-matchup {
    font-size: 0.8rem;
  }

  .game-date {
    grid-column: 2 / 3;
    text-align: right;
    font-size: 0.75rem;
    margin-top: 0.25rem;
  }

  /* Marcador agregado */
  .series-aggregate {
    padding: 0.5rem;
    margin: 0.75rem 0;
  }

  .aggregate-label {
    font-size: 0.75rem;
  }

  .aggregate-score {
    font-size: 1.25rem;
  }

  /* Predicción del usuario */
  .series-prediction {
    padding: 0.5rem;
    margin: 0.75rem 0;
    font-size: 0.85rem;
  }

  .prediction-team {
    font-size: 0.9rem;
  }

  .prediction-points {
    font-size: 0.75rem;
    padding: 0.2rem 0.4rem;
  }

  /* Ganador */
  .series-winner {
    padding: 0.5rem;
    margin: 0.75rem 0;
    font-size: 0.9rem;
  }

  .winner-team {
    font-size: 1rem;
  }

  /* Botones de predicción - mantener grid 1fr 1fr en móvil */
  .series-prediction-buttons {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-top: 0.75rem;
  }

  .btn-predict {
    padding: 0.6rem 0.75rem;
    font-size: 0.85rem;
  }

  /* Login prompt */
  .login-prompt {
    padding: 0.75rem;
    margin-top: 0.75rem;
    font-size: 0.9rem;
  }

  /* Badges más pequeños */
  .badge {
    padding: 0.2rem 0.6rem;
    font-size: 0.7rem;
  }
}

/* Badges */
.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-live {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: white;
  animation: pulse 2s infinite;
}

.badge-finished {
  background: var(--text-muted);
  color: var(--text-primary);
}

.badge-locked {
  background: var(--bg-secondary);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

/* ===== CHAMPION PREDICTION BANNER (Página principal) ===== */
.champion-prediction-banner {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 2px solid #fbbf24;
  border-radius: 12px;
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  box-shadow: 0 2px 8px rgba(251, 191, 36, 0.2);
}

.champion-banner-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.champion-banner-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: #78350f;
}

.champion-banner-header i {
  color: #f59e0b;
  font-size: 1.3rem;
}

.champion-prediction-made {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.champion-team-display {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: white;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  border: 2px solid #fbbf24;
}

.champion-team-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.champion-team-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.champion-team-selector {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.champion-select {
  flex: 1;
  min-width: 200px;
  padding: 0.75rem 1rem;
  border: 2px solid #fbbf24;
  border-radius: 8px;
  background: white;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.3s ease;
}

.champion-select:focus {
  outline: none;
  border-color: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

.champion-message {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #78350f;
  font-size: 0.95rem;
}

.champion-message i {
  color: #f59e0b;
}

/* Responsive para banner de campeón */
@media (max-width: 768px) {
  .champion-prediction-banner {
    padding: 1rem;
    margin: 1rem 0;
  }

  .champion-banner-header {
    font-size: 1rem;
    flex-wrap: wrap;
  }

  .champion-banner-header i {
    font-size: 1.1rem;
  }

  .champion-team-display {
    padding: 0.6rem 1rem;
  }

  .champion-team-logo {
    width: 35px;
    height: 35px;
  }

  .champion-team-name {
    font-size: 1rem;
  }

  .champion-team-selector {
    flex-direction: column;
    align-items: stretch;
  }

  .champion-select {
    width: 100%;
    min-width: unset;
  }

  .champion-message {
    font-size: 0.9rem;
  }
}

/* ===== TOURNAMENT WINNER PREDICTION ===== */
.tournament-winner-section {
  margin: 2rem 0;
}

.winner-prediction-card {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 2px solid #fbbf24;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(251, 191, 36, 0.2);
}

.winner-card-header {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
  padding: 1.5rem;
  text-align: center;
}

.winner-card-header h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.winner-card-subtitle {
  margin: 0.5rem 0 0;
  font-size: 0.95rem;
  opacity: 0.95;
}

.winner-card-body {
  background: white;
  padding: 2rem;
}

.current-prediction {
  text-align: center;
}

.prediction-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.predicted-team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0;
  padding: 1.5rem;
  background: var(--bg-light);
  border-radius: 12px;
  border: 2px solid #fbbf24;
}

.team-logo-large {
  width: 80px;
  height: 80px;
  object-fit: contain;
}

.team-name-large {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
}

.winner-teams-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.winner-team-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  background: var(--bg-light);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.winner-team-option:hover {
  transform: translateY(-3px);
  border-color: #fbbf24;
  box-shadow: 0 4px 12px rgba(251, 191, 36, 0.3);
}

.winner-team-option.selected {
  border-color: #f59e0b;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
}

.winner-team-option img {
  width: 60px;
  height: 60px;
  object-fit: contain;
}

.winner-team-option span {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
  text-align: center;
}

.prediction-message {
  text-align: center;
  padding: 1.5rem;
  background: var(--bg-light);
  border-radius: 8px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

/* Responsive para predicción de campeón */
@media (max-width: 768px) {
  .winner-card-header {
    padding: 1rem;
  }

  .winner-card-header h2 {
    font-size: 1.2rem;
    flex-direction: column;
    gap: 0.25rem;
  }

  .winner-card-subtitle {
    font-size: 0.85rem;
  }

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

  .predicted-team {
    padding: 1rem;
    margin: 1rem 0;
  }

  .team-logo-large {
    width: 60px;
    height: 60px;
  }

  .team-name-large {
    font-size: 1.1rem;
  }

  .winner-teams-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .winner-team-option {
    padding: 0.75rem;
  }

  .winner-team-option img {
    width: 45px;
    height: 45px;
  }

  .winner-team-option span {
    font-size: 0.8rem;
  }
}
