/* =========================================================
   LWFG — Competition / Team Statistics
   ========================================================= */

.competition-team-stats {
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
}


/* =========================================================
   شبكة البطاقات
   ========================================================= */

.competition-team-stats__grid {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 16px;
}


/* =========================================================
   بطاقة الإحصائية
   ========================================================= */

.competition-team-stats__card,
.competition-team-stat-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    overflow: hidden;
}


/* =========================================================
   رأس البطاقة
   ========================================================= */

.competition-team-stat-card__header {
    min-height: 62px;

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

    gap: 12px;

    padding: 0 18px;

    background: #ffffff;

    border-bottom: 1px solid #f0f0f0;
}

.competition-team-stat-card__header h3 {
    margin: 0;

    color: #111827;

    font-size: 14px;
    font-weight: 500;

    line-height: 1.4;
}

.competition-team-stat-card__all {
    flex: 0 0 auto;

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

    gap: 5px;

    color: #374151;

    font-size: 12px;
    font-weight: 500;

    text-decoration: none;

    white-space: nowrap;

    transition: color .2s ease;
}

.competition-team-stat-card__all:hover {
    color: #006633;
}

.competition-team-stat-card__all span {
    font-size: 18px;
    line-height: 1;
}


/* =========================================================
   قائمة الفرق داخل البطاقة
   ========================================================= */

.competition-team-stat-card__list {
    padding: 4px 18px 8px;
}

.competition-team-stat-item {
    min-height: 64px;

    display: grid;

    grid-template-columns:
        22px
        minmax(0, 1fr)
        48px;

    align-items: center;

    column-gap: 8px;

    direction: rtl;

    border-bottom: 1px solid #f1f1f1;
}

.competition-team-stat-item:last-child {
    border-bottom: 0;
}


/* =========================================================
   الترتيب
   ========================================================= */

.competition-team-stat-item__rank {
    color: #111827;

    font-size: 12px;
    font-weight: 600;

    text-align: center;
}


/* =========================================================
   الفريق
   ========================================================= */

.competition-team-stat-item__team {
    min-width: 0;

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

    gap: 8px;
    direction: rtl;

    color: #111827;
    font-size: 13px;
    font-weight: 500;

    text-decoration: none;
}

.competition-team-stat-item__team span {
    min-width: 0;

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

    text-decoration: none;
}

.competition-team-stat-item__team:hover span {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.competition-team-stat-item__team img {
    width: 32px;
    height: 32px;

    flex: 0 0 32px;

    object-fit: contain;
}


/* =========================================================
   القيمة
   ========================================================= */

.competition-team-stat-item__value {
    color: #111827;

    font-size: 13px;
    font-weight: 700;

    text-align: center;
}


/* =========================================================
   صفحة مشاهدة الجميع
   ========================================================= */

.competition-team-stats__top {
    display: flex;
    align-items: center;
    gap: 12px;

    width: 100%;
    min-height: 64px;

    margin-bottom: 16px;
    padding: 0 18px;

    background: #ffffff;

    border: 1px solid #e5e7eb;
    border-radius: 16px;

    box-sizing: border-box;
}

.competition-team-stats__top h2 {
    margin: 0;

    font-size: 15px !important;
    font-weight: 300 !important;

    color: #111827;
}

.competition-team-stats__top-arrow {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 32px;
    height: 32px;

    flex: 0 0 32px;

    border-radius: 50%;

    background: #f3f4f6;

    color: #111827;
    text-decoration: none;

    font-size: 24px;
    line-height: 1;

    transition: background-color 0.2s ease;
}

.competition-team-stats__top-arrow:hover {
    background: #e5e7eb;
    color: #111827;
    text-decoration: none;
}

.competition-team-stats__top h2 {
    margin: 0;

    font-size: 18px;
    font-weight: 700;

    color: #111827;
}




/* =========================================================
   الفلتر
   ========================================================= */

.competition-team-stats__filter {
    display: flex;
    align-items: center;
    justify-content: flex-start;

    padding: 12px 18px;

    background: #ffffff;

    border: 0;
    border-radius: 0;

    box-sizing: border-box;
}

.competition-team-stats__filter label {
    color: #374151;

    font-size: 13px;
    font-weight: 500;
}

.competition-team-stats__filter select {
    width: auto;
    min-width: 210px;
    min-height: 42px;

    padding: 0 14px;

    border: 1px solid #e5e7eb !important;
    border-radius: 10px !important;

    background-color: #fff;

    color: #111827;

    font-family: inherit;
    font-size: 13px;
    font-weight: 500;

    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;

    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23111111' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");

    background-repeat: no-repeat;
    background-position: left 14px center;
    background-size: 12px 12px;

    cursor: pointer;
    box-sizing: border-box;
}

.competition-team-stats__filter select:focus {
    outline: none;

    box-shadow:
        0 0 0 3px
        rgba(0, 102, 51, .15);
}


/* =========================================================
   القائمة الكاملة
   ========================================================= */

.competition-team-stat-list {
    background: #ffffff;

    border: 0;
    border-radius: 0;

    overflow: hidden;
}

.competition-team-stat-row {
    min-height: 68px;

    display: grid;

    grid-template-columns:
        70px
        minmax(0, 1fr)
        40px;

    align-items: center;

    gap: 10px;

    padding: 0 20px;

    direction: rtl;

    border-bottom: 1px solid #f1f1f1;
}

.competition-team-stat-row:last-child {
    border-bottom: 0;
}

.competition-team-stat-rank {
    color: #111827;

    font-size: 13px;
    font-weight: 600;

    text-align: center;
}

.competition-team-stat-team {
    width: max-content;
    max-width: 420px;
    min-width: 0;

    display: flex;
    align-items: center;

    justify-content: flex-start;

    gap: 10px;

    direction: rtl;

    color: #111827;

    font-size: 14px;
    font-weight: 500;

    text-decoration: none;
}



.competition-team-stat-team span {
    min-width: 0;

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

.competition-team-stat-team img {
    width: 38px;
    height: 38px;

    flex: 0 0 38px;

    object-fit: contain;
}

.competition-team-stat-value {
    color: #111827;

    font-size: 17px;
    font-weight: 500;

    text-align: center;
}


/* =========================================================
   حالة عدم وجود بيانات
   ========================================================= */

.competition-teams-empty {
    padding: 30px 20px;

    color: #6b7280;

    font-size: 14px;

    text-align: center;
}


/* =========================================================
   Mobile
   ========================================================= */

@media (max-width: 900px) {

    .competition-team-stats__grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

}


@media (max-width: 650px) {

.competition-team-stats__grid {
    grid-template-columns: 1fr;

    gap: 12px;

    padding-inline: 12px;
    box-sizing: border-box;
}


    .competition-team-stat-card__header {
        min-height: 58px;

        padding: 0 14px;
    }

    .competition-team-stat-card__header h3 {
        font-size: 13px;
    }

    .competition-team-stat-card__list {
        padding-left: 14px;
        padding-right: 14px;
    }

    .competition-team-stat-item {
        min-height: 60px;
    }

    .competition-team-stats__filter {
        align-items: stretch;
        flex-direction: column;
    }

    .competition-team-stats__filter select {
        width: 100%;
        min-width: 0;
    }

    .competition-team-stat-row {
        grid-template-columns:
            32px
            minmax(0, 1fr)
            55px;

        padding: 0 12px;
    }

    .competition-team-stats__list {
    margin-inline: 12px;
    box-sizing: border-box;
}

    .competition-team-stats__top {
        margin-inline: 12px;
        width: auto;
        box-sizing: border-box;
    }

}

.competition-team-stats__list {
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
}

.competition-team-stat-team {
    text-decoration: none;
}

.competition-team-stat-team > span {
    text-decoration: none;
}

.competition-team-stat-team:hover > span {
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* =========================================================
   French — Team Statistics
   ========================================================= */

.competition-team-stats--fr {
    direction: ltr;
}

.competition-team-stats--fr .competition-team-stat-item {
    direction: ltr;
}

.competition-team-stats--fr .competition-team-stat-item__team {
    direction: ltr;
}

.competition-team-stats--fr .competition-team-stat-row {
    direction: ltr;
}

.competition-team-stats--fr .competition-team-stat-team {
    direction: ltr;
}

.competition-team-stats--fr .competition-team-stats__filter {
    direction: ltr;
}

.competition-team-stats--fr .competition-team-stats__top {
    direction: ltr;
}

.competition-team-stats--fr .competition-team-stat-card__header {
    direction: ltr;
}

/* French — filter arrow */

.competition-team-stats--fr .competition-team-stats__filter select {
    direction: ltr;
    background-position: right 14px center;
    padding-left: 14px;
    padding-right: 40px;
}

.competition-team-stats {
    position: relative;
}

.competition-team-stats.is-loading::after {
    content: "";
    position: absolute;
    inset: 0;
    background: #fff;
    opacity: .65;
    pointer-events: none;
    z-index: 20;
    animation: competitionTeamStatsLoading .45s ease-in-out infinite alternate;
}

@keyframes competitionTeamStatsLoading {

    from {
        opacity: .45;
    }

    to {
        opacity: .75;
    }

}