/* =========================================================
   DATOS · navegación de equipos + barra combinada liga/equipos/grupo
   ========================================================= */

.datos-teams-grid .ag-row {
  cursor: pointer;
}

.datos-teams-grid .ag-row:hover {
  filter: brightness(1.08);
}

.datos-team-nav-label,
.datos-team-nav-count,
.datos-team-nav-blob {
  display: none !important;
}

/* =========================================================
   Barra superior combinada
   Desktop:
   Izquierda: liga
   Centro: equipos
   Derecha: dropdown grupo
   ========================================================= */

.datos-team-combined-nav-shell {
  position: relative;

  width: 100%;
  min-width: 0;
  box-sizing: border-box;

  display: grid;
  grid-template-columns: minmax(220px, 330px) minmax(0, 1fr) 170px;
  align-items: center;
  gap: 14px;

  height: 92px;
  min-height: 92px;
  max-height: 92px;

  margin-bottom: 14px;
  padding: 10px 14px;

  border-radius: 18px;
  border: 1px solid color-mix(
    in srgb,
    var(--datos-team-accent) 16%,
    rgba(255,255,255,0.08)
  );

  background:
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--datos-team-soft) 30%, rgba(255,255,255,.04)) 0%,
      rgba(0,0,0,0.24) 100%
    );

  color: white;

  /*
    No usamos overflow hidden para que el menú del dropdown
    no quede cortado.
  */
  overflow: visible;
}

/* =========================================================
   Bloque izquierdo · liga seleccionada
   ========================================================= */

.datos-team-combined-left {
  min-width: 0;
  width: 100%;
}

.datos-team-combined-league-head {
  display: flex;
  align-items: center;
  gap: 10px;

  width: 100%;
  min-width: 0;
}

.datos-team-combined-league-icon,
.datos-team-combined-league-icon-fallback {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
}

.datos-team-combined-league-icon {
  object-fit: contain;
}

.datos-team-combined-league-icon-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 21px;
}

.datos-team-combined-league-text {
  min-width: 0;

  display: flex;
  flex-direction: column;
  justify-content: center;
}

/*
  Título principal:
  - puede partir en 2 líneas
  - no rompe la barra
*/
.datos-team-combined-league-title {
  color: white;
  font-size: 16px;
  font-weight: 850;
  line-height: 1.12;

  white-space: normal;
  overflow: hidden;

  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/*
  Subtítulo:
  - una sola línea
  - si no entra, ellipsis
*/
.datos-team-combined-league-subtitle {
  color: rgba(255,255,255,0.66);
  font-size: 11px;
  line-height: 1.15;
  margin-top: 4px;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* =========================================================
   Bloque central · equipos
   ========================================================= */

.datos-team-combined-center {
  min-width: 0;
  width: 100%;

  display: flex;
  align-items: center;
  justify-content: center;
}

/*
  Scroller fijo:
  - reserva espacio para el carril del scrollbar
  - no cambia la altura de la barra
*/
.datos-team-combined-teams-scroll {
  width: 100%;
  height: 72px;
  min-height: 72px;
  max-height: 72px;
  min-width: 0;
  box-sizing: border-box;

  overflow-x: auto;
  overflow-y: hidden;
  display: block;

  padding: 4px 8px 13px 8px;
  scrollbar-gutter: stable both-edges;

  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.18) transparent;
}

.datos-team-combined-teams-scroll::-webkit-scrollbar {
  height: 5px;
}

.datos-team-combined-teams-scroll::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.18);
  border-radius: 999px;
}

.datos-team-combined-teams-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.datos-team-combined-teams-scroll::-webkit-scrollbar-corner {
  background: transparent;
}

/* Fila de escudos */
.datos-team-nav-strip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;

  width: max-content;
  min-width: 100%;

  margin: 0 auto;
  white-space: nowrap;
  flex-wrap: nowrap;
}

.datos-team-combined-team-strip {
  min-width: 100% !important;
  width: max-content !important;
  justify-content: center !important;
  margin: 0 auto !important;
}

/* Mensaje de error/vacío */
.datos-team-combined-error {
  width: 100%;
  text-align: center;
  color: rgba(255,255,255,0.72);
  font-size: 12px;
  line-height: 1.35;
}

/* =========================================================
   Bloque derecho · dropdown grupo
   ========================================================= */

.datos-team-combined-right {
  min-width: 0;
  width: 100%;

  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.datos-team-group-dropdown {
  width: 165px;
  min-width: 165px;
  max-width: 165px;

  flex: 0 0 auto;
  font-size: 12px;
}

/* React Select antiguo usado por dcc.Dropdown */
.datos-team-group-dropdown .Select-control {
  min-height: 36px;
  height: 36px;

  border-radius: 999px !important;
  border: 1px solid color-mix(
    in srgb,
    var(--datos-team-accent) 50%,
    rgba(255,255,255,0.14)
  ) !important;

  background:
    linear-gradient(
      90deg,
      color-mix(
        in srgb,
        var(--datos-team-accent) 22%,
        rgba(255,255,255,0.055)
      ) 0%,
      rgba(255,255,255,0.065) 100%
    ) !important;

  box-shadow: none !important;
}

.datos-team-group-dropdown .Select-control:hover {
  border-color: color-mix(
    in srgb,
    var(--datos-team-accent) 72%,
    rgba(255,255,255,0.22)
  ) !important;
}

.datos-team-group-dropdown .Select-placeholder,
.datos-team-group-dropdown .Select-value,
.datos-team-group-dropdown .Select-value-label {
  color: white !important;
  line-height: 34px !important;
  font-weight: 800;
  font-size: 12px;
}

.datos-team-group-dropdown .Select-value-label {
  max-width: 122px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.datos-team-group-dropdown .Select-input {
  height: 34px !important;
}

.datos-team-group-dropdown .Select-input > input {
  color: white !important;
  font-size: 12px !important;
}

.datos-team-group-dropdown .Select-arrow-zone {
  width: 30px !important;
}

.datos-team-group-dropdown .Select-arrow {
  border-top-color: rgba(255,255,255,0.82) !important;
}

/* Menú */
.datos-team-group-dropdown .Select-menu-outer {
  margin-top: 7px;

  border-radius: 14px !important;
  overflow: hidden;

  background: rgba(14,18,24,0.98) !important;
  border: 1px solid rgba(255,255,255,0.13) !important;
  box-shadow: 0 16px 34px rgba(0,0,0,0.34) !important;

  z-index: 9999 !important;
}

.datos-team-group-dropdown .Select-menu {
  max-height: 260px !important;
}

.datos-team-group-dropdown .Select-option {
  background: rgba(14,18,24,0.98) !important;
  color: rgba(255,255,255,0.86) !important;

  font-size: 12px;
  font-weight: 700;
  padding: 9px 12px;
}

.datos-team-group-dropdown .Select-option:hover,
.datos-team-group-dropdown .Select-option.is-focused {
  background: color-mix(
    in srgb,
    var(--datos-team-accent) 24%,
    rgba(255,255,255,0.08)
  ) !important;
  color: white !important;
}

.datos-team-group-dropdown .Select-option.is-selected {
  background: color-mix(
    in srgb,
    var(--datos-team-accent) 36%,
    rgba(255,255,255,0.08)
  ) !important;
  color: white !important;
}

/* Compatibilidad con versiones nuevas de dcc.Dropdown */
.datos-team-group-dropdown .Select__control {
  min-height: 36px;
  border-radius: 999px !important;
  border: 1px solid color-mix(
    in srgb,
    var(--datos-team-accent) 50%,
    rgba(255,255,255,0.14)
  ) !important;
  background: rgba(255,255,255,0.06) !important;
  box-shadow: none !important;
}

.datos-team-group-dropdown .Select__single-value,
.datos-team-group-dropdown .Select__placeholder,
.datos-team-group-dropdown .Select__input-container {
  color: white !important;
  font-size: 12px;
  font-weight: 800;
}

.datos-team-group-dropdown .Select__menu {
  background: rgba(14,18,24,0.98) !important;
  border: 1px solid rgba(255,255,255,0.13) !important;
  border-radius: 14px !important;
  overflow: hidden;
  box-shadow: 0 16px 34px rgba(0,0,0,0.34) !important;
  z-index: 9999 !important;
}

.datos-team-group-dropdown .Select__option {
  background: rgba(14,18,24,0.98) !important;
  color: rgba(255,255,255,0.86) !important;
  font-size: 12px;
  font-weight: 700;
}

.datos-team-group-dropdown .Select__option--is-focused {
  background: color-mix(
    in srgb,
    var(--datos-team-accent) 24%,
    rgba(255,255,255,0.08)
  ) !important;
  color: white !important;
}

.datos-team-group-dropdown .Select__option--is-selected {
  background: color-mix(
    in srgb,
    var(--datos-team-accent) 36%,
    rgba(255,255,255,0.08)
  ) !important;
  color: white !important;
}

/* =========================================================
   Botón de equipo solo con escudo
   ========================================================= */

.datos-team-nav-btn {
  appearance: none;
  -webkit-appearance: none;

  position: relative;

  width: 56px;
  height: 56px;
  min-width: 56px;
  padding: 0;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  border-radius: 17px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.045);

  color: white;
  cursor: pointer;

  flex: 0 0 auto;

  transition:
    background .22s ease,
    border-color .22s ease,
    box-shadow .22s ease,
    transform .22s ease,
    filter .22s ease;
}

.datos-team-nav-btn:hover {
  transform: translateY(-2px);

  border-color: color-mix(
    in srgb,
    var(--datos-team-accent) 65%,
    rgba(255,255,255,0.22)
  );

  background:
    linear-gradient(
      180deg,
      color-mix(
        in srgb,
        var(--datos-team-accent) 22%,
        rgba(255,255,255,0.06)
      ) 0%,
      rgba(255,255,255,0.06) 100%
    );

  box-shadow: 0 8px 18px rgba(0,0,0,0.18);
}

.datos-team-nav-btn.is-active {
  transform: translateY(-1px);

  border-color: color-mix(
    in srgb,
    var(--datos-team-accent) 85%,
    rgba(255,255,255,0.40)
  );

  background:
    linear-gradient(
      180deg,
      color-mix(
        in srgb,
        var(--datos-team-accent) 32%,
        rgba(255,255,255,0.08)
      ) 0%,
      rgba(255,255,255,0.08) 100%
    );

  box-shadow:
    0 0 0 1px rgba(255,255,255,0.05),
    0 0 22px color-mix(
      in srgb,
      var(--datos-team-accent) 30%,
      transparent
    );
}

.datos-team-nav-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;

  display: block;
  border-radius: 999px;

  filter: drop-shadow(0 3px 5px rgba(0,0,0,0.28));
}

.datos-team-nav-initials {
  width: 40px;
  height: 40px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  border-radius: 999px;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.12);

  font-size: 13px;
  font-weight: 850;
  color: white;
}

/* Tooltip visual con nombre del equipo */
.datos-team-nav-btn::after {
  content: attr(data-team-name);

  position: absolute;
  left: 50%;
  bottom: calc(100% + 9px);
  transform: translateX(-50%) translateY(4px);

  max-width: 260px;
  padding: 7px 10px;

  border-radius: 10px;
  background: rgba(5,8,12,0.96);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 10px 24px rgba(0,0,0,0.28);

  color: white;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;

  opacity: 0;
  pointer-events: none;
  z-index: 80;

  transition:
    opacity .16s ease,
    transform .16s ease;
}

.datos-team-nav-btn:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* =========================================================
   Responsive medio
   ========================================================= */

@media (max-width: 1100px) {
  .datos-team-combined-nav-shell {
    grid-template-columns: minmax(180px, 260px) minmax(0, 1fr) 160px;
    gap: 10px;
  }

  .datos-team-group-dropdown {
    width: 155px;
    min-width: 155px;
    max-width: 155px;
  }

  .datos-team-nav-btn {
    width: 52px;
    height: 52px;
    min-width: 52px;
    border-radius: 16px;
  }

  .datos-team-nav-logo,
  .datos-team-nav-initials {
    width: 37px;
    height: 37px;
  }
}

/* =========================================================
   Responsive móvil
   En móvil:
   fila 1: liga izquierda + dropdown derecha
   fila 2: equipos debajo
   ========================================================= */

@media (max-width: 768px) {
  .datos-team-combined-nav-shell {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "league group"
      "teams teams";

    height: auto;
    min-height: 0;
    max-height: none;

    gap: 10px 10px;
    padding: 10px;
    align-items: center;
  }

  .datos-team-combined-left {
    grid-area: league;
    min-width: 0;
    width: 100%;
  }

  .datos-team-combined-right {
    grid-area: group;
    min-width: 0;

    display: flex;
    align-items: center;
    justify-content: flex-end;
  }

  .datos-team-combined-center {
    grid-area: teams;
    min-width: 0;
    width: 100%;

    display: flex;
    align-items: center;
    justify-content: center;
  }

  .datos-team-combined-league-head {
    min-width: 0;
    width: 100%;
  }

  .datos-team-combined-league-icon,
  .datos-team-combined-league-icon-fallback {
    width: 34px;
    height: 34px;
  }

  .datos-team-combined-league-title {
    font-size: 15px;
    line-height: 1.12;

    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;

    white-space: normal;
    overflow: hidden;
  }

  .datos-team-combined-league-subtitle {
    font-size: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .datos-team-group-dropdown {
    width: 150px;
    min-width: 150px;
    max-width: 150px;
  }

  .datos-team-combined-teams-scroll {
    height: 66px;
    min-height: 66px;
    max-height: 66px;

    padding: 4px 2px 10px;
  }

  .datos-team-combined-team-strip {
    justify-content: flex-start !important;
    min-width: max-content !important;
    width: max-content !important;
    margin: 0 !important;
  }

  .datos-team-nav-strip {
    gap: 9px;
  }

  .datos-team-nav-btn {
    width: 50px;
    height: 50px;
    min-width: 50px;
    border-radius: 15px;
  }

  .datos-team-nav-logo,
  .datos-team-nav-initials {
    width: 35px;
    height: 35px;
  }
}

/* =========================================================
   Responsive móvil muy estrecho
   ========================================================= */

@media (max-width: 460px) {
  .datos-team-combined-nav-shell {
    grid-template-columns: minmax(0, 1fr) 132px;
    gap: 9px;
  }

  .datos-team-group-dropdown {
    width: 132px;
    min-width: 132px;
    max-width: 132px;
  }

  .datos-team-combined-league-title {
    font-size: 14px;
  }

  .datos-team-combined-league-subtitle {
    font-size: 9.5px;
  }
}
