/* ===== TARJETAS DE PARTIDOS MEJORADAS ===== */
/* Basado en el diseño de Liga MX Quiniela */

/* Contenedor de partidos */
.games-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1.5rem;
  padding: 0.5rem;
}

/* Tarjeta individual de partido */
.game-card {
  background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
  border-radius: 20px;
  padding: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  border: 2px solid transparent;
  position: relative;
}

.game-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
  border-color: var(--primary-color);
}

/* Estados especiales de la tarjeta */
.game-card.game-live {
  border-color: #e82c23;
  background: linear-gradient(135deg, #fff5f5 0%, #ffffff 100%);
  animation: pulse-border 2s ease-in-out infinite;
}

.game-card.game-finished {
  border-color: #636365;
  opacity: 0.95;
}

.game-card.game-locked {
  border-color: #9b9b9e;
  opacity: 0.85;
}

@keyframes pulse-border {
  0%, 100% {
    border-color: #e82c23;
    box-shadow: 0 0 0 0 rgba(232, 44, 35, 0.4);
  }
  50% {
    border-color: #ff4444;
    box-shadow: 0 0 0 6px rgba(232, 44, 35, 0);
  }
}

/* Header de la tarjeta */
.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, #636365 0%, #7a7c7e 100%);
  color: white;
  font-size: 0.875rem;
  font-weight: 600;
}

.game-card.game-live .game-header {
  background: linear-gradient(135deg, #e82c23 0%, #c01b1b 100%);
}

.game-card.game-finished .game-header {
  background: linear-gradient(135deg, #2a8535 0%, #36a943 100%);
}

.game-time {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
}

.game-time::before {
  content: "📅";
  font-size: 1rem;
}

/* Badges de estado */
.badge {
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.badge-live {
  background: #fff;
  color: #e82c23;
  animation: pulse-badge 1.5s ease-in-out infinite;
}

.badge-live::before {
  content: "●";
  font-size: 1.2rem;
  animation: blink 1.5s ease-in-out infinite;
}

@keyframes pulse-badge {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

@keyframes blink {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}

.badge-finished {
  background: rgba(255, 255, 255, 0.95);
  color: #2a8535;
}

.badge-locked {
  background: rgba(255, 255, 255, 0.9);
  color: #636365;
}

.badge-locked::before {
  content: "🔒";
}

.badge-postponed {
  background: rgba(255, 255, 255, 0.9);
  color: #d97706;
}

/* Sección de equipos */
.game-teams {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2rem 1.5rem;
  gap: 1.5rem;
  background: white;
  position: relative;
}

.game-teams::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  height: 1px;
  background: linear-gradient(
    to right,
    transparent,
    #e5e7eb 20%,
    #e5e7eb 80%,
    transparent
  );
}

.team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  transition: transform 0.3s ease;
}

.team:hover {
  transform: scale(1.05);
}

.team-logo {
  width: 85px;
  height: 85px;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
  transition: all 0.3s ease;
}

.team:hover .team-logo {
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.2));
  transform: scale(1.1);
}

.team-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1a1a1a;
  text-align: center;
  line-height: 1.3;
  max-width: 110px;
}

.team-home .team-name {
  color: #36a943;
}

.team-away .team-name {
  color: #c01b1b;
}

/* VS divisor */
.vs {
  font-size: 1.5rem;
  font-weight: 900;
  color: #636365;
  background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border: 3px solid white;
  flex-shrink: 0;
  letter-spacing: -1px;
}

/* Marcador del partido */
.game-score {
  padding: 1.25rem 1.5rem;
  background: linear-gradient(135deg, #f9fafb, #ffffff);
  text-align: center;
  border-top: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
}

.game-score .score {
  font-size: 2.5rem;
  font-weight: 800;
  color: #1a1a1a;
  letter-spacing: 4px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.05);
}

.game-card.game-live .game-score {
  background: linear-gradient(135deg, #fff5f5, #ffffff);
}

.game-card.game-live .game-score .score {
  color: #e82c23;
  animation: score-pulse 2s ease-in-out infinite;
}

@keyframes score-pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

/* Predicción del usuario */
.user-prediction {
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  border-radius: 0 0 18px 18px;
}

.user-prediction.correct {
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  color: #065f46;
}

.user-prediction.incorrect {
  background: linear-gradient(135deg, #fed7d7, #fca5a5);
  color: #991b1b;
}

.user-prediction.pending {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #78350f;
}

/* Botones de predicción */
.game-actions {
  display: flex;
  gap: 0.75rem;
  padding: 1.5rem 1.25rem;
  background: white;
}

/* Estilo para botones outline en game-actions (fondo blanco) */
.game-actions .btn-outline {
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
  background: transparent;
}

.game-actions .btn-outline:hover:not(:disabled) {
  background: var(--primary-color);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(54, 169, 67, 0.3);
}

.btn-predict {
  flex: 1;
  padding: 0.95rem 1rem;
  background: linear-gradient(135deg, #ffffff, #f9fafb);
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.9rem;
  color: #1a1a1a;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: hidden;
}

.btn-predict::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  opacity: 0;
  transition: opacity 0.25s ease;
}

.btn-predict span {
  position: relative;
  z-index: 1;
}

.btn-predict:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(54, 169, 67, 0.2);
  border-color: var(--primary-color);
}

.btn-predict:hover::before {
  opacity: 0.1;
}

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

.btn-predict.active {
  background: linear-gradient(135deg, #36a943, #2a8535);
  color: white;
  border-color: #2a8535;
  box-shadow: 0 6px 16px rgba(54, 169, 67, 0.3);
  transform: translateY(-2px);
}

.btn-predict.active::after {
  content: "✓";
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: 1.1rem;
  font-weight: bold;
}

.btn-predict:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Texto de predicciones cerradas */
.predictions-closed {
  text-align: center;
  padding: 1rem;
  color: #636365;
  font-weight: 600;
  font-size: 0.95rem;
  background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
  border-radius: 12px;
  width: 100%;
}

.predictions-closed::before {
  content: "🔒 ";
  font-size: 1.1rem;
}

/* Mensaje cuando no hay partidos */
.no-games {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 2rem;
  background: white;
  border-radius: 20px;
  box-shadow: var(--shadow-md);
}

.no-games::before {
  content: "⚽";
  font-size: 4rem;
  display: block;
  margin-bottom: 1rem;
  opacity: 0.3;
}

/* ===== RESPONSIVE DESIGN ===== */

@media (max-width: 768px) {
  .games-container {
    grid-template-columns: 1fr;
    gap: 1.25rem;
    padding: 0.25rem;
  }

  .game-card {
    border-radius: 16px;
  }

  .game-header {
    padding: 0.85rem 1rem;
    font-size: 0.8rem;
  }

  .game-teams {
    padding: 1.5rem 1rem;
    gap: 1rem;
  }

  .team-logo {
    width: 70px;
    height: 70px;
  }

  .team-name {
    font-size: 0.85rem;
    max-width: 90px;
  }

  .vs {
    width: 42px;
    height: 42px;
    font-size: 1.25rem;
  }

  .game-score .score {
    font-size: 2rem;
    letter-spacing: 3px;
  }

  .game-actions {
    gap: 0.5rem;
    padding: 1.25rem 1rem;
  }

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

@media (max-width: 480px) {
  .game-teams {
    padding: 1.25rem 0.75rem;
  }

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

  .team-name {
    font-size: 0.8rem;
    max-width: 80px;
  }

  .vs {
    width: 38px;
    height: 38px;
    font-size: 1.1rem;
  }

  .game-score .score {
    font-size: 1.75rem;
    letter-spacing: 2px;
  }
}

/* ===== ANIMACIONES ADICIONALES ===== */

/* Animación de entrada para las tarjetas */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.game-card {
  animation: slideUp 0.4s ease-out backwards;
}

.game-card:nth-child(1) { animation-delay: 0.05s; }
.game-card:nth-child(2) { animation-delay: 0.1s; }
.game-card:nth-child(3) { animation-delay: 0.15s; }
.game-card:nth-child(4) { animation-delay: 0.2s; }
.game-card:nth-child(5) { animation-delay: 0.25s; }
.game-card:nth-child(6) { animation-delay: 0.3s; }

/* Efecto de brillo para juegos en vivo */
.game-card.game-live::after {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  animation: shine 3s infinite;
}

@keyframes shine {
  0% {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  100% {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* ===== ESTADOS DE CARGA ===== */

.game-card.loading {
  pointer-events: none;
  opacity: 0.6;
}

.game-card.loading::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.5),
    transparent
  );
  animation: loading-shimmer 1.5s infinite;
}

@keyframes loading-shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}
