/* =========================================================
   LWFG — Matches Page
   ========================================================= */

.matches-page {
    direction: rtl;
    width: 100%;
    padding: 32px 0 70px;
}

.matches-page .container {
    width: min(
        var(--site-max-width),
        calc(100% - (var(--site-side-space) * 2))
    );

    max-width: none;
    margin: 0 auto;
}


/* =========================================================
   Header
   ========================================================= */

.matches-page__header {
    margin-bottom: 22px;
}

.matches-page__title {
    margin: 0;
    color: #111827;

    font-size: 28px;
    line-height: 1.3;
    font-weight: 800;

    text-align: right;
}


/* =========================================================
   Filters
   ========================================================= */

.matches-filters {
    display: flex;
    align-items: flex-end;
    gap: 14px;

    width: 100%;

    padding: 18px;

    background: #ffffff;

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

    box-sizing: border-box;

    margin-bottom: 30px;

}


.matches-filter {
    display: flex;
    flex-direction: column;

    gap: 7px;

    min-width: 0;
    flex: 1;
}


.matches-filter label {
    color: #374151;

    font-size: 13px;
    line-height: 1.4;
    font-weight: 700;
}


.matches-filter select {
    width: 100%;
    height: 44px;

    padding: 0 14px;

    background-color: #ffffff;

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

    appearance: none;
    -webkit-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;

    color: #111827;

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

    outline: none;
    cursor: pointer;

    box-sizing: border-box;
}


.matches-filter select:hover {
    border-color: #9ca3af;
}


.matches-filter select:focus {
    border-color: #16a34a;
    box-shadow: 0 0 0 2px rgba(22, 163, 74, .10);
}


/* =========================================================
   Submit Button
   ========================================================= */

.matches-filters__submit {
    flex: 0 0 auto;

    height: 44px;

    padding: 0 22px;

    border: 0;
    border-radius: 9px;

    background: #006633;
    color: #ffffff;

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

    cursor: pointer;

    transition:
        background-color .2s ease,
        transform .15s ease,
        box-shadow .2s ease;
}


.matches-filters__submit:hover {
    background: #00552b;

    box-shadow:
        0 4px 12px rgba(0, 102, 51, 0.16);
}


.matches-filters__submit:active {
    transform: translateY(1px);
}


/* =========================================================
   Matches List
   ========================================================= */

.matches-list {
    width: 100%;
}


/* =========================================================
   Empty State
   ========================================================= */

.matches-empty {
    display: flex;
    align-items: center;
    justify-content: center;

    min-height: 150px;

    padding: 30px;

    background: #ffffff;

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

    box-sizing: border-box;
}


.matches-empty p {
    margin: 0;

    color: #6b7280;

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

    text-align: center;
}


/* =========================================================
   Day
   ========================================================= */

.matches-day {
    width: 100%;
    margin-bottom: 28px;
}


.matches-day__title {
    display: flex;
    align-items: center;

    margin: 0 0 12px;

    color: #111827;

    font-size: 16px;
    line-height: 1.4;
    font-weight: 800;
}


/* =========================================================
   Day List
   ========================================================= */

.matches-day__list {
    display: flex;
    flex-direction: column;

    gap: 10px;
}


/* =========================================================
   Match Card
   ========================================================= */

.match-card {
    position: relative;

    display: grid;

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

    align-items: center;

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

    padding: 13px 22px 32px;

    background: #ffffff;

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

    box-sizing: border-box;

    color: inherit;
    text-decoration: none;

  transition: none;
}

.match-card:hover {
    border-color: #e5e7eb;
    box-shadow: none;
    transform: none;
}


/* =========================================================
   Teams
   ========================================================= */

.match-card__team {
    display: flex;
    align-items: center;

    gap: 12px;

    min-width: 0;
}


.match-card__team--home {
    justify-content: flex-start;

    text-align: right;
}


.match-card__team--away {
    justify-content: flex-end;

    text-align: left;
}


.match-card__team-name {
    min-width: 0;

    color: #111827;

    font-size: 18px;
    line-height: 1.4;
    font-weight: 700;

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


/* =========================================================
   Team Logo
   ========================================================= */

.match-card__logo {
    display: block;

    width: 52px;
    height: 52px;

    flex: 0 0 52px;

    object-fit: contain;
}


/* =========================================================
   Center
   ========================================================= */

.match-card__center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;

    min-width: 0;

    text-align: center;
}


.match-card__score {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 8px;

    min-width: 72px;
    height: 42px;

    padding: 0 10px;

    background: transparent;
    border: 0;
    border-radius: 0;

    color: #111827;

    font-size: 28px;
    line-height: 1;
    font-weight: 800;
}


.match-card__score span {
    color: #6b7280;

    font-size: 15px;
    font-weight: 600;
}


.match-card__time {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 72px;
    height: 42px;

    padding: 0 10px;

    background: transparent;
    border: 0;
    border-radius: 0;

    color: #006633;

    font-size: 25px;
    line-height: 1;
    font-weight: 800;
}

/* Stadium */
.match-card__stadium {
    position: absolute;

    left: 50%;
    bottom: 7px;

    transform: translateX(-50%);

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

    gap: 5px;

    width: max-content;
    max-width: calc(100% - 40px);

    color: #6b7280;

    font-size: 11px;
    line-height: 1.3;
    font-weight: 500;

    white-space: nowrap;
}

.match-card__stadium svg {
    width: 13px;
    height: 13px;

    flex: 0 0 13px;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.match-card__stadium-name {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* =========================================================
   Round Navigation
   ========================================================= */

.matches-round-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;

        direction: ltr;

    width: 248px;
    height: 46px;

    margin: 0 auto 18px;

    padding: 0 8px;

    background: #ffffff;

    border: 2px solid #006633;
    border-radius: 999px;

    box-sizing: border-box;
}


.matches-round-nav__title {
    flex: 1;

    color: #000000;

    font-size: 16px;
    line-height: 1;
    font-weight: 800;

    text-align: center;
}


.matches-round-nav__arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 32px;
    height: 32px;

    flex: 0 0 32px;

    background: transparent;

    border: 0;
    border-radius: 50%;

    color: #000000;

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

    text-decoration: none;

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

.matches-round-nav__arrow {
    display: flex;
    align-items: center;
    justify-content: center;
}

.matches-round-nav__arrow svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}


.matches-round-nav__arrow:hover {
    background: #f3f0f8;

    color: #6b4aa0;
}


.matches-round-nav__arrow.is-disabled {
    color: #d1d5db;

    background: transparent;

    cursor: default;
}


.matches-round-nav__arrow:hover {
    background: #f0fdf4;

    border-color: #006633;

    color: #00552b;
}


.matches-round-nav__arrow.is-disabled {
    color: #d1d5db;

    background: #f9fafb;

    cursor: default;
}


/* =========================================================
   Date Badge
   ========================================================= */

.matches-day__title {
    justify-content: center;

    margin: 0 0 14px;

    font-size: 14px;
    font-weight: 700;
}


.matches-day__title::before {
    display: none;
}


.matches-day__title {
    display: flex;
    align-items: center;
    justify-content: center;

    width: fit-content;

    margin: 0 auto 12px;
    padding: 7px 16px;

    background: #006633;
    color: #ffffff;

    border: 0;
    border-radius: 10px;

    font-size: 14px;
    line-height: 1.2;
    font-weight: 700;

    text-align: center;
}

/* =========================================================
   Match Card — Compact Teams
   ========================================================= */

.match-card {
    grid-template-columns:
        minmax(0, 1fr)
        120px
        minmax(0, 1fr);

    min-height: 88px;

    padding: 12px 18px;
}


.match-card__team {
    gap: 8px;
}


.match-card__team--home {
    justify-content: flex-end;
}


.match-card__team--away {
    justify-content: flex-start;
}


.match-card__team-name {
    font-size: 18px;
}


.match-card__logo {
    width: 46px;
    height: 46px;

    flex-basis: 46px;
}


.match-card__center {
    padding: 0;
}


.match-card__score,
.match-card__time {
    min-width: 76px;
    height: 40px;
}


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

@media (max-width: 800px) {

    .matches-page {
        padding: 24px 0 50px;
    }


       .matches-page .container {
        width: min(
            var(--site-max-width),
            calc(100% - (var(--site-side-space) * 2))
        );

        max-width: none;
        margin-inline: auto;
        box-sizing: border-box;
    }


    .matches-filters {
        flex-direction: column;
        align-items: stretch;

        gap: 12px;

        padding: 15px;
    }


    .matches-filter {
        width: 100%;
        flex: none;
    }


    .matches-filters__submit {
        width: 100%;
    }


    .match-card {
        grid-template-columns:
            minmax(0, 1fr)
            82px
            minmax(0, 1fr);

        min-height: 86px;

        padding: 11px 14px;
    }


    .match-card__logo {
        width: 46px;
        height: 46px;

        flex-basis: 46px;
    }


    .match-card__team {
        gap: 8px;
    }


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


    .match-card__score,
    .match-card__time {
        min-width: 62px;
        height: 38px;
    }


    .match-card__score {
        font-size: 18px;
    }


    .match-card__time {
        font-size: 15px;
    }

}


@media (max-width: 520px) {

    .matches-page__title {
        font-size: 23px;
    }


    .match-card {
        grid-template-columns:
            minmax(0, 1fr)
            70px
            minmax(0, 1fr);

        padding: 10px;
    }


    .match-card__logo {
        width: 40px;
        height: 40px;

        flex-basis: 40px;
    }


    .match-card__team {
        gap: 6px;
    }


    .match-card__team-name {
        font-size: 12px;
    }


    .match-card__score,
    .match-card__time {
        min-width: 56px;
        height: 36px;
    }

}

.match-card__team,
.match-card__center {
    margin-top: -15px;
}

.matches-day__list {
    position: relative;
}

.matches-day__list.is-loading::after {
    content: "";
    position: absolute;
    inset: 0;
    background: #fff;
    opacity: .65;
    pointer-events: none;
    z-index: 50;
    animation: matchesListLoading .45s ease-in-out infinite alternate;
}

@keyframes matchesListLoading {
    from {
        opacity: .45;
    }

    to {
        opacity: .75;
    }
}

/* =========================================================
   French / LTR
   ========================================================= */

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

.matches-page--fr .matches-page__title {
    text-align: left;
}

.matches-page--fr .matches-filter select {
    direction: ltr;
    background-position: right 14px center;
    padding-left: 14px;
    padding-right: 40px;
}

.matches-page--fr .matches-card__team-name,
.matches-page--fr .match-card__team-name {
    direction: ltr;
}