/* ========================================
   CoreStack Club Tools - Fixtures & Results
======================================== */

.cs-fixtures-widget {
    width: 100%;
    font-family: "Montserrat", Arial, sans-serif;
}


/* ========================================
   TABS
======================================== */

.cs-fixtures-tabs {
    display: flex;
    align-items: center;
    gap: 26px;

    margin: 0 0 16px 0;
    padding: 0 2px;

    border-bottom: 1px solid #e1e1e1;
}

.cs-fixtures-tab {
    position: relative;

    appearance: none;
    -webkit-appearance: none;

    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;

    padding: 0 0 10px 0;
    margin: 0;

    color: #6b7280 !important;

    font-family: "Montserrat", Arial, sans-serif;
    font-size: 14px;
    line-height: 1;
    font-weight: 800;

    cursor: pointer;

    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.cs-fixtures-tab:hover,
.cs-fixtures-tab:focus,
.cs-fixtures-tab:active {
    color: #6b7280 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.cs-fixtures-tab::after {
    content: "";

    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;

    height: 3px;
    background: transparent;
}

.cs-fixtures-tab.is-active,
.cs-fixtures-tab.is-active:hover,
.cs-fixtures-tab.is-active:focus,
.cs-fixtures-tab.is-active:active {
    color: #00245e !important;
    background: transparent !important;
    box-shadow: none !important;
}

.cs-fixtures-tab.is-active::after {
    background: #ffdc00;
}

.cs-fixtures-tab:focus-visible {
    outline: 2px solid #0057ff;
    outline-offset: 4px;
    border-radius: 2px;
}


/* ========================================
   PANELS / SCROLL
======================================== */

.cs-fixtures-panel[hidden] {
    display: none !important;
}

.cs-fixtures {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.cs-fixtures-scroll {
    max-height: var(--cs-scroll-desktop, 410px);

    overflow-y: auto;
    overflow-x: hidden;

    padding-right: 6px;

    scrollbar-width: thin;
    scrollbar-color: #b7b7b7 transparent;
    overscroll-behavior: contain;
}

.cs-fixtures-scroll::-webkit-scrollbar {
    width: 7px;
}

.cs-fixtures-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.cs-fixtures-scroll::-webkit-scrollbar-thumb {
    background: #b7b7b7;
    border-radius: 999px;
}


/* ========================================
   SHARED CARD
======================================== */

.cs-fixture-card {
    display: grid;
    grid-template-columns: 86px 1fr;

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

    flex: 0 0 auto;
    overflow: hidden;

    background: #ffffff;
    border: 1px solid #dedede;
    border-radius: 18px;

    font-family: "Montserrat", Arial, sans-serif;
}


/* ========================================
   DATE BLOCK
======================================== */

.cs-fixture-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    background: #00245e;
    color: #ffffff;

    text-align: center;
    padding: 10px 6px;
}

.cs-fixture-day {
    font-size: 15px;
    font-weight: 800;
    line-height: 1;
}

.cs-fixture-number {
    font-size: 28px;
    font-weight: 800;
    line-height: 1.05;
    margin: 3px 0;
}

.cs-fixture-month {
    font-size: 14px;
    font-weight: 800;
    line-height: 1;
}


/* ========================================
   UPCOMING FIXTURE CONTENT
======================================== */

.cs-upcoming-body {
    display: flex;
    flex-direction: column;
    justify-content: center;

    min-width: 0;
    padding: 14px 20px;
}

.cs-upcoming-topline {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;

    column-gap: 8px;
    row-gap: 4px;

    min-width: 0;
}

.cs-upcoming-team {
    color: #00245e;

    font-size: 15px;
    line-height: 1.2;
    font-weight: 800;
}

.cs-upcoming-vs {
    color: #6b7280;

    font-size: 11px;
    line-height: 1;
    font-weight: 600;
}

.cs-upcoming-bottomline {
    display: flex;
    align-items: center;
    flex-wrap: wrap;

    gap: 0;
    margin-top: 9px;

    min-width: 0;
}

.cs-upcoming-meta {
    display: inline-flex;
    align-items: center;

    color: #4b5563;

    font-size: 11px;
    line-height: 1.2;
    font-weight: 600;

    white-space: nowrap;
}

.cs-upcoming-meta + .cs-upcoming-meta::before {
    content: "•";
    margin: 0 8px;
    color: #9ca3af;
}


/* ========================================
   RESULT CARD
======================================== */

.cs-result-body {
    display: flex;
    flex-direction: column;
    justify-content: center;

    min-width: 0;
    padding: 14px 20px;
}

.cs-result-topline {
    display: grid;
    grid-template-columns: max-content 24px 14px 24px max-content;
    align-items: center;
    justify-content: start;

    column-gap: 5px;
    row-gap: 6px;

    min-width: 0;
}

.cs-result-team {
    color: #00245e;

    font-size: 15px;
    line-height: 1.2;
    font-weight: 800;

    white-space: nowrap;
}

.cs-result-score {
    color: #00245e;

    font-size: 21px;
    line-height: 1;
    font-weight: 700;

    text-align: center;
}

.cs-result-dash {
    color: #00245e;

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

    text-align: center;
}

.cs-result-bottomline {
    display: flex;
    align-items: center;
    flex-wrap: wrap;

    gap: 8px;
    margin-top: 10px;
}

.cs-result-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 56px;
    padding: 6px 10px;

    border: 1px solid transparent;
    border-radius: 999px;

    font-size: 10px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.cs-result-meta {
    display: inline-flex;
    align-items: center;

    color: #4b5563;

    font-size: 11px;
    line-height: 1.2;
    font-weight: 600;

    white-space: nowrap;
}

.cs-result-meta + .cs-result-meta::before {
    content: "•";
    margin-right: 8px;
    color: #9ca3af;
}

.cs-result-win {
    color: #166534;
    background: #dcfce7;
    border-color: #bbf7d0;
}

.cs-result-draw {
    color: #854d0e;
    background: #fef3c7;
    border-color: #fde68a;
}

.cs-result-loss {
    color: #991b1b;
    background: #fee2e2;
    border-color: #fecaca;
}

.cs-result-pending {
    color: #374151;
    background: #f3f4f6;
    border-color: #e5e7eb;
}


/* ========================================
   EMPTY STATES
======================================== */

.cs-no-fixtures {
    margin: 0;
    padding: 14px 2px;

    font-family: "Montserrat", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.4;

    color: #333333;
}


/* ========================================
   TABLET
======================================== */

@media (max-width: 1024px) {

    .cs-fixtures-scroll {
        max-height: var(--cs-scroll-tablet, 391px);
    }

    .cs-fixture-card {
        grid-template-columns: 80px 1fr;
        min-height: 88px;
    }

    .cs-upcoming-body {
        padding: 13px 16px;
    }

    .cs-upcoming-team {
        font-size: 14px;
    }

    .cs-upcoming-meta {
        font-size: 10.5px;
    }

    .cs-fixture-number {
        font-size: 27px;
    }

    .cs-result-body {
        padding: 15px 18px;
    }

    .cs-result-topline {
        grid-template-columns: max-content 22px 12px 22px max-content;
        column-gap: 4px;
    }

    .cs-result-team {
        font-size: 14px;
    }

    .cs-result-score {
        font-size: 20px;
    }

    .cs-result-dash {
        font-size: 18px;
    }

    .cs-result-meta {
        font-size: 10.5px;
    }
}


/* ========================================
   MOBILE
======================================== */

@media (max-width: 767px) {

    .cs-fixtures-tabs {
        gap: 22px;
        margin-bottom: 13px;
    }

    .cs-fixtures-tab {
        padding-bottom: 9px;
        font-size: 12px;
    }

    .cs-fixtures {
        gap: 13px;
    }

    .cs-fixtures-scroll {
        max-height: var(--cs-scroll-mobile, 372px);
        padding-right: 4px;
    }

    .cs-fixture-card {
        grid-template-columns: 70px 1fr;
        min-height: 84px;
        border-radius: 14px;
    }

    .cs-upcoming-body {
        padding: 11px 12px;
    }

    .cs-upcoming-topline {
        column-gap: 6px;
        row-gap: 3px;
    }

    .cs-upcoming-team {
        font-size: 12px;
    }

    .cs-upcoming-vs {
        font-size: 9px;
    }

    .cs-upcoming-bottomline {
        margin-top: 7px;
    }

    .cs-upcoming-meta {
        font-size: 9.5px;
        white-space: normal;
    }

    .cs-upcoming-meta + .cs-upcoming-meta::before {
        margin: 0 6px;
    }

    .cs-result-body {
        padding: 11px 12px;
    }

    .cs-result-topline {
        grid-template-columns: max-content 20px 10px 20px max-content;
        column-gap: 4px;
    }

    .cs-result-team {
        font-size: 12px;
    }

    .cs-result-score {
        font-size: 18px;
    }

    .cs-result-dash {
        font-size: 16px;
    }

    .cs-result-bottomline {
        gap: 7px;
        margin-top: 8px;
    }

    .cs-result-badge {
        min-width: 50px;
        padding: 5px 8px;
        font-size: 9px;
    }

    .cs-result-meta {
        font-size: 9.5px;
    }
}


/* Very narrow phones: keep scores aligned without crushing team names. */
@media (max-width: 520px) {

    .cs-result-topline {
        grid-template-columns: minmax(0, 1fr) 24px;
        grid-template-areas:
            "home home-score"
            "away away-score";

        column-gap: 8px;
        row-gap: 6px;
    }

    .cs-result-team-home {
        grid-area: home;
    }

    .cs-result-score-home {
        grid-area: home-score;
    }

    .cs-result-team-away {
        grid-area: away;
    }

    .cs-result-score-away {
        grid-area: away-score;
    }

    .cs-result-dash {
        display: none;
    }

    .cs-result-team {
        min-width: 0;
        white-space: normal;
    }

    .cs-result-score {
        text-align: right;
    }
}
