* {
    box-sizing: border-box;
}
/* #region pagination */
.result-pagination .result-page-btn {
    border: 1px solid #2980b9;
    transition:
        background 0.2s,
        color 0.2s;
}
.result-pagination .result-page-btn:hover {
    background: #2980b9;
    color: #fff;
}
.result-pagination .result-page-btn.result-page-prev,
.result-pagination .result-page-btn.result-page-next,
.result-pagination .result-page-btn.result-page-prev5,
.result-pagination .result-page-btn.result-page-next5 {
    font-weight: bold;
    background: #f4f4f4;
    color: #2980b9;
}
.result-pagination .result-page-btn.result-page-prev:hover,
.result-pagination .result-page-btn.result-page-next:hover,
.result-pagination .result-page-btn.result-page-prev5:hover,
.result-pagination .result-page-btn.result-page-next5:hover {
    background: #2980b9;
    color: #fff;
}
/* #endregion pagination */

.fixture-table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}
/* #region league selector */
.league-selector {
    display: inline-block;
    margin: 0;
}

.league-selector label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #34495e;
    font-size: 14px;
}

.league-selector select {
    padding: 8px 12px;
    border: 2px solid #e0e6ed;
    border-radius: 6px;
    background: white;
    font-size: 14px;
    color: #2c3e50;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.league-selector select:focus {
    outline: none;
    border-color: #3498db;
}

/* Fixture league selector specific styling */
.fixture-league-selector {
    padding: 5px;
    border-radius: 8px;
}

.fixture-league-selector label {
    color: #2c3e50;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.fixture-league-selector select {
    min-width: 250px;
    font-size: 15px;
    padding: 10px 15px;
    border: 2px solid #d1d5db;
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.fixture-league-selector select:hover {
    border-color: #3498db;
}

.fixture-league-selector select:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* #endregion league selector */

/* #region search */
.result-search-form input[type="text"]:focus {
    outline: 2px solid #2271b1;
    background: #fff;
}
.result-search-form .button:active {
    background: #1a5a96 !important;
}
.result-search-form {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}
.result-search-input {
    padding: 5px 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 16px;
    background: #f8f9fa;
}
.result-search-input:focus {
    outline: 2px solid #2271b1;
    background: #fff;
}
.result-search-btn {
    padding: 5px 15px;
    background-color: #2271b1;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}
.result-search-btn:hover,
.result-search-btn:focus {
    background: #2980b9;
    color: #fff;
}
.result-search-btn:active {
    background: #1a5a96 !important;
}
.result-clear-btn {
    margin-left: 6px;
    background: #ff0000;
    color: #fff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    padding: 12px 14px;
    transition:
        background 0.2s,
        color 0.2s;
}
.result-clear-btn:hover,
.result-clear-btn:focus {
    background: #fd2a2a;
    color: #fff;
}

/* #endregion search */

/* #region Table */
.football-shortcode-result.modern-match-table {
    margin: 0 auto;
    max-width: 1000px;
    width: 100%;
    /* background: #fff;
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(44, 62, 80, 0.08);
    padding: 24px 18px 18px 18px;
    box-sizing: border-box; */
}
.modern-match-table .result-table-wrapper,
.modern-match-table .schedule-table-wrapper {
    margin: 0 auto;
    max-width: 1000px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(44, 62, 80, 0.08);
    padding: 2px 18px 18px 18px;
    width: 100%;
    box-sizing: border-box;
}
.modern-match-table .result-table {
    width: 100%;
    max-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
    border-radius: 12px;
    font-family: inherit;
    box-sizing: border-box;

    table-layout: auto; /* allow natural auto sizing */
    min-width: 0; /* prevent forcing width */
}

.modern-match-table .result-table th {
    background: #f5f7fa;
    padding: 14px 10px;
    text-align: center;
    color: #2c3e50;
    font-size: 15px;
    font-weight: 600;
    border: none;
}
.modern-match-table .result-table td {
    padding: 12px 10px;
    color: #34495e;
    font-size: 14px;
    border-bottom: 1px solid #ecf0f1;
    vertical-align: middle;
}
/* Let long text wrap so cells don’t force table wider */
.modern-match-table .result-table th span,
.modern-match-table .result-table td span {
    white-space: nowrap; /* instead of nowrap */
    word-break: break-word; /* wrap long words */
}
.result-table .match_ht .team-cell {
    display: flex;
    flex-direction: row-reverse;
}
.modern-match-table .result-table td.match_ht {
    width: 30%;
}
.modern-match-table .result-table td.match_at {
    width: 30%;
}

.modern-match-table .result-table .th-score,
.modern-match-table .result-table .th-post {
    text-align: center;
}

.modern-match-table .result-table tr:last-child td {
    border-bottom: none;
}
.modern-match-table .team-cell.sc_home_team {
    justify-content: flex-end;
}
.match_time_css {
    display: flex;
    flex-direction: column;
}

.match_time_css p {
    margin: 0;
}

.match_gd .team-cell {
    text-align: center;
}
.modern-match-table .team-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}
.modern-match-table .team-logo {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #f8f9fa;
    object-fit: contain;
    vertical-align: middle;
    border: 1px solid #e1e4ea;
}
.modern-match-table .team-name {
    font-weight: 600;
    color: #2c3e50;
    font-size: 15px;
}
.modern-match-table .score-cell {
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    color: #2c3e50;
    min-width: 60px;
}
.modern-match-table .status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 8px;
    background: #eaf6ea;
    color: #27ae60;
    font-size: 13px;
    font-weight: 600;
    margin-left: 4px;
}
.modern-match-table .date-cell {
    color: #7f8c8d;
    font-size: 13px;
    white-space: nowrap;
    text-align: center;
}
.modern-match-table .venue-cell {
    color: #7f8c8d;
    font-size: 13px;
    white-space: nowrap;
}

.modern-match-table .result-table .rs_time,
.modern-match-table .result-table .rs_league {
    text-align: center;
}
/* Prevent table from exceeding container width */
.modern-match-table .result-table {
    max-width: 100%;
    width: 100%;
    overflow-x: auto;
    display: table;
    table-layout: auto;
}

.pagination {
    margin: 18px 0 0 0;
    text-align: center;
}
.pagination a {
    display: inline-block;
    margin: 0 3px;
    padding: 6px 12px;
    border-radius: 4px;
    background: #f5f7fa;
    color: #2980b9;
    text-decoration: none;
    font-weight: 500;
}
.pagination a.active,
.pagination a:hover {
    background: #2980b9;
    color: #fff;
}
.modern-match-table .fixture-table td.news-cell {
    padding-top: 0;
    padding-bottom: 0;
}
.news-cell .nhan_dinh {
    width: 90px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
    border: 1px solid #00b66f;
    padding: 0px 10px;
    border-radius: 5px;
    color: #fff;
    background: #00d27f;
    font-weight: 600;
    text-decoration: none;
    font-size: 11px;
    white-space: nowrap;
    transition: all 200ms ease-in-out;
}
.news-cell .nhan_dinh.fb88_redirect_link {
    margin-top: 2px;
    background: #d40000;
    color: white;
    border: 1px solid #7b0000;
}
.news-cell .nhan_dinh:hover,
.news-cell .nhan_dinh.fb88_redirect_link:hover {
    font-size: 13px;
}
.modern-match-table .result-table .team-cell.rs_home_team {
    justify-content: flex-end;
}
.modern-match-table .result-table .team-cell.rs_away_team {
    justify-content: flex-start;
}

/* #endregion Table */

/* Responsive styles */
@media (max-width: 992px) {
    .fixture-table-header {
        flex-direction: column;
    }
    .result-search-input {
        flex-basis: 100%;
    }

    .fixture-table-header > * {
        width: 100%;
    }
    .football-shortcode-result.modern-match-table {
        padding: 10px 2px 8px 2px;
        border-radius: 8px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    .result-search-form {
        justify-content: flex-start;
        flex-wrap: nowrap;
    }

    .league-selector {
        display: block;
        margin: 0 0 15px 0px;
        text-align: left;
    }

    .league-selector select {
        min-width: 200px;
    }
    #fixture-league-select {
        width: 100%;
    }

    .fixture-league-selector select {
        min-width: 180px;
        font-size: 14px;
        padding: 8px 12px;
    }
    .modern-match-table .result-table-wrapper,
    .modern-match-table .schedule-table-wrapper {
        padding: 0;
        margin: 0;
        width: 100%;
        max-width: 100vw;
        box-sizing: border-box;
    }
    .modern-match-table .result-table {
        font-size: 13px;
        border-radius: 0;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        /* Remove table-layout: fixed for mobile, use auto */
        table-layout: auto;
        min-width: unset;
    }
    .modern-match-table .result-table th,
    .modern-match-table .result-table td {
        padding: 8px 4px;
        font-size: 13px;
        text-align: center;
    }
    .modern-match-table .result-table tr td,
    .modern-match-table .fixture-table tr td {
        width: 100%;
        display: flex;
        flex-direction: row;
        justify-content: flex-end;
    }
    .modern-match-table .fixture-table tr td.league-header-cell {
        width: 100%;
        display: flex;
        flex-direction: row;
        justify-content: flex-start;
    }
    .modern-match-table .result-table tr td .rs_away_team,
    .modern-match-table .fixture-table tr td .sc_away_team {
        flex-direction: row-reverse;
    }
    .date-slider-container .result-table .team-info {
        flex-direction: row-reverse;
    }
    .modern-match-table .team-logo {
        width: 22px;
        height: 22px;
    }
    .modern-match-table .team-name {
        font-size: 13px;
        text-align: right;
    }
    .modern-match-table .score-cell {
        font-size: 15px;
        min-width: 40px;
    }
    .modern-match-table .status-badge {
        font-size: 11px;
        padding: 2px 6px;
        border-radius: 6px;
    }
    .modern-match-table .date-cell,
    .modern-match-table .venue-cell {
        font-size: 11px;
    }
    /* Stack table for mobile using data-labels */
    .modern-match-table .result-table,
    .modern-match-table .result-table thead,
    .modern-match-table .result-table tbody,
    .modern-match-table .result-table tr,
    .modern-match-table .result-table th,
    .modern-match-table .result-table td {
        display: block;
        width: 100%;
        box-sizing: border-box;
    }
    .modern-match-table .result-table thead {
        display: none;
    }
    .modern-match-table .result-table tr {
        margin-bottom: 18px;
        border-radius: 8px;
        box-shadow: 0 1px 4px rgba(44, 62, 80, 0.06);
        background: #fff;
        border: 1px solid #f0f0f0;
        padding: 8px 0;
        display: block;
    }
    .modern-match-table .result-table td {
        border: none;
        border-bottom: 1px solid #f3f3f3;
        position: relative;
        padding-left: 40%;
        min-height: 32px;
        display: flex;
        align-items: center;
    }
    .modern-match-table .result-table td:last-child {
        border-bottom: none;
    }
    .modern-match-table .result-table td:before {
        position: absolute;
        left: 8px;
        top: 50%;
        transform: translateY(-50%);
        width: 38%;
        white-space: nowrap;
        font-weight: 600;
        color: #7f8c8d;
        font-size: 12px;
        content: attr(data-label);
        text-align: left;
        display: block;
    }
    /* Remove data-label for empty label (score cell) */
    .modern-match-table .result-table td[data-label=""]::before {
        content: "";
        display: none;
    }

    .modern-match-table .result-table td.match_ht {
        width: 100%;
    }
    .modern-match-table .result-table td.match_at {
        width: 100%;
    }
    .modern-match-table .result-table td.match_at .team-cell {
        flex-direction: row-reverse;
    }
}
