/*
|--------------------------------------------------------------------------
| Team - Matches Tab
|--------------------------------------------------------------------------
*/

.team-matches-page {
    display: grid;
    grid-template-columns: minmax(280px, 0.75fr) minmax(0, 1.8fr);
    gap: 16px;
    align-items: start;
    direction: ltr;
}


/*
|--------------------------------------------------------------------------
| الأعمدة
|--------------------------------------------------------------------------
*/

.team-matches-page__next,
.team-matches-page__list {
    min-width: 0;
    direction: rtl;
}


/*
|--------------------------------------------------------------------------
| بطاقة المباراة القادمة
|--------------------------------------------------------------------------
*/

.team-next-match-card {
    overflow: hidden;
}

.team-next-match-card .team-overview-card__header {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 18px;
    box-sizing: border-box;
}

.team-next-match-card__header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.team-next-match-card__header h2 {
    margin: 0;
    font-size: 12px;
    font-weight: 300;
}

/*
|--------------------------------------------------------------------------
| المباراة القادمة
|--------------------------------------------------------------------------
*/

.team-next-match-card__match {
    display: block;
    text-decoration: none;
    color: inherit;
    padding: 14px 16px 18px;
    box-sizing: border-box;
}

/* =========================================================
   اسم المنافسة + تاريخ المباراة
   ========================================================= */

.team-next-match-card__meta {
    display: flex;
    flex-direction: column;

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

    gap: 4px;

    margin-bottom: 14px;

    font-size: 15px;

    text-align: center;
}


/* اسم المنافسة والفئة */

.team-next-match-card__competition {
    order: 1;

    color: #555;

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

    text-align: center;

    line-height: 1.4;
}

.team-next-match-card__competition {
    text-decoration: none;
    cursor: pointer;
}

.team-next-match-card__competition:hover {
    text-decoration: underline;
}

/* تاريخ المباراة */

.team-next-match-card__date {
    order: 2;

    color: #6b7280;

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

    text-align: center;

    line-height: 1.4;
}


/*
|--------------------------------------------------------------------------
| فرق المباراة القادمة
|--------------------------------------------------------------------------
*/

.team-next-match-card__main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    direction: ltr;
}

.team-next-match-card__team {
    display: flex;
     flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 0;
    font-size: 12px;
    font-weight: 500;
    direction: ltr;
}

.team-next-match-card__team span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.team-next-match-card__team img {
    width: 42px;
    height: 42px;
    object-fit: contain;
    flex: 0 0 42px;
}

.team-next-match-card__team--home {
    justify-content: flex-end;
    text-align: right;
}

.team-next-match-card__team--away {
    justify-content: flex-start;
    text-align: left;
}

.team-next-match-card__time {
    width: 38px;
    height: 38px;
    border-radius: 50%;
   
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 500;
    color: #555;
    direction: rtl;
}


/*
|--------------------------------------------------------------------------
| بطاقة المباريات
|--------------------------------------------------------------------------
*/

.team-matches-list-card {
    overflow: hidden;
}

.team-matches-list-card .team-matches-card__navigation {
    min-height: 58px;
    box-sizing: border-box;
}

/*
|--------------------------------------------------------------------------
| قائمة المباريات
|--------------------------------------------------------------------------
*/

.team-matches-list {
    width: 100%;
}

.team-matches-list__match {
    display: block;
    text-decoration: none;
    color: inherit;
    border-top: 1px solid #eeeeee;
    padding: 14px 18px;
    box-sizing: border-box;
    transition: background-color 0.15s ease;
}

.team-matches-list__match:hover {
    background: #fafafa;
}


/*
|--------------------------------------------------------------------------
| التاريخ + المنافسة
|--------------------------------------------------------------------------
*/

.team-matches-list__date {
    display: inline-block;
    color: #777;
    font-size: 13px;
    line-height: 1.4;
}

.team-matches-list__competition {
    float: left;
    color: #777;
    font-size: 13px;
    line-height: 1.4;
}


/*
|--------------------------------------------------------------------------
| تنظيف الـ float
|--------------------------------------------------------------------------
*/

.team-matches-list__match::after {
    content: "";
    display: table;
    clear: both;
}


/*
|--------------------------------------------------------------------------
| الفرق والوقت
|--------------------------------------------------------------------------
*/

.team-matches-list__main {
    clear: both;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 60px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    direction: ltr;
}

.team-matches-list__team {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    font-size: 14px;
    font-weight: 500;
    direction: ltr;
}

.team-matches-list__team span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.team-matches-list__team img {
    width: 38px;
    height: 38px;
    object-fit: contain;
    flex: 0 0 38px;
}

.team-matches-list__team--home {
    justify-content: flex-end;
    text-align: right;
}

.team-matches-list__team--away {
    justify-content: flex-start;
    text-align: left;
}

.team-matches-list__time {
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
}


/*
|--------------------------------------------------------------------------
| حالة عدم وجود مباريات
|--------------------------------------------------------------------------
*/

.team-matches-page__empty {
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    color: #a0a0a0;
    font-size: 14px;
    text-align: center;
}


/*
|--------------------------------------------------------------------------
| Responsive
|--------------------------------------------------------------------------
*/

@media (max-width: 900px) {

    .team-matches-page {
        grid-template-columns: 1fr;
    }

    .team-matches-page__next {
        order: 1;
    }

    .team-matches-page__list {
        order: 2;
    }

}


@media (max-width: 600px) {

    .team-next-match-card__main {
        grid-template-columns: minmax(0, 1fr) 40px minmax(0, 1fr);
        gap: 5px;
    }

    .team-next-match-card__team {
        font-size: 13px;
    }

    .team-next-match-card__team img {
        width: 36px;
        height: 36px;
        flex-basis: 36px;
    }

    .team-matches-list__main {
        grid-template-columns: minmax(0, 1fr) 50px minmax(0, 1fr);
        gap: 5px;
    }

    .team-matches-list__team {
        font-size: 13px;
    }

    .team-matches-list__team img {
        width: 34px;
        height: 34px;
        flex-basis: 34px;
    }

}

/* =========================================================
   إحصائيات المباراة القادمة
   ========================================================= */

.team-next-match-card__stats {
    width: 100%;

    display: flex;
    flex-direction: column;

    margin-top: 16px;

    border-top: 1px solid #eef0f2;
}


/* السطر */

.team-next-match-card__stat {
    width: 100%;

    display: grid;

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

    align-items: center;

    min-height: 52px;

    border-bottom: 1px solid #eef0f2;

    direction: ltr;
}


/* الأرقام */

.team-next-match-card__stat strong {
    display: flex;

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

    min-width: 34px;
    min-height: 24px;

    padding: 2px 6px;

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

    color: #111827;

    white-space: nowrap;
}


/* الرقم */

.team-next-match-card__stat strong:first-child {
    justify-self: center;
}


/* الرقم الثاني */

.team-next-match-card__stat strong:last-child {
    justify-self: center;
}


/* اسم الإحصائية */

.team-next-match-card__stat span {
    min-width: 0;

    text-align: center;

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

    color: #6b7280;

    line-height: 1.4;

    direction: rtl;
}


/* آخر سطر */

.team-next-match-card__stat:last-child {
    border-bottom: 0;
}


/* =========================================================
   الهاتف
   ========================================================= */

@media (max-width: 600px) {

    .team-next-match-card__stats {
        margin-top: 14px;
    }

    .team-next-match-card__stat {
        grid-template-columns:
            48px
            minmax(0, 1fr)
            48px;

        min-height: 48px;
    }

    .team-next-match-card__stat strong {
        font-size: 11px;
    }

    .team-next-match-card__stat span {
        font-size: 11px;
    }

}

/* =========================================================
   MATCHES CARD — LOADING TRANSITION
========================================================= */

.team-matches-list-card {
    position: relative;
}

.team-matches-list-card.is-loading::after {
    content: "";
    position: absolute;
    inset: 0;

    background: #ffffff;
    opacity: 0.65;

    pointer-events: none;

    z-index: 20;

    animation: teamMatchesLoading 0.45s ease-in-out infinite alternate;
}

@keyframes teamMatchesLoading {
    from {
        opacity: 0.45;
    }

    to {
        opacity: 0.75;
    }
}

/*
=========================================================
   Matches — Season Filter
=========================================================
*/

.team-matches-card__heading {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 16px;
    box-sizing: border-box;
}

.team-matches-card__heading h2 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
}

.team-season-filter-form {
    width: 125px;
    margin: 0;
}

.team-season-filter {
    width: 125px;
    min-height: 36px;

    padding: 0 10px;

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

    background-color: #ffffff;
    color: #111827;

    font-family: inherit;
    font-size: 11px;
    font-weight: 600;

    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='%236b7280' 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 9px center;
    background-size: 12px;

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

.team-season-filter:hover,
.team-season-filter:focus {
    border-color: #0b6b3a;
}

.team-matches-card__heading {
    justify-content: center;
    flex-direction: column;
    gap: 10px;
}

/* =========================================================
   French — Team Matches
   ========================================================= */

.team-matches-page--fr {
    direction: ltr;
}

.team-matches-page--fr .team-matches-page__next,
.team-matches-page--fr .team-matches-page__list {
    direction: ltr;
}

/* المباراة القادمة */

.team-matches-page--fr .team-next-match-card {
    direction: ltr;
}

.team-matches-page--fr .team-next-match-card__header {
    direction: ltr;
    text-align: left;
}

.team-matches-page--fr .team-next-match-card__competition {
    direction: ltr;
    text-align: right;
}

.team-matches-page--fr .team-next-match-card__meta {
    direction: ltr;
}

.team-matches-page--fr .team-next-match-card__date {
    direction: ltr;
    text-align: center;
}

.team-matches-page--fr .team-next-match-card__main {
    direction: ltr;
}

.team-matches-page--fr .team-next-match-card__team {
    direction: ltr;
    text-align: center;
}

.team-matches-page--fr .team-next-match-card__stats {
    direction: ltr;
}

.team-matches-page--fr .team-next-match-card__stat {
    direction: ltr;
}

.team-matches-page--fr .team-next-match-card__stat span {
    direction: ltr;
    text-align: center;
}


/* قائمة المباريات */

.team-matches-page--fr .team-matches-list-card {
    direction: ltr;
}

.team-matches-page--fr .team-matches-card__navigation {
    direction: ltr;
}

.team-matches-page--fr .team-matches-card__heading {
    direction: ltr;
}

.team-matches-page--fr .team-season-filter-form {
    direction: ltr;
}

.team-matches-page--fr .team-season-filter {
    direction: ltr;
    text-align: left;
    background-position: right 9px center;
    padding-left: 10px;
    padding-right: 28px;
}

.team-matches-page--fr .team-matches-list {
    direction: ltr;
}

.team-matches-page--fr .team-matches-list__match {
    direction: ltr;
}

.team-matches-page--fr .team-matches-list__date {
    direction: ltr;
    text-align: left;
}

.team-matches-page--fr .team-matches-list__competition {
    direction: ltr;
    text-align: right;
    float: right;
}

.team-matches-page--fr .team-matches-list__main {
    direction: ltr;
}

.team-matches-page--fr .team-matches-list__team {
    direction: ltr;
}

.team-matches-page--fr .team-matches-list__time {
    direction: ltr;
}

.team-matches-page--fr .team-matches-page__empty {
    direction: ltr;
    text-align: center;
}


/* أسهم التنقل */

.team-matches-page--fr .team-matches-card__arrow:first-child {
    right: auto;
    left: 12px;
}

.team-matches-page--fr .team-matches-card__arrow:last-child {
    left: auto;
    right: 12px;
}