/* ======================================================
  ESTILOS ESPECÍFICOS PARA LA SECCIÓN DE PARTIDOS
  Archivo: partidos.css
  Evita conflictos con index.css encapsulando las reglas 
  dentro de la clase principal .partidos-wrapper
  ======================================================
*/

.partidos-wrapper {
  background-color: #0b0f19; /* Fondo oscuro premium */
  color: #f1f5f9;
  min-height: calc(100vh - 70px);
  padding: 40px 20px;
  font-family: var(--font-main, 'Poppins', sans-serif);
}

.partidos-container {
  max-width: 1100px;
  margin: 0 auto;
}

/* Título de Página */
.partidos-wrapper .page-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 25px;
  color: #ffffff;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.partidos-wrapper .page-title::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 28px;
  background-color: #d7ff00; /* Acento neón deportivo */
  border-radius: 4px;
}

/* Barra de Navegación de Fechas */
.top-bar-dates {
  display: flex;
  gap: 12px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.day-btn {
  background: #1e293b;
  border: 1px solid #334155;
  color: #94a3b8;
  padding: 10px 24px;
  border-radius: 30px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.day-btn:hover {
  background: #27354f;
  color: #ffffff;
  transform: translateY(-2px);
}

.day-btn.active {
  background: #d7ff00;
  color: #000000;
  border-color: #d7ff00;
  box-shadow: 0 4px 15px rgba(215, 255, 0, 0.2);
}

/* Competición Section */
.competition-card {
  margin-bottom: 40px;
  animation: fadeIn 0.5s ease-in-out;
}

.competition-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
  padding: 15px 20px;
  background: linear-gradient(90deg, #1e293b 0%, transparent 100%);
  border-radius: 12px;
  border-left: 4px solid var(--color-red, #37667b);
}

.comp-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
  background: #fff;
  padding: 5px;
  border-radius: 8px;
}

.competition-info h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #f8fafc;
  margin-bottom: 4px;
}

.round-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

/* Grid de Partidos */
.matches-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.match-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.match-card {
  background: #141b2d;
  border: 1px solid #2a3449;
  border-radius: 16px;
  padding: 20px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.match-card:hover {
  transform: translateY(-4px);
  border-color: #4b5563;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.match-card-live {
  border-color: rgba(239, 68, 68, 0.4);
}

.match-card-live::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: #ef4444;
}

/* Equipos y Marcador */
.match-content {
  margin-bottom: 15px;
}

.team-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.team-row:last-child {
  margin-bottom: 0;
}

.team-left {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 80%;
}

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

.team-name {
  font-size: 1rem;
  font-weight: 500;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.score {
  font-size: 1.25rem;
  font-weight: 700;
  color: #94a3b8; /* Marcador inactivo/neutro por defecto */
}

.score-winner {
  color: #ffffff;
}

/* Footer del Partido (Estado y Tiempo) */
.match-footer {
  padding-top: 15px;
  border-top: 1px dashed #2a3449;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.status-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-live {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-finished {
  background: rgba(100, 116, 139, 0.15);
  color: #94a3b8;
  border: 1px solid rgba(100, 116, 139, 0.3);
}

.status-scheduled {
  background: rgba(215, 255, 0, 0.1);
  color: #d7ff00;
  border: 1px solid rgba(215, 255, 0, 0.3);
}

.time-text {
  color: #64748b;
  font-size: 0.85rem;
  font-weight: 500;
}

/* Animaciones e Indicadores */
.live-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  background-color: #ef4444;
  border-radius: 50%;
  margin-right: 6px;
  box-shadow: 0 0 8px #ef4444;
  animation: pulse-red 1.5s infinite ease-in-out;
}

@keyframes pulse-red {
  0% { transform: scale(0.95); opacity: 0.7; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.7; }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Estados de carga y error */
.loading-state, .no-matches {
  text-align: center;
  padding: 60px 20px;
  color: #64748b;
  background: #141b2d;
  border-radius: 16px;
  border: 1px dashed #2a3449;
}

.no-matches i {
  font-size: 3rem;
  margin-bottom: 15px;
  color: #334155;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255,255,255,0.1);
  border-radius: 50%;
  border-top-color: #d7ff00;
  animation: spin 1s ease-in-out infinite;
  margin: 0 auto 15px auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Responsive Ajustes */
@media(max-width: 768px) {
  .partidos-wrapper {
    padding: 20px 15px;
  }
  
  .partidos-wrapper .page-title {
    font-size: 1.5rem;
  }
  
  .matches-grid {
    grid-template-columns: 1fr;
  }
  
  .day-btn {
    flex: 1;
    text-align: center;
    padding: 10px;
  }
}
