/* =========================================================
   DATOS · INDEX LIGAS · CARDS + GRUPOS + HOVER PORTAL
   NUEVAS CLASES AISLADAS:
   .datos-index-league-nav-card*
   ========================================================= */


/* =========================================================
   CARD EXTERIOR
   ========================================================= */

.datos-index-league-nav-card {
    position: relative;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    color: white;
    overflow: visible;
}

.datos-index-league-nav-card,
.datos-index-league-nav-card * {
    box-sizing: border-box;
}

.datos-index-league-nav-card__shell {
    position: relative;
    width: 100%;
    min-width: 0;
    overflow: visible;
}


/* =========================================================
   CARD INTERIOR
   ========================================================= */

.datos-index-league-nav-card__inner {
    position: relative;

    width: 100%;
    min-width: 0;

    display: grid;
    grid-template-columns: 68px minmax(0, 1fr);
    grid-template-areas:
        "icon content"
        "icon meta"
        "groups groups";

    align-items: center;

    column-gap: 12px;
    row-gap: 6px;

    min-height: 86px;
    height: auto;

    padding: 10px 12px;

    border-radius: 15px;
    border: 1px solid rgba(255,255,255,0.105);

    background:
        linear-gradient(
            135deg,
            var(--datos-index-league-soft, rgba(255,255,255,0.08)) 0%,
            rgba(255,255,255,0.045) 52%,
            rgba(0,0,0,0.08) 100%
        );

    box-shadow:
        inset 0 0 0 1px rgba(255,255,255,0.025),
        0 8px 18px rgba(0,0,0,0.14);

    overflow: hidden;

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

.datos-index-league-nav-card:hover .datos-index-league-nav-card__inner {
    transform: translateY(-1px);

    border-color: var(--datos-index-league-accent, rgba(255,255,255,0.28));

    background:
        linear-gradient(
            135deg,
            var(--datos-index-league-soft, rgba(255,255,255,0.13)) 0%,
            rgba(255,255,255,0.06) 52%,
            rgba(0,0,0,0.05) 100%
        );

    box-shadow:
        inset 0 0 0 1px rgba(255,255,255,0.035),
        0 12px 26px rgba(0,0,0,0.22);
}

.datos-index-league-nav-card--groups-open .datos-index-league-nav-card__inner {
    border-color: var(--datos-index-league-accent, rgba(255,255,255,0.30));
}


/* =========================================================
   BOTÓN PRINCIPAL DE ABRIR LIGA
   ========================================================= */

.datos-index-league-nav-card__open-btn {
    appearance: none;
    -webkit-appearance: none;

    position: absolute;
    inset: 0;
    z-index: 5;

    width: 100%;
    height: 100%;

    display: block;

    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 15px;

    background: transparent;
    color: inherit;

    text-align: left;
    cursor: pointer;
}

.datos-index-league-nav-card__open-btn:focus {
    outline: none;
}

.datos-index-league-nav-card__open-btn:focus-visible {
    outline: 2px solid var(--datos-index-league-accent, rgba(255,255,255,0.40));
    outline-offset: 2px;
}


/* =========================================================
   COMPATIBILIDAD ESTRUCTURA ANTIGUA SI ALGÚN HTML LA MANTIENE
   Pero con nombres nuevos, sin tocar .datos-league-card*
   ========================================================= */

.datos-index-league-nav-card__top-row,
.datos-index-league-nav-card__left {
    display: contents;
}

.datos-index-league-nav-card__text {
    grid-area: content;

    min-width: 0;
    width: 100%;

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

    gap: 2px;

    position: relative;
    z-index: 10;

    padding: 0;
    margin: 0;
}


/* =========================================================
   ESTRUCTURA NUEVA
   .datos-index-league-nav-card__content contiene título + subtítulo
   ========================================================= */

.datos-index-league-nav-card__content {
    grid-area: content;

    min-width: 0;
    width: 100%;

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

    gap: 2px;

    position: relative;
    z-index: 10;

    padding: 0;
    margin: 0;

    pointer-events: none;
}


/* =========================================================
   LOGO / ESCUDO
   ========================================================= */

.datos-index-league-nav-card__icon,
.datos-index-league-nav-card__icon-fallback {
    grid-area: icon;

    width: 60px;
    height: 60px;
    min-width: 60px;

    justify-self: center;
    align-self: center;

    object-fit: contain;

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

    margin: 0;
    padding: 0;

    border-radius: 999px;

    pointer-events: none;

    position: relative;
    z-index: 10;

    filter:
        drop-shadow(0 7px 12px rgba(0,0,0,0.40))
        drop-shadow(0 0 10px var(--datos-index-league-soft, rgba(255,255,255,0.16)));
}

.datos-index-league-nav-card__icon-fallback {
    background: rgba(255,255,255,0.055);
    border: 1px solid rgba(255,255,255,0.10);
    font-size: 24px;
}


/* =========================================================
   TEXTO
   ========================================================= */

.datos-index-league-nav-card__title {
    max-width: 100%;
    min-width: 0;

    font-size: 16.4px;
    font-weight: 950;
    line-height: 1.04;
    letter-spacing: -0.28px;

    color: rgba(255,255,255,0.99);

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

    pointer-events: none;
}

.datos-index-league-nav-card__subtitle {
    max-width: 100%;
    min-width: 0;

    margin-top: 2px;

    font-size: 10.8px;
    font-weight: 760;
    line-height: 1.16;

    color: rgba(255,255,255,0.66);

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

    pointer-events: none;
}

.datos-index-league-nav-card__arrow {
    display: none !important;
}


/* =========================================================
   LÍNEA DEBAJO DEL TÍTULO: CHIP GRUPOS + FEDERACIÓN + TIPO
   ========================================================= */

.datos-index-league-nav-card__meta-line {
    grid-area: meta;

    width: 100%;
    min-width: 0;

    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;

    gap: 6px 8px;

    padding-left: 0;
    margin-top: 0;

    min-height: 22px;

    position: relative;
    z-index: 40;

    pointer-events: auto;
}


/* Chip de grupos */

.datos-index-league-nav-card__groups-chip {
    appearance: none;
    -webkit-appearance: none;

    flex: 0 0 auto;

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

    min-height: 20px;
    max-width: none;

    margin: 0;
    padding: 4px 8px;

    border-radius: 999px;
    border: 1px solid var(--datos-index-league-accent, rgba(255,255,255,0.22));

    background:
        linear-gradient(
            180deg,
            var(--datos-index-league-soft, rgba(255,255,255,0.12)) 0%,
            rgba(255,255,255,0.050) 100%
        );

    color: rgba(255,255,255,0.92);

    font-size: 9.8px;
    font-weight: 900;
    line-height: 1;

    text-align: center;
    white-space: nowrap;

    cursor: pointer;

    position: relative;
    z-index: 50;

    pointer-events: auto;

    box-shadow:
        inset 0 0 0 1px rgba(255,255,255,0.025),
        0 3px 8px rgba(0,0,0,0.13);

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

.datos-index-league-nav-card__groups-chip::before {
    content: "";

    width: 5px;
    height: 5px;

    margin-right: 5px;

    border-radius: 999px;

    background: var(--datos-index-league-accent, rgba(255,255,255,0.55));
    box-shadow: 0 0 8px var(--datos-index-league-accent, rgba(255,255,255,0.25));
}

.datos-index-league-nav-card__groups-chip:hover {
    transform: translateY(-1px);

    color: white;

    background:
        linear-gradient(
            180deg,
            var(--datos-index-league-soft, rgba(255,255,255,0.18)) 0%,
            rgba(255,255,255,0.075) 100%
        );

    border-color: var(--datos-index-league-accent, rgba(255,255,255,0.38));

    box-shadow:
        inset 0 0 0 1px rgba(255,255,255,0.04),
        0 7px 15px rgba(0,0,0,0.22);
}

.datos-index-league-nav-card__groups-chip--open {
    color: white;

    background:
        linear-gradient(
            180deg,
            var(--datos-index-league-soft, rgba(255,255,255,0.22)) 0%,
            rgba(255,255,255,0.09) 100%
        );

    border-color: var(--datos-index-league-accent, rgba(255,255,255,0.46));
}

.datos-index-league-nav-card__groups-chip:focus {
    outline: none;
}

.datos-index-league-nav-card__groups-chip:focus-visible {
    outline: 2px solid var(--datos-index-league-accent, rgba(255,255,255,0.42));
    outline-offset: 2px;
}


/* Federación / modalidad */

.datos-index-league-nav-card__meta-fed {
    flex: 0 1 auto;
    min-width: 0;

    color: rgba(255,255,255,0.74);

    font-size: 10.4px;
    font-weight: 820;
    line-height: 1.05;
    text-align: left;

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

    pointer-events: none;
}


/* =========================================================
   PANEL DESPLEGABLE DE GRUPOS
   Siempre debajo de toda la tarjeta
   ========================================================= */

.datos-index-league-nav-card__groups-panel {
    grid-area: groups;

    width: 100%;
    min-width: 0;

    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;

    gap: 6px;

    margin-top: 4px;
    padding: 9px;

    border-radius: 13px;
    border: 1px solid rgba(255,255,255,0.075);

    background:
        linear-gradient(
            180deg,
            rgba(0,0,0,0.14) 0%,
            rgba(255,255,255,0.036) 100%
        );

    box-shadow:
        inset 0 0 0 1px rgba(255,255,255,0.018);

    overflow: hidden;

    position: relative;
    z-index: 40;

    pointer-events: auto;
}

.datos-index-league-nav-card__group-pill {
    appearance: none;
    -webkit-appearance: none;

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

    min-height: 24px;
    max-width: 100%;

    margin: 0;
    padding: 5px 9px;

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

    background: rgba(255,255,255,0.045);

    color: rgba(255,255,255,0.82);

    font-size: 10.3px;
    font-weight: 830;
    line-height: 1;

    text-align: center;
    white-space: nowrap;

    cursor: pointer;

    position: relative;
    z-index: 50;

    pointer-events: auto;

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

.datos-index-league-nav-card__group-pill:hover {
    transform: translateY(-1px);

    color: white;
    border-color: var(--datos-index-league-accent, rgba(255,255,255,0.30));

    background:
        linear-gradient(
            180deg,
            var(--datos-index-league-soft, rgba(255,255,255,0.13)) 0%,
            rgba(255,255,255,0.065) 100%
        );

    box-shadow: 0 7px 16px rgba(0,0,0,0.22);
}

.datos-index-league-nav-card__group-pill:focus {
    outline: none;
}

.datos-index-league-nav-card__group-pill:focus-visible {
    outline: 2px solid var(--datos-index-league-accent, rgba(255,255,255,0.40));
    outline-offset: 2px;
}

.datos-index-league-nav-card__groups-empty {
    width: 100%;
    padding: 5px 2px;

    color: rgba(255,255,255,0.58);
    font-size: 10px;
    font-weight: 750;
    text-align: center;
}


/* =========================================================
   HOVER CARD ANTIGUA INLINE
   Compatibilidad, aunque ahora uses portal.
   También aislada con nombres nuevos.
   ========================================================= */

.datos-index-league-nav-hover-card {
    position: absolute;
    left: 0;
    bottom: calc(100% + 10px);

    width: 360px;
    max-width: 420px;

    padding: 14px;
    border-radius: 18px;

    background: rgba(12, 16, 24, 0.96);
    border: 1px solid rgba(255,255,255,0.16);
    box-shadow: 0 18px 45px rgba(0,0,0,0.45);
    backdrop-filter: blur(12px);

    color: white;
    z-index: 9999;

    opacity: 0;
    transform: translateY(8px) scale(0.98);

    pointer-events: none;

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

.datos-index-league-nav-card:hover .datos-index-league-nav-hover-card {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.datos-index-league-nav-hover-card__header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.datos-index-league-nav-hover-card__icon {
    width: 54px;
    height: 54px;
    object-fit: contain;
    flex: 0 0 auto;
}

.datos-index-league-nav-hover-card__title {
    font-size: 16px;
    font-weight: 800;
    line-height: 1.15;
    white-space: normal;
}

.datos-index-league-nav-hover-card__subtitle {
    margin-top: 3px;
    font-size: 12px;
    opacity: 0.72;
    line-height: 1.25;
    white-space: normal;
}

.datos-index-league-nav-hover-card__body {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.datos-index-league-nav-hover-card__row {
    display: flex;
    justify-content: space-between;
    gap: 14px;

    font-size: 12px;
    padding: 6px 0;

    border-bottom: 1px solid rgba(255,255,255,0.07);
}

.datos-index-league-nav-hover-card__row span {
    opacity: 0.65;
}

.datos-index-league-nav-hover-card__row strong {
    text-align: right;
    font-weight: 800;
}

.datos-index-league-nav-hover-card__code {
    margin-top: 10px;
    font-size: 10px;
    opacity: 0.45;
    word-break: break-all;
}


/* =========================================================
   HOVER PORTAL ACTUAL
   Se mantiene el ID porque seguramente lo usa el JS.
   ========================================================= */

#datos-league-hover-portal {
    position: fixed;

    width: 360px;
    max-width: min(360px, calc(100vw - 24px));

    padding: 14px;
    border-radius: 18px;

    background: rgba(10, 14, 22, 0.97);
    border: 1px solid rgba(255,255,255,0.16);
    box-shadow: 0 22px 55px rgba(0,0,0,0.55);
    backdrop-filter: blur(14px);

    color: white;
    z-index: 999999;

    pointer-events: none !important;

    opacity: 0;
    transform: translateY(4px) scale(0.98);

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

#datos-league-hover-portal.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

#datos-league-hover-portal:not(.is-visible) {
    visibility: hidden;
    opacity: 0;
    left: -9999px;
    top: -9999px;
}

.datos-league-hover__header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.datos-league-hover__icon {
    width: 62px;
    height: 62px;
    object-fit: contain;
    flex: 0 0 auto;
}

.datos-league-hover__title {
    font-size: 16px;
    font-weight: 850;
    line-height: 1.15;
    white-space: normal;
}

.datos-league-hover__subtitle {
    margin-top: 4px;
    font-size: 12px;
    line-height: 1.3;
    opacity: 0.72;
    white-space: normal;
}

.datos-league-hover__body {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.datos-league-hover__row {
    display: flex;
    justify-content: space-between;
    gap: 14px;

    padding: 6px 0;
    border-bottom: 1px solid rgba(255,255,255,0.075);

    font-size: 12px;
}

.datos-league-hover__row span {
    opacity: 0.62;
}

.datos-league-hover__row strong {
    text-align: right;
    font-weight: 800;
}

.datos-league-hover__code {
    margin-top: 10px;
    font-size: 10px;
    opacity: 0.45;
    word-break: break-all;
}


/* =========================================================
   CAPAS OCULTAS / SEGURIDAD DE CLICKS
   ========================================================= */

.datos-view-layer.is-hidden,
.datos-view-layer.is-hidden * {
    pointer-events: none !important;
}

.datos-view-layer.is-hidden .datos-index-league-nav-card--has-hover,
.datos-view-layer.is-hidden .datos-index-league-nav-card--has-hover *,
.datos-view-layer.is-hidden .datos-index-league-nav-hover-card {
    pointer-events: none !important;
}


/* =========================================================
   RESPONSIVE / COLUMNAS MÁS ESTRECHAS
   ========================================================= */

@media (max-width: 1550px) {
    .datos-index-league-nav-card__inner {
        grid-template-columns: 62px minmax(0, 1fr);
        column-gap: 10px;

        min-height: 80px;
        padding: 9px 10px;

        border-radius: 14px;
    }

    .datos-index-league-nav-card__open-btn {
        border-radius: 14px;
    }

    .datos-index-league-nav-card__icon,
    .datos-index-league-nav-card__icon-fallback {
        width: 54px;
        height: 54px;
        min-width: 54px;
    }

    .datos-index-league-nav-card__title {
        font-size: 14.4px;
        line-height: 1.04;
    }

    .datos-index-league-nav-card__subtitle {
        font-size: 9.8px;
        line-height: 1.12;
    }

    .datos-index-league-nav-card__meta-line {
        gap: 5px 7px;
        min-height: 20px;
    }

    .datos-index-league-nav-card__groups-chip {
        font-size: 9px;
        padding: 3px 7px;
        min-height: 18px;
    }

    .datos-index-league-nav-card__groups-chip::before {
        width: 4px;
        height: 4px;
        margin-right: 5px;
    }

    .datos-index-league-nav-card__meta-fed {
        font-size: 9.7px;
    }

    .datos-index-league-nav-card__group-pill {
        font-size: 9.6px;
        min-height: 22px;
        padding: 5px 7px;
    }
}

@media (max-width: 1200px) {
    .datos-index-league-nav-card__inner {
        grid-template-columns: 58px minmax(0, 1fr);
        min-height: 76px;
    }

    .datos-index-league-nav-card__icon,
    .datos-index-league-nav-card__icon-fallback {
        width: 50px;
        height: 50px;
        min-width: 50px;
    }

    .datos-index-league-nav-card__title {
        font-size: 13.4px;
    }

    .datos-index-league-nav-card__subtitle {
        font-size: 9.4px;
    }

    .datos-index-league-nav-card__meta-line {
        align-items: flex-start;
        justify-content: flex-start;
        flex-direction: column;
        gap: 5px;
        margin-top: 0;
    }

    .datos-index-league-nav-card__meta-fed {
        width: 100%;
        text-align: left;
        white-space: normal;
        line-height: 1.18;
    }

    .datos-index-league-nav-card__groups-panel {
        margin-top: 6px;
    }
}


/* =========================================================
   SEGURIDAD FINAL DE CLICKS
   ========================================================= */

/* La zona interactiva de grupos siempre queda por encima del botón invisible */
.datos-index-league-nav-card__meta-line,
.datos-index-league-nav-card__groups-panel {
    position: relative;
    z-index: 40;
    pointer-events: auto;
}

.datos-index-league-nav-card__groups-chip,
.datos-index-league-nav-card__group-pill {
    position: relative;
    z-index: 50;
    pointer-events: auto;
}

/* El botón invisible de abrir liga queda por debajo de chips y panel */
.datos-index-league-nav-card__open-btn {
    z-index: 5;
}