/* =========================================================
   TEAM — UPCOMING MATCHES
   ========================================================= */

.team-upcoming-matches-card {
    width: 100%;
   
}

.team-upcoming-matches-list {
    width: 100%;
    display: flex;
    flex-direction: column;
}


/* =========================================================
   المباراة
   ========================================================= */

.team-upcoming-match {
    width: 100%;
    position: relative;

    display: flex;
    flex-direction: column;
    align-items: center;

    padding: 14px 16px 16px;

    text-decoration: none;
    color: inherit;

    border-bottom: 1px solid #eef0f2;

    transition:
        background-color 0.2s ease,
        box-shadow 0.2s ease;
}

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

.team-upcoming-match:hover {
    background: #f8faf9;
}


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

.team-upcoming-match__date {
    position: absolute;

    top: 14px;
    left: 16px;

    font-size: 12px;
    line-height: 1.4;

    color: #6b7280;

    white-space: nowrap;

    text-align: left;
    direction: rtl;
}

/* =========================================================
   اسم المنافسة
   ========================================================= */

.team-upcoming-match__competition {
    position: absolute;

    top: 14px;
    right: 16px;

    max-width: 50%;

    font-size: 12px;
    line-height: 1.4;

    color: #6b7280;

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

    text-align: right;
    direction: rtl;
}


/* =========================================================
   الفريقان + الوقت
   ========================================================= */

.team-upcoming-match__main {
    width: 100%;

    display: grid;

    grid-template-columns:
        minmax(0, 180px)
        58px
        minmax(0, 180px);

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

    column-gap: 8px;

    margin-top: 27px;
}


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

.team-upcoming-match__team {
    min-width: 0;

    display: flex;
    align-items: center;

    gap: 5px;

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

    line-height: 1.4;
}


.team-upcoming-match__team:first-child {
    justify-content: flex-end;
}

.team-upcoming-match__team:last-child {
    justify-content: flex-start;
}

.team-upcoming-match__team--home {
    transform: translateX(-8px);
}

.team-upcoming-match__team--away {
    transform: translateX(8px);
}


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

.team-upcoming-match__team span {
    min-width: 0;

    overflow: hidden;
    text-overflow: ellipsis;

    white-space: nowrap;
}


/* =========================================================
   شعارات الفرق
   ========================================================= */

.team-upcoming-match__team img {
    width: 38px !important;
    height: 38px !important;

    min-width: 38px !important;
    max-width: 38px !important;

    min-height: 38px !important;
    max-height: 38px !important;

    object-fit: contain;

    display: block;

    flex: 0 0 38px;
}


/* =========================================================
   الوقت
   ========================================================= */

.team-upcoming-match__time {
    width: 58px;
    min-width: 58px;

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

    text-align: center;

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

    color: #111827;

    white-space: nowrap;
}


/* =========================================================
   الملعب
   ========================================================= */

.team-upcoming-match__venue {
    display: none !important;
}

/* =========================================================
   سهم/مؤشر إن وجد
   ========================================================= */

.team-upcoming-match__venue::before {
    content: "📍";
    margin-left: 4px;
}


/* =========================================================
   الشاشات المتوسطة
   ========================================================= */

@media (max-width: 900px) {

    .team-upcoming-match {
        padding: 13px 14px;
    }

.team-upcoming-match__main {
    grid-template-columns:
        auto
        58px
        auto;

    justify-content: center;

    column-gap: 8px;
}

.team-upcoming-match__time {
    width: 58px;
    min-width: 58px;
}

    .team-upcoming-match__team img {
        width: 36px !important;
        height: 36px !important;

        min-width: 36px !important;
        max-width: 36px !important;

        min-height: 36px !important;
        max-height: 36px !important;

        flex-basis: 36px;
    }
}


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

@media (max-width: 600px) {

    .team-upcoming-match {
        padding: 13px 12px;

        grid-template-columns: 1fr 1fr;
    }

    .team-upcoming-match__competition,
    .team-upcoming-match__date {
        font-size: 10px;
    }

    .team-upcoming-match__main {
        grid-template-columns:
            minmax(0, 1fr)
            50px
            minmax(0, 1fr);

        gap: 6px;

        margin-top: 16px;
    }

    .team-upcoming-match__time {
        width: 50px;
        min-width: 50px;

        font-size: 12px;
    }

    .team-upcoming-match__team {
        font-size: 12px;

        gap: 6px;
    }

    .team-upcoming-match__team img {
        width: 32px !important;
        height: 32px !important;

        min-width: 32px !important;
        max-width: 32px !important;

        min-height: 32px !important;
        max-height: 32px !important;

        flex-basis: 32px;
    }

    .team-upcoming-match__venue {
        max-width: 100%;

        font-size: 10px;
    }
}

/* =========================================================
   Team Matches Card - Navigation Header
   ========================================================= */

.team-matches-card__navigation {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 58px;
    width: 100%;
}

.team-matches-card__navigation h2 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    line-height: 1;
}

.team-matches-card__arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);

    width: 32px;
    height: 32px;

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

    border-radius: 50%;
    text-decoration: none;

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

    color: #222;
    background: #f1f3f5;

    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease;
}

.team-matches-card__arrow:hover {
    background: #0b6b3a;
    color: #fff;
}

/* السابق — أقصى اليمين */
.team-matches-card__arrow:first-child {
    right: 12px;
}

/* القادم — أقصى اليسار */
.team-matches-card__arrow:last-child {
    left: 12px;
}

/* =========================================================
   Matches Navigation - Final Adjustments
   ========================================================= */

.team-upcoming-matches-card .team-overview-card__header {
    padding: 0 16px;
}

.team-matches-card__navigation {
    position: relative;
    width: 100%;
    height: 48px;
    min-height: 48px;

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

.team-matches-card__navigation h2 {
    margin: 0;
    padding: 0;

    font-size: 15px;
    font-weight: 600;
    line-height: 48px;
}

.team-matches-card__arrow {
    position: absolute;

    top: 50%;
    transform: translateY(-50%);

    width: 32px;
    height: 32px;

    padding: 0;
    margin: 0;

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

    border-radius: 50%;

    font-family: Arial, sans-serif;
    font-size: 21px;
    font-weight: 400;
    line-height: 32px;

    text-decoration: none;

    color: #222;
    background: #f1f3f5;

    transition:
        background-color .2s ease,
        color .2s ease;
}

/* السهم السابق — يمين */
.team-matches-card__arrow:first-child {
    right: 12px;
}

/* السهم القادم — يسار */
.team-matches-card__arrow:last-child {
    left: 12px;
}

/* ضبط بصري للسهم داخل الدائرة */
.team-matches-card__arrow:first-child {
    padding-bottom: 2px;
}

.team-matches-card__arrow:last-child {
    padding-bottom: 2px;
}

.team-matches-card__arrow:hover {
    background: #0b6b3a;
    color: #fff;
}

/* إزالة الخط أسفل رأس بطاقة المباريات */
.team-upcoming-matches-card .team-overview-card__header {
    border-bottom: none;
}

/* =========================================================
   تثبيت موضع بطاقات Team Overview عند تبديل المباريات
   ========================================================= */

.team-overview-grid {
    width: 100%;
}

.team-overview-grid > * {
    min-width: 0;
}

/* بطاقة المباريات لا تغيّر حجم العمود عند تبديل المحتوى */
.team-upcoming-matches-card {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

/* =========================================================
   Team Matches — Header Spacing & Title Size
   ========================================================= */

.team-upcoming-matches-card .team-overview-card__header {
    padding-top: 6px;
}

.team-matches-card__navigation {
    height: 58px;
    min-height: 58px;
}

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

/* =========================================================
   توحيد ارتفاع بطاقة المباريات عندما تكون فارغة
   ========================================================= */

.team-upcoming-matches-card .team-overview-empty {
    height: 134px !important;
    min-height: 145px !important;
    box-sizing: border-box !important;

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

    padding: 0 20px !important;
}

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

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

.team-upcoming-matches-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;
    }
}

/* Season Filter — Final Style */

.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;
}

/* =========================================================
   French — Upcoming Matches
========================================================= */

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

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

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

.team-upcoming-matches-card--fr .team-upcoming-match__date {
    direction: ltr;
    text-align: left;
}

.team-upcoming-matches-card--fr .team-upcoming-match__competition {
    direction: ltr;
    text-align: right;
}

.team-upcoming-matches-card--fr .team-upcoming-match__main {
    direction: ltr;
}

.team-upcoming-matches-card--fr .team-upcoming-match__team {
    direction: ltr;
}

.team-upcoming-matches-card--fr .team-upcoming-match__team-name {
    direction: ltr;
}

.team-upcoming-matches-card--fr .team-upcoming-match__time {
    direction: ltr;
}

/* =========================================================
   French — Final LTR Adjustments
========================================================= */

/* سهم فلتر الموسم */
.team-upcoming-matches-card--fr .team-season-filter {
    direction: ltr;
    background-position: right 9px center;
    text-align: left;
    padding-left: 10px;
    padding-right: 28px;
}


/* أسهم التنقل */
.team-upcoming-matches-card--fr .team-matches-card__arrow:first-child {
    right: auto;
    left: 12px;
}

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


/* تقريب الفرق من النتيجة / الوقت */
.team-upcoming-matches-card--fr .team-upcoming-match__team--home {
    transform: translateX(8px);
}

.team-upcoming-matches-card--fr .team-upcoming-match__team--away {
    transform: translateX(-8px);
}