/**
 * Estilos para Bracket de Liguilla
 */

/* ===== LIGUILLA HEADER ===== */
.liguilla-header {
  text-align: center;
  margin: 2rem 0 3rem;
  padding: 2rem;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  border-radius: 12px;
  color: white;
}

.liguilla-title {
  font-size: 2.5rem;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.liguilla-title i {
  color: #fbbf24;
}

.liguilla-subtitle {
  font-size: 1.1rem;
  margin: 0.5rem 0 0;
  opacity: 0.9;
}

/* ===== PHASE SELECTOR ===== */
.phase-selector {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
  margin: 2rem 0;
  padding: 1rem;
  background: var(--bg-light);
  border-radius: 12px;
}

.phase-btn {
  padding: 0.75rem 1.5rem;
  background: white;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  color: var(--text-dark);
}

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

.phase-btn.active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

/* ===== BRACKET CONTAINER ===== */
.bracket-container {
  margin: 3rem 0;
  overflow-x: auto;
  padding: 2rem 0;
}

.bracket {
  display: flex;
  gap: 3rem;
  min-width: max-content;
  padding: 2rem;
  justify-content: center;
}

.bracket-single {
  justify-content: center;
}

/* ===== BRACKET ROUNDS ===== */
.bracket-round {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-width: 280px;
}

.bracket-final {
  min-width: 320px;
}

.round-title {
  text-align: center;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary-color);
  margin: 0 0 1rem;
  padding: 0.75rem;
  background: var(--bg-light);
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.round-matches {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  justify-content: center;
}

/* ===== BRACKET MATCH ===== */
.bracket-match {
  position: relative;
  background: white;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  padding: 1rem;
  transition: all 0.3s ease;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.bracket-match:hover {
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 104, 71, 0.15);
}

.bracket-match.match-live {
  border-color: #22c55e;
  background: linear-gradient(to right, rgba(34, 197, 94, 0.05), white);
  animation: pulse-border 2s infinite;
}

.bracket-match.match-completed {
  opacity: 0.9;
}

@keyframes pulse-border {
  0%, 100% {
    border-color: #22c55e;
  }
  50% {
    border-color: #16a34a;
  }
}

/* ===== MATCH TEAMS ===== */
.match-teams {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.bracket-team {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  border-radius: 8px;
  transition: all 0.3s ease;
  background: var(--bg-light);
}

.bracket-team.team-winner {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(251, 191, 36, 0.3);
}

.bracket-team.team-winner .team-name {
  color: #78350f;
}

.bracket-team.team-winner .team-score {
  color: #78350f;
  font-size: 1.2rem;
}

.bracket-team.team-predicted {
  border: 2px solid #3b82f6;
  background: rgba(59, 130, 246, 0.05);
}

.bracket-team.team-tbd {
  opacity: 0.6;
  background: var(--bg-secondary);
}

/* ===== TEAM INFO ===== */
.team-info-bracket {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
}

.team-logo-small {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.team-logo-placeholder {
  width: 32px;
  height: 32px;
  background: var(--border-color);
  border-radius: 50%;
}

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

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

.team-score {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--primary-color);
  min-width: 30px;
  text-align: center;
}

/* ===== PREDICTION INDICATOR ===== */
.prediction-indicator {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  z-index: 10;
}

.prediction-indicator.correct {
  background: #22c55e;
  color: white;
}

.prediction-indicator.incorrect {
  background: #ef4444;
  color: white;
}

.prediction-indicator.pending {
  background: #3b82f6;
  color: white;
}

/* ===== CHAMPION BADGE ===== */
.champion-badge {
  margin-top: 0.75rem;
  padding: 0.5rem;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #78350f;
  text-align: center;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: 0 2px 8px rgba(251, 191, 36, 0.4);
}

.champion-badge i {
  margin-right: 0.5rem;
}

/* ===== SERIES DETAIL SECTION ===== */
.series-detail-section {
  margin: 4rem 0 3rem;
}

.series-detail-section h2 {
  font-size: 2rem;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 2rem;
}

.phase-group {
  margin-bottom: 3rem;
}

.phase-title {
  font-size: 1.5rem;
  color: var(--primary-color);
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 3px solid var(--primary-color);
}

.series-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 350px), 1fr));
  gap: 1.5rem;
}

/* ===== SERIES HIGHLIGHTED ===== */
.series-highlighted {
  animation: highlight-pulse 1s ease-in-out 3;
  border: 2px solid var(--primary-color) !important;
}

@keyframes highlight-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(0, 104, 71, 0.4);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(0, 104, 71, 0);
  }
}

/* ===== PLAYOFF LEADERBOARD SECTION ===== */
.playoff-leaderboard-section {
  margin: 4rem 0 3rem;
  padding: 2rem;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.playoff-leaderboard-section h2 {
  font-size: 2rem;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
}

/* ===== NO PLAYOFFS MESSAGE ===== */
.no-playoffs-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
  text-align: center;
  padding: 3rem;
}

.no-playoffs-message i {
  font-size: 5rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.no-playoffs-message h3 {
  font-size: 2rem;
  color: var(--text-dark);
  margin-bottom: 1rem;
}

.no-playoffs-message p {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  max-width: 600px;
}

.no-bracket {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
  font-size: 1.1rem;
}

/* ===== RESPONSIVE MOBILE ===== */
@media (max-width: 768px) {
  .liguilla-title {
    font-size: 1.75rem;
  }

  .liguilla-subtitle {
    font-size: 0.95rem;
  }

  .liguilla-header {
    margin: 1.5rem 0 2rem;
    padding: 1.5rem 1rem;
  }

  .phase-selector {
    gap: 0.5rem;
    padding: 0.75rem;
  }

  .phase-btn {
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
  }

  .bracket-container {
    margin: 2rem 0;
    padding: 1rem 0;
  }

  .bracket {
    gap: 1.5rem;
    padding: 1rem;
  }

  .bracket-round {
    min-width: 240px;
    gap: 1rem;
  }

  .bracket-final {
    min-width: 260px;
  }

  .round-title {
    font-size: 1rem;
    padding: 0.6rem;
  }

  .round-matches {
    gap: 1.25rem;
  }

  .bracket-match {
    padding: 0.75rem;
  }

  .bracket-team {
    padding: 0.6rem;
  }

  .team-logo-small {
    width: 28px;
    height: 28px;
  }

  .team-logo-placeholder {
    width: 28px;
    height: 28px;
  }

  .team-name {
    font-size: 0.85rem;
  }

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

  .team-score {
    font-size: 1rem;
    min-width: 25px;
  }

  .prediction-indicator {
    width: 24px;
    height: 24px;
    font-size: 0.8rem;
    top: -8px;
    right: -8px;
  }

  .champion-badge {
    font-size: 0.85rem;
    padding: 0.4rem;
  }

  .series-detail-section {
    margin: 3rem 0 2rem;
  }

  .series-detail-section h2 {
    font-size: 1.5rem;
  }

  .section-subtitle {
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
  }

  .phase-title {
    font-size: 1.25rem;
    margin-bottom: 1rem;
  }

  .series-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .playoff-leaderboard-section {
    margin: 3rem 0 2rem;
    padding: 1.5rem 1rem;
  }

  .playoff-leaderboard-section h2 {
    font-size: 1.5rem;
  }

  .no-playoffs-message {
    min-height: 40vh;
    padding: 2rem 1rem;
  }

  .no-playoffs-message i {
    font-size: 3.5rem;
  }

  .no-playoffs-message h3 {
    font-size: 1.5rem;
  }

  .no-playoffs-message p {
    font-size: 1rem;
  }
}

/* ===== DESKTOP ENHANCEMENTS ===== */
@media (min-width: 1200px) {
  .bracket {
    gap: 4rem;
  }

  .bracket-round {
    min-width: 320px;
  }

  .bracket-final {
    min-width: 360px;
  }

  .series-grid {
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 2rem;
  }
}
