/* Modern table style for league classification */

.msg-error {
  background: #d32f2f;
  color: #fff;
  font-weight: bold;
  padding: 10px 18px;
  border-radius: 7px;
  margin: 16px 0 18px 0;
  box-shadow: 0 2px 8px #0002;
  letter-spacing: 0.01em;
}


.clasificacion-row {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  max-width: 1200px; /* Limitar ancho total del contenedor */
}
.destacados-panel {
  margin-left: 0; /* Eliminar margen izquierdo */
  margin-top: 0; /* Alinear con la clasificación */
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex-shrink: 0; /* No permitir que se encoja */
}
.destacado-line {
  font-size: 0.95em;
  margin-bottom: 12px;
  color: #5a4a1e;
  display: flex;
  align-items: flex-start;
  line-height: 1.4;
}
.destacado-line .emoji {
  margin-right: 8px;
  font-size: 1.2em;
  flex-shrink: 0;
  margin-top: 1px;
}
.destacado-line strong {
  color: #4a3a0e;
  font-weight: 600;
}

.jornadas-row {
  display: flex;
  gap: 28px;
  margin-bottom: 18px;
}
.jornada-block {
  flex: 1 1 0;
  min-width: 0;
}

.clasificacion-container {
  flex: 1; /* Tomar espacio disponible pero no expandirse demasiado */
  max-width: 800px; /* Coincidir con el max-width de la tabla */
  margin: 0;
  padding: 0;
  background: none;
  border-radius: 0;
  box-shadow: none;
  animation: fadeInUp 0.8s ease-out 0.3s both;
}
#proxima-jornada-panel {
  max-width: 1400px; /* Aumentar el ancho máximo */
  margin: 2rem 0; /* Alinear a la izquierda */
  padding: 2rem;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  width: 100%; /* Usar todo el ancho disponible */
  animation: fadeInUp 0.8s ease-out 0.5s both;
  transition: all 0.3s ease;
}

#proxima-jornada-panel:hover {
  transform: translateY(-2px);
  box-shadow: 0 25px 50px rgba(0,0,0,0.15);
}
#proxima-jornada-panel .jornada-block {
  margin-bottom: 0;
}
.entrenador-ficha-estrecha {
  max-width: 180px !important;
  min-width: 180px !important;
  margin: 0 auto 1.2em auto;
  padding: 12px 13px !important;
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 2px 12px #0002;
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 1.5px solid #e5e5e5;
  gap: 6px;
}

.titulo-entrenador-juvenil {
  display: block;
  text-align: center;
  width: 100%;
  color: #1976d2;
  font-size: 1.08em;
  font-weight: bold;
  margin-bottom: 0.6em;
}

/* Títulos modernos para jornadas */
.jornada-title-modern {
  font-size: 1.4em;
  font-weight: bold;
  margin-bottom: 20px;
  margin-top: 10px;
  text-align: center;
  padding: 12px;
  border-radius: 10px;
  border-left: 4px solid;
}

.jornada-title-modern.finalizado {
  color: #2e7d32;
  background: linear-gradient(135deg, #e8f5e8 0%, #f1f8e9 100%);
  border-left-color: #4caf50;
}

.jornada-title-modern.pendiente {
  color: #1976d2;
  background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
  border-left-color: #1976d2;
}
/* Nuevo diseño moderno para partidos */
.partido-modern {
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 12px;
  margin-bottom: 12px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  border-left: 4px solid #e0e0e0;
  transition: all 0.3s ease;
  min-height: 70px;
}

.partido-modern:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.partido-modern.finalizado {
  border-left-color: #4caf50;
  background: linear-gradient(135deg, #f8fff8 0%, #ffffff 100%);
}

.partido-modern.pendiente {
  border-left-color: #ff9800;
  background: linear-gradient(135deg, #fff8f0 0%, #ffffff 100%);
}

.partido-modern.en_curso {
  border-left-color: #f44336;
  background: linear-gradient(135deg, #ffebee 0%, #ffffff 100%);
}

/* Sección de fecha */
.partido-fecha {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 60px;
  margin-right: 16px;
  padding: 8px;
  background: #f5f5f5;
  border-radius: 8px;
}

.fecha-dia {
  font-size: 0.9em;
  font-weight: bold;
  color: #333;
  line-height: 1;
}

.fecha-hora {
  font-size: 0.8em;
  color: #666;
  margin-top: 2px;
  line-height: 1;
}

/* Sección de equipos */
.partido-equipos {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.equipo-local, .equipo-visitante {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.equipo-visitante {
  flex-direction: row-reverse;
  text-align: right;
}

.equipo-nombre {
  font-weight: 600;
  color: #333;
  font-size: 0.95em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
  cursor: help;
}

.equipo-local .equipo-nombre {
  text-align: left;
}

.equipo-visitante .equipo-nombre {
  text-align: right;
}

.equipo-marcador {
  background: #e3f2fd;
  color: #1976d2;
  font-weight: bold;
  font-size: 1.1em;
  padding: 6px 10px;
  border-radius: 6px;
  min-width: 35px;
  text-align: center;
  flex-shrink: 0;
}

.partido-vs {
  font-size: 0.8em;
  font-weight: bold;
  color: #999;
  background: #f0f0f0;
  padding: 4px 8px;
  border-radius: 4px;
  flex-shrink: 0;
}

/* Estado del partido */
.partido-estado {
  display: flex;
  align-items: center;
  margin-left: 16px;
}

.estado-badge {
  font-size: 1.2em;
  padding: 8px;
  border-radius: 50%;
  background: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  text-decoration: none;
  transition: all 0.3s ease;
}

.estado-badge:hover {
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.estado-badge.finalizado {
  background: #e8f5e8;
  color: #2e7d32;
}

.estado-badge.pendiente {
  background: #fff3e0;
  color: #f57c00;
}

.estado-badge.en_curso {
  background: #ffebee;
  color: #d32f2f;
  animation: pulse 2s infinite;
}

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

/* Responsive design para móvil */
@media (max-width: 768px) {
  .partido-modern {
    flex-direction: column;
    padding: 12px;
    gap: 12px;
    min-height: auto;
  }
  
  .partido-fecha {
    margin-right: 0;
    margin-bottom: 8px;
    min-width: auto;
    width: 100%;
    flex-direction: row;
    justify-content: center;
    gap: 8px;
  }
  
  .partido-equipos {
    width: 100%;
    flex-direction: column;
    gap: 8px;
  }
  
  .equipo-local, .equipo-visitante {
    width: 100%;
    justify-content: space-between;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 8px;
  }
  
  .equipo-visitante {
    flex-direction: row;
  }
  
  .equipo-nombre {
    font-size: 0.9em;
    max-width: 140px;
  }
  
  .partido-vs {
    align-self: center;
    margin: 4px 0;
  }
  
  .partido-estado {
    margin-left: 0;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .equipo-nombre {
    max-width: 120px;
    font-size: 0.85em;
  }
  
  .equipo-marcador {
    font-size: 1em;
    padding: 4px 8px;
    min-width: 30px;
  }
  
  .fecha-dia, .fecha-hora {
    font-size: 0.8em;
  }
}

#club-main {
  display: block;
}

/* Mobile responsive override for club-main */
@media (max-width: 768px) {
  #club-main {
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
  }
}


/* Header styles are now handled in the main HTML */

.liga-selector {
  margin-bottom: 26px;
}

/* Modern table look */
table {
  width: 100%;
  max-width: 800px; /* Limitar ancho máximo de la tabla */
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 12px;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0,0,0,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  animation: fadeInUp 0.8s ease-out 0.3s both;
}
th, td {
  padding: 10px 12px;
  text-align: center;
  font-size: 1.04em;
  transition: background 0.2s;
}

/* Definir anchos específicos para cada columna */
th:nth-child(1), td:nth-child(1) { width: 50px; } /* Pos */
th:nth-child(2), td:nth-child(2) { width: 200px; max-width: 200px; } /* Equipo */
th:nth-child(3), td:nth-child(3) { width: 80px; } /* V-D */
th:nth-child(4), td:nth-child(4) { width: 70px; } /* PF */
th:nth-child(5), td:nth-child(5) { width: 70px; } /* PC */
th:nth-child(6), td:nth-child(6) { width: 70px; } /* Dif */

.equipo-nombre {
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
  font-weight: 500;
  font-family: 'Segoe UI Emoji', 'Noto Color Emoji', 'Apple Color Emoji', 'Segoe UI Symbol', Arial, sans-serif;
}

th {
  background: linear-gradient(90deg,#e3e7ff 0%,#f4f4ff 100%);
  color: #324;
  font-weight: 700;
  border-bottom: 2px solid #d2d2ff;
  letter-spacing: 0.5px;
}
tr {
  transition: background 0.18s;
}
tr:nth-child(even) {
  background: #f3f6ff;
}
tr:nth-child(odd) {
  background: #fff;
}
td:first-child, th:first-child {
  font-weight: bold;
  color: #3d4b8a;
}


.equipo-nombre a {
  color: #2a3d8f;
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: 3px;
  transition: color 0.18s, background 0.18s;
  padding: 2px 5px;
}
.equipo-nombre a:visited {
  color: #2a3d8f;
}
.equipo-nombre a:hover, .equipo-nombre a:focus {
  color: #ff9500;
  background: none;
  text-decoration: none;
}

.mi-equipo {
  background: #ffefd2 !important;
  font-weight: bold;
  box-shadow: 0 0 0 2px #ffd580 inset;
}
.mi-equipo .equipo-nombre .emoji-casa {
  margin-right: 4px;
  font-size: 1.1em;
  vertical-align: middle;
}
tbody tr:hover {
  background: #e9f1ff !important;
}
table {
  border: none;
}
td, th {
  border: none;
}

/* 📊📅 ESTILOS PARA JORNADAS ANTERIOR Y PRÓXIMA */

/* Contenedor para mostrar jornadas lado a lado */
.jornadas-container {
  display: flex;
  gap: 25px;
  margin-bottom: 20px;
  width: 100%;
  max-width: 1400px; /* Ancho máximo más amplio */
  margin-left: 0; /* Alinear a la izquierda */
  margin-right: 0;
}

.jornada-section {
  background: #f8f9ff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  border: 1px solid #e3e7ff;
  flex: 1;
  min-width: 450px; /* Ancho mínimo más amplio */
  max-width: 650px; /* Ancho máximo para cada sección */
}

/* Ajustar el contenedor principal para dar más espacio */
#proxima-jornada-panel {
  width: 100% !important;
  max-width: none !important;
}

/* Responsive: En pantallas pequeñas, volver a apilar */
@media (max-width: 1000px) {
  .jornadas-container {
    flex-direction: column;
    gap: 20px;
    max-width: 100%;
  }
  
  .jornada-section {
    min-width: 0;
    max-width: none;
  }
  
  /* Apilar clasificación y destacados en pantallas pequeñas */
  .clasificacion-row {
    flex-direction: column;
    gap: 20px;
    max-width: 100%;
  }
  
  .destacados-panel {
    max-width: 100%;
    margin-top: 20px;
  }
  
  .clasificacion-container {
    max-width: 100%;
    padding: 20px 15px;
  }
}

.jornada-title {
  font-weight: 700;
  font-size: 1.15em;
  margin-bottom: 15px;
  padding-bottom: 8px;
  border-bottom: 2px solid #d2d2ff;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Colores específicos para cada tipo de jornada */
.jornada-section:has(.jornada-title[style*="color:#2e7d32"]) {
  background: #f1f8e9;
  border-color: #c8e6c9;
}

.jornada-section:has(.jornada-title[style*="color:#1565c0"]) {
  background: #e3f2fd;
  border-color: #bbdefb;
}

/* Estilos para partidos dentro de las jornadas */
.jornada-section .partido {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  margin-bottom: 8px;
  padding: 12px 16px;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.jornada-section .partido:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  border-color: #1565c0;
}

.jornada-section .partido.finalizado {
  border-left: 4px solid #2e7d32;
}

.jornada-section .partido.pendiente {
  border-left: 4px solid #1565c0;
}

.jornada-section .equipos {
  font-weight: 600;
  color: #1a1a1a;
}

.jornada-section .goles {
  background: #f5f5f5;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: 700;
  color: #333;
  margin: 0 8px;
  min-width: 25px;
  text-align: center;
  display: inline-block;
}

/* Estilos para el panel de destacados mejorado */
.destacados-panel {
  background: white;
  border-radius: 15px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  overflow: hidden;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.destacados-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 15px 20px;
  color: white;
}

.destacados-title {
  margin: 0;
  font-size: 1.3em;
  font-weight: 700;
  text-align: center;
}

.destacados-content {
  padding: 0;
}

/* Grid 2x2 para destacados */
.destacados-grid {
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.destacados-grid-title {
  margin: 0 0 16px 0;
  font-size: 2.1em;
  font-weight: 700;
  color: #333;
  text-align: center;
}

/* Estilos para emojis de posición en clasificación */
.posicion-numero {
  font-weight: bold;
}

.posicion-emoji {
  font-size: 1em;
  margin-left: 4px;
  vertical-align: middle;
}

/* Ancho específico para columna de posición */
table th:first-child,
table td:first-child {
  width: 80px;
  min-width: 80px;
  white-space: nowrap;
}

.destacados-row {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

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

.destacado-item {
  border-radius: 12px;
  padding: 14px;
  color: white;
  box-shadow: 0 3px 10px rgba(0,0,0,0.2);
  transition: all 0.2s ease;
  flex: 1;
  margin: 0;
  height: 160px;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.destacado-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.destacado-item:last-child {
  margin-bottom: 15px;
}

.destacado-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.destacado-icon {
  font-size: 1.2em;
}

.destacado-categoria {
  font-weight: 700;
  font-size: 0.8em;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.destacado-content-item {
  padding-left: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.destacado-jugador {
  font-size: 1em;
  font-weight: 700;
  margin-bottom: 6px;
}

.destacado-jugador .jugador-link {
  text-decoration: none;
  transition: all 0.2s ease;
  font-weight: 700;
}

.destacado-jugador .jugador-link:hover {
  text-decoration: underline;
  text-shadow: 0 0 8px rgba(255,255,255,0.8);
  opacity: 0.9;
}

.destacado-equipo {
  font-size: 0.8em;
  opacity: 0.9;
  margin-bottom: 8px;
}

.destacado-valor {
  font-size: 1em;
  font-weight: 700;
  background: rgba(0,0,0,0.2);
  padding: 6px 10px;
  border-radius: 8px;
  display: inline-block;
  border: 1px solid rgba(255,255,255,0.3);
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.no-data {
  text-align: center;
  color: #666;
  font-style: italic;
  padding: 20px;
}

/* Estilos para el enlace de estadísticas de liga */
.stats-link-container {
  margin-top: 20px;
  padding: 15px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
  transition: all 0.3s ease;
}

.stats-link-container:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.stats-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: white;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.1em;
}

.stats-link:hover {
  color: white;
  text-decoration: none;
}

.stats-link-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stats-link-arrow {
  font-size: 1.2em;
  transition: transform 0.2s ease;
}

.stats-link:hover .stats-link-arrow {
  transform: translateX(5px);
}

.jornada-section .vs {
  color: #666;
  font-weight: 500;
  margin: 0 4px;
}

.jornada-section .estado {
  font-size: 0.9em;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: 600;
}

.jornada-section .partido.finalizado .estado {
  background: #e8f5e8;
  color: #2e7d32;
}

.jornada-section .partido.pendiente .estado {
  background: #e3f2fd;
  color: #1565c0;
}

.jornada-section .partido.en_curso .estado {
  background: #ffebee;
  color: #d32f2f;
  animation: pulse 2s infinite;
}

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

.jornada-section .fecha {
  font-size: 0.9em;
  color: #666;
  font-weight: 500;
  margin-right: 12px;
}

.jugador-link {
  color: #007bff;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.jugador-link:hover {
  color: #0056b3;
  text-decoration: underline;
}

.jugador-link:visited {
  color: #6f42c1;
}

.jugador-link:active {
  color: #dc3545;
}

.stats-link-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  text-decoration: none;
  padding: 20px;
  border-radius: 15px;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
  transition: all 0.3s ease;
  font-weight: 600;
}

.stats-link-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
  color: white;
}

.stats-link-button:active {
  transform: translateY(0);
}

.stats-icon {
  font-size: 1.5em;
  margin-right: 12px;
}

.stats-text {
  flex: 1;
}

.stats-title {
  font-weight: 700;
  font-size: 1.1em;
  margin-bottom: 2px;
}

.stats-subtitle {
  font-size: 0.85em;
  opacity: 0.9;
  font-weight: 400;
}

.stats-arrow {
  font-size: 1.2em;
  margin-left: 8px;
  transition: transform 0.3s ease;
}

.stats-link-button:hover .stats-arrow {
  transform: translateX(3px);
}

.jornada-section .estado {
  font-size: 0.9em;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: 600;
}

.jornada-section .partido.finalizado .estado {
  background: #e8f5e8;
  color: #2e7d32;
}

.jornada-section .partido.pendiente .estado {
  background: #e3f2fd;
  color: #1565c0;
}

.jornada-section .partido.en_curso .estado {
  background: #ffebee;
  color: #d32f2f;
  animation: pulse 2s infinite;
}

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

.jornada-section .fecha {
  font-size: 0.9em;
  color: #666;
  font-weight: 500;
  margin-right: 12px;
}
