/* =========================================================
   Team Overview
========================================================= */

.lwf-team-overview {
    width: 100%;
    margin-top: 0;
}

.lwf-team-overview__grid {
    display: grid;

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

    grid-template-areas:
        "level      next       upcoming"
        "standings  standings  upcoming"
        "stadium    stadium    stadium";

    gap: 18px;

    width: 100%;
    align-items: start;
}

.lwf-team-overview__level     { grid-area: level; }
.lwf-team-overview__next      { grid-area: next; }
.lwf-team-overview__upcoming  { grid-area: upcoming; }
.lwf-team-overview__standings { grid-area: standings; }
.lwf-team-overview__stadium   { grid-area: stadium; }


/* =========================================================
   Team Overview Cards
========================================================= */

.team-overview-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    overflow: hidden;
}

.team-overview-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 18px 20px;

    border-bottom: 1px solid #f1f1f1;
}

.team-overview-card__header h2 {
    margin: 0;

    font-size: 16px;
    font-weight: 700;
    color: #111827;
}

.team-overview-card__header span {
    font-size: 13px;
    color: #6b7280;
}

/* =========================================================
   TEAM LEVEL — LAST 5 MATCHES
========================================================= */
.team-level-card__matches {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: center;
    width: 100%;
    padding: 10px 14px 22px;
    box-sizing: border-box;
    gap: 10px;
}



/* المباراة الواحدة */

.team-level-match {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;

    gap: 25px;

    padding: 10px 20px;

    box-sizing: border-box;

    text-decoration: none;

    border-bottom: 1px solid #f1f1f1;
}


/* آخر صف بدون خط */

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


/* الشعارات */

.team-level-match img {
    width: 32px;
    height: 32px;

    flex: 0 0 32px;

    object-fit: contain;
}


/* النتيجة */

.team-level-match__score {
    width: 48px;
    min-width: 48px;
    height: 30px;

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

    padding: 0;

    border-radius: 6px;

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

    line-height: 1;

    color: #ffffff;
}


/* فوز */

.team-level-match--w .team-level-match__score {
    background: #009b55;
}


/* تعادل */

.team-level-match--d .team-level-match__score {
    background: #9ca3af;
}


/* خسارة */

.team-level-match--l .team-level-match__score {
    background: #e33434;
}


/* Hover */

.team-level-match:hover {
    background: #fafafa;
}


/* لا توجد مباريات */

.team-overview-empty {
    padding: 28px 20px;

    text-align: center;

    font-size: 14px;
    color: #9ca3af;
}



/* =========================================================
   Team Overview — Age Group Filter
========================================================= */

.lwf-team-overview__filter {
    width: 100%;
    margin-bottom: 18px;

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

.lwf-team-overview__filter-label {
    display: flex;
    align-items: center;
    gap: 6px;

    font-size: 14px;
    color: #111827;
}

.lwf-team-overview__filter-form {
    margin: 0;
}

.lwf-team-overview__filter-form select {
    min-width: 190px;
    height: 42px;

    padding: 0 14px;

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

    background: #ffffff;

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

    color: #111827;

    cursor: pointer;

    outline: none;
}

.lwf-team-overview__filter-form select:focus {
    border-color: #009b55;
}

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

@media (max-width: 1000px) {

    .lwf-team-overview__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-areas:
            "level      next"
            "upcoming   upcoming"
            "standings  standings"
            "stadium    stadium";
    }

}


@media (max-width: 700px) {

    .lwf-team-overview__grid {
        grid-template-columns: 1fr;
        grid-template-areas:
            "level"
            "next"
            "upcoming"
            "standings"
            "stadium";
    }

}

/* =========================================================
   TEAM OVERVIEW - 3 CARDS
   ========================================================= */

.lwf-team-overview__top {
    align-items: start;
}

.lwf-team-overview__top > * {
    width: 100%;
    min-width: 0;
    align-self: start;
}

/* البطاقة الخاصة بالمباريات القادمة */
.lwf-team-overview__upcoming {
    width: 100%;
    min-width: 0;
}

.lwf-team-overview__upcoming .team-overview-card {
    width: 100%;
}


/* =========================================================
   UPCOMING MATCHES
   ========================================================= */

.team-upcoming-match {
    width: 100%;
    box-sizing: border-box;
}

.team-upcoming-match img {
    width: 34px;
    height: 34px;
    max-width: 34px;
    max-height: 34px;
    object-fit: contain;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1000px) {

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

}

@media (max-width: 700px) {

    .lwf-team-overview__top {
        grid-template-columns: 1fr;
    }

}

/* =========================================================
   TEAM PAGE — FULL WIDTH OVERVIEW
   إزالة مساحة الـ Sidebar من صفحة الفريق
   ========================================================= */

.lwf-team-layout {
    display: block !important;
    width: 100% !important;
}

.lwf-team-main {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
}

.lwf-team-sidebar {
    display: none !important;
}

/* =========================================================
   الشاشات الصغيرة
   ========================================================= */

@media (max-width: 700px) {

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

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

        gap: 5px;
    }

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

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

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

        min-width: 30px !important;
        min-height: 30px !important;

        max-width: 30px !important;
        max-height: 30px !important;

        flex-basis: 30px;
    }

}


/* =========================================================
   TEAM OVERVIEW — FIX CARD HEIGHTS
   ========================================================= */

/* الصف العلوي يعتمد على محتوى البطاقات */
.lwf-team-overview__grid {
    align-items: start !important;
    grid-auto-rows: max-content !important;
}

/* البطاقات الثلاث: لا تتمدد إلى ارتفاع الصف */
.lwf-team-overview__grid > *:nth-child(1),
.lwf-team-overview__grid > *:nth-child(2),
.lwf-team-overview__grid > *:nth-child(3) {
    align-self: start !important;
    height: auto !important;
    min-height: 0 !important;
}

/* البطاقة نفسها */
.lwf-team-overview__grid > *:nth-child(1) .team-overview-card,
.lwf-team-overview__grid > *:nth-child(2) .team-overview-card,
.lwf-team-overview__grid > *:nth-child(3) .team-overview-card {
    height: fit-content !important;
    min-height: 0 !important;
    align-self: start !important;
    box-sizing: border-box !important;
}

/* بطاقة المباريات */
.lwf-team-overview__matches,
.lwf-team-overview__matches .team-overview-card {
    height: fit-content !important;
    min-height: 0 !important;
}

/* بطاقة المباراة القادمة */
.lwf-team-overview__upcoming,
.lwf-team-overview__upcoming .team-overview-card {
    height: fit-content !important;
    min-height: 0 !important;
}

/* مستوى الفريق */
.lwf-team-overview__level,
.lwf-team-overview__level .team-overview-card {
    height: fit-content !important;
    min-height: 0 !important;
}

/* لا توجد مباريات */
.lwf-team-overview__grid > *:has(.team-overview-empty) .team-overview-card {
    height: auto !important;
    min-height: 132px !important;
}

/* =========================================================
   TEAM LEVEL + NEXT MATCH
   توحيد الارتفاع بدون التأثير على المباريات القادمة
   ========================================================= */

.lwf-team-overview__level,
.lwf-team-overview__upcoming {
    align-self: stretch !important;
}

.lwf-team-overview__level .team-overview-card,
.lwf-team-overview__upcoming .team-overview-card {
    height: 100% !important;
    min-height: 0 !important;
    box-sizing: border-box !important;
}

/* =========================================================
   TEAM OVERVIEW — MATCH CARDS SAME HEIGHT
   ========================================================= */

.lwf-team-overview__level .team-level-card,
.lwf-team-overview__upcoming .team-next-match-card {
    min-height: 190px !important;
    height: 190px !important;
    box-sizing: border-box !important;
}

/* =========================================================
   EMPTY LEVEL + NEXT MATCH — SAME HEIGHT
========================================================= */

.lwf-team-overview__level .team-overview-card:has(.team-overview-empty),
.lwf-team-overview__next .team-overview-card:has(.team-overview-empty) {
    height: 210px !important;
    min-height: 190px !important;
    box-sizing: border-box;
}

.lwf-team-overview__level .team-overview-empty,
.lwf-team-overview__next .team-overview-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: calc(190px - 58px);
    box-sizing: border-box;
}

/* ملعب الفريق — عرض كامل */
.lwf-team-overview__stadium {
    grid-column: 1 / -1 !important;
    width: 100% !important;
}