/**
 * Estilos del popup de alineaciones (plugin JUEGA Torneos).
 * Compartido por [juega_alineaciones] y [juega_partidos] -- ver
 * Juega_Torneos_Shortcodes::enqueue_alineaciones_assets().
 */

.ja-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100000;
  padding: 16px;
  font-family: "Poppins", "Segoe UI", Arial, sans-serif;
}

.ja-overlay.ja-open {
  display: flex;
}

body.ja-modal-open {
  overflow: hidden;
}

.ja-modal {
  --ja-blue: #003a70;
  --ja-blue-light: #1b6fb8;
  --ja-cyan: #29abe2;
  --ja-white: #ffffff;
  --ja-text: #1a1a1a;
  background: var(--ja-white);
  color: var(--ja-text);
  border-radius: 12px;
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  padding: 24px;
}

.ja-modal * {
  box-sizing: border-box;
}

.ja-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  color: var(--ja-blue);
  padding: 4px 8px;
}

.ja-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding-right: 36px;
}

.ja-match-info {
  font-size: 13px;
  color: var(--ja-blue);
  line-height: 1.5;
}

.ja-download-pdf {
  flex: 0 0 auto;
  background: var(--ja-cyan);
  color: var(--ja-white);
  border: none;
  border-radius: 6px;
  padding: 10px 16px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}

.ja-download-pdf:hover {
  background: var(--ja-blue-light);
}

.ja-download-pdf:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.ja-modal-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 28px;
}

.ja-column + .ja-column {
  border-left: 1px solid #e6e9ef;
  padding-left: 28px;
}

.ja-team-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 2px solid #e6e9ef;
}

.ja-team-logo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: contain;
  box-shadow: 0 0 0 1px rgba(0, 58, 112, .1);
  flex: 0 0 auto;
}

.ja-team-name {
  font-weight: 800;
  font-size: 14px;
  color: var(--ja-blue);
  text-transform: uppercase;
  letter-spacing: .3px;
}

.ja-section-title {
  margin: 14px 0 6px;
  font-size: 12px;
  font-weight: 800;
  color: var(--ja-blue-light);
  text-transform: uppercase;
  letter-spacing: .5px;
}

.ja-player-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ja-player {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 4px;
  border-bottom: 1px solid #f0f2f5;
  font-size: 13px;
  border-radius: 4px;
}

.ja-player-capitan {
  background: rgba(41, 171, 226, .1);
}

.ja-shirt {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--ja-blue);
  color: var(--ja-white);
  font-weight: 700;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ja-photo {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(0, 58, 112, .15);
}

/*
 * Animacion de "esqueleto" (shimmer) para .ja-photo/.ja-team-logo mientras
 * cargan: como es el fondo CSS de un <img>, una vez que la imagen real (o la
 * silueta de respaldo) termina de cargar la tapa por completo -- no hace
 * falta JS para "apagar" la animacion, el propio navegador la deja de
 * mostrar en cuanto pinta el contenido de la imagen encima.
 */
.ja-photo,
.ja-team-logo {
  background: linear-gradient(90deg, #e6e9ef 25%, #f2f5f9 37%, #e6e9ef 63%);
  background-size: 400% 100%;
  animation: ja-shimmer 1.4s ease infinite;
}

@keyframes ja-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.ja-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ja-tag {
  flex: 0 0 auto;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: .3px;
}

.ja-tag-arquero {
  background: #e6e9ef;
  color: var(--ja-blue-light);
}

.ja-tag-capitan {
  background: var(--ja-cyan);
  color: var(--ja-white);
}

.ja-coach {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 2px solid #e6e9ef;
  font-weight: 700;
  font-size: 13px;
  color: var(--ja-blue);
}

.ja-loading,
.ja-error {
  padding: 24px 8px;
  text-align: center;
  color: var(--ja-blue-light);
  font-size: 13px;
}

.ja-error {
  color: #c0392b;
}

@media (max-width: 640px) {
  .ja-modal {
    padding: 18px;
  }

  .ja-modal-header {
    flex-direction: column;
    padding-right: 28px;
  }

  .ja-download-pdf {
    width: 100%;
  }

  .ja-modal-body {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .ja-column + .ja-column {
    border-left: none;
    padding-left: 0;
    border-top: 1px solid #e6e9ef;
    padding-top: 16px;
  }
}
