/* League Standings Styles */
.fs-standings-bxh-wrapper {
    max-width: 100%;
    margin: 20px auto;
    color: var(--fs-text-color, #ffffff);
    box-shadow: var(--fs-box-shadow, 0 4px 8px rgba(0, 0, 0, 0.3));
    position: relative;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

/* Navigation Bar */
.fs-nav-container-bxh {
    background: var(--fs-surface-dark, #272727);
    border-radius: var(--fs-border-radius, 8px);
    padding: 8px;
    margin-bottom: 12px;
    border: 1px solid var(--fs-border-color, #2f2f2f);
}

.fs-results-header-bxh {
    padding: 12px;
    border-bottom: 1px solid rgba(var(--fs-primary-rgb, 41, 168, 30), 0.1);
    background: var(--fs-surface-dark, #272727);
}

.fs-results-filters-bxh {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.fs-filters-left-bxh {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.fs-filters-right-bxh {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Today button */
.fs-today-btn-bxh {
    background: transparent;
    border: 1px solid rgba(var(--fs-primary-rgb, 41, 168, 30), 0.1);
    color: var(--fs-primary-color, #29A81E);
    font-size: 12px;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    white-space: nowrap;
    min-height: 28px;
}

.fs-today-btn-bxh i {
    font-size: 12px;
}

.fs-today-btn-bxh:hover,
.fs-today-btn-bxh.active {
    background: var(--fs-primary-color, #29A81E);
    color: #fff;
    border-color: var(--fs-primary-color, #29A81E);
}

/* Date wrapper */
.fs-date-wrapper-bxh {
    position: relative;
    flex: 1;
    max-width: 120px;
}

.fs-date-btn-bxh {
    background: transparent;
    border: 1px solid rgba(var(--fs-primary-rgb, 41, 168, 30), 0.1);
    color: var(--fs-text-color, #ffffff);
    font-size: 12px;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    transition: all 0.2s ease;
    width: 100%;
    min-height: 28px;
}

.fs-date-btn-bxh:hover {
    background: rgba(var(--fs-primary-rgb, 41, 168, 30), 0.1);
    border-color: rgba(var(--fs-primary-rgb, 41, 168, 30), 0.2);
}

.fs-date-btn-bxh i {
    font-size: 10px;
    opacity: 0.7;
}

.fs-date-filter-bxh {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* Search box */
.fs-search-box-bxh {
    padding: 6px 8px !important;
    position: relative !important;
    background: transparent !important;
    margin: 0 !important;
    flex: 1;
    max-width: 200px;
}

.fs-league-search-bxh {
    width: 100% !important;
    height: auto !important;
    padding: 6px 32px 6px 10px !important;
    border: 1px solid rgba(var(--fs-primary-rgb), 0.1) !important;
    border-radius: 4px !important;
    background: var(--fs-bg-dark) !important;
    color: var(--fs-text-light) !important;
    font-size: 12px !important;
    outline: none !important;
    transition: all 0.2s ease !important;
    margin: 0 !important;
    box-shadow: none !important;
    min-height: unset !important;
    line-height: normal !important;
}

.fs-league-search-bxh:focus {
    border-color: rgba(var(--fs-primary-rgb), 0.3) !important;
    background: var(--fs-surface-darker) !important;
    color: var(--fs-text-color) !important;
}

.fs-search-box-bxh i {
    position: absolute !important;
    right: 16px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    color: #666 !important;
    font-size: 12px !important;
    pointer-events: none !important;
}

/* Sort button */
.fs-sort-btn-bxh {
    background: transparent;
    border: 1px solid rgba(var(--fs-primary-rgb), 0.1);
    color: var(--fs-text-light);
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    white-space: nowrap;
    min-height: 28px;
    min-width: 150px;
}

.fs-sort-btn-bxh span {
    font-weight: 500;
}

.fs-sort-btn-bxh:hover {
    background: rgba(var(--fs-primary-rgb), 0.1);
    border-color: rgba(var(--fs-primary-rgb), 0.2);
}

.fs-sort-btn-bxh.active {
    background: var(--fs-primary-color);
    border-color: var(--fs-primary-color);
    color: #fff;
}

/* Leagues navbar */
.fs-leagues-navbar-bxh {
    background: #272727;
    border-top: none;
    padding: 8px 12px;
    max-height: 300px;
    overflow-y: auto;
    position: relative;
    scrollbar-width: thin;
    -ms-overflow-style: none;
    mask-image: linear-gradient(to bottom, transparent 0%, black 5%, black 95%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 5%, black 95%, transparent 100%);
}

.fs-leagues-navbar-bxh::-webkit-scrollbar {
    width: 4px;
}

.fs-leagues-navbar-bxh::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

.fs-leagues-navbar-bxh::-webkit-scrollbar-thumb {
    background: rgba(var(--fs-primary-rgb), 0.3);
    border-radius: 4px;
}

.fs-leagues-navbar-bxh::-webkit-scrollbar-thumb:hover {
    background: rgba(var(--fs-primary-rgb), 0.5);
}

.fs-leagues-scroll-bxh {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: center;
    padding: 5px;
    max-height: 140px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(var(--fs-primary-rgb), 0.3) rgba(0, 0, 0, 0.1);
}

.fs-league-btn-bxh {
    background: var(--fs-surface-darker);
    border: 1px solid rgba(var(--fs-primary-rgb), 0.1);
    color: var(--fs-text-light);
    font-size: 10px;
    padding: 3px 7px;
    border-radius: 3px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    min-height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fs-league-btn-bxh:hover {
    background: rgba(40, 40, 40, 0.8);
    border-color: rgba(var(--fs-primary-rgb), 0.3);
    color: #ddd;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.fs-league-btn-bxh.active {
    background: var(--fs-primary-color);
    border-color: transparent;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    color: #fff;
    font-weight: 600;
}

.fs-league-flag-bxh {
    width: 16px;
    height: 16px;
    object-fit: contain;
    filter: brightness(0.9);
}

.fs-league-btn-bxh.active .fs-league-flag-bxh {
    filter: brightness(0.2);
}

.fs-league-btn-bxh span {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Standings content */
.fs-standings-bxh-content {
    background: var(--fs-surface-dark, #272727);
    border-radius: var(--fs-border-radius, 8px);
    padding: 12px;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--fs-border-color, #2f2f2f);
}

/* Loading indicator */
.fs-standings-bxh-table-container.loading {
    position: relative;
    min-height: 100px;
}

.fs-standings-bxh-table-container.loading::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(39, 39, 39, 0.7);
    backdrop-filter: blur(2px);
    z-index: 10;
    border-radius: var(--fs-border-radius);
}

.fs-standings-bxh-table-container.loading::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    border: 3px solid rgba(var(--fs-primary-rgb), 0.2);
    border-top: 3px solid var(--fs-primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 11;
}

@keyframes spin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Table styles */
.fs-standings-bxh-table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    margin: 0;
    position: relative;
    color: var(--fs-text-color, #ffffff);
}

.fs-standings-bxh-table thead.thead-bxh {
    position: sticky;
    top: 0;
    z-index: 2;
}

.fs-standings-bxh-table thead.thead-bxh tr {
    background: transparent;
    border-bottom: 1px solid rgba(var(--fs-primary-rgb, 41, 168, 30), 0.2);
    height: 50px;
}

.fs-standings-bxh-table thead.thead-bxh th {
    padding: 12px 15px;
    color: var(--fs-primary-color, #29A81E);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
    text-align: center;
    white-space: nowrap;
    border: none !important;
    background: transparent !important;
}

/* Body styles */
.fs-standings-bxh-table tbody.tbody-bxh {
    background: none;
    border: none;
}

.fs-standings-bxh-table tbody.tbody-bxh tr:hover {
    background-color: rgba(var(--fs-primary-rgb, 41, 168, 30), 0.05) !important;
}

.fs-standings-bxh-table tbody.tbody-bxh tr:last-child {
    border-bottom: none;
}

.fs-standings-bxh-table tbody.tbody-bxh tr:hover {
    background-color: rgba(var(--fs-primary-rgb, 41, 168, 30), 0.05) !important;
}

.fs-standings-bxh-table tbody.tbody-bxh tr:last-child {
    border-bottom: none;
}

.fs-standings-bxh-table tbody.tbody-bxh td {
    padding: 8px 20px;
    text-align: center;
    color: var(--fs-text-color, #ffffff);
    font-size: 14px;
    vertical-align: middle;
    white-space: nowrap;
    border: none !important;
    background: transparent !important;
}

/* Column widths */
.fs-rank-bxh {
    width: 60px;
    padding: 8px 0 !important;
    position: relative;
    text-align: center;
    font-weight: 600;
    z-index: 1;
}

.fs-rank-bxh[data-rank]::before {
    content: attr(data-rank);
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 28px;
    height: 28px;
    background: var(--fs-surface-darker, #1d1d1d);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--fs-text-color, #ffffff);
    font-weight: bold;
    font-size: 13px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Champions League positions (1-4) */
.fs-rank-bxh[data-rank="1"]::before,
.fs-rank-bxh[data-rank="2"]::before,
.fs-rank-bxh[data-rank="3"]::before,
.fs-rank-bxh[data-rank="4"]::before {
    background: linear-gradient(135deg, var(--fs-primary-darker, #155A0D), var(--fs-primary-color, #29A81E));
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Europa League positions (5-6) */
.fs-rank-bxh[data-rank="5"]::before,
.fs-rank-bxh[data-rank="6"]::before {
    background: linear-gradient(135deg, var(--fs-secondary-color), var(--fs-secondary-light));
}

/* Relegation positions (bottom 3) */
.fs-standings-bxh-table tr:nth-last-child(1) .fs-rank-bxh::before,
.fs-standings-bxh-table tr:nth-last-child(2) .fs-rank-bxh::before,
.fs-standings-bxh-table tr:nth-last-child(3) .fs-rank-bxh::before {
    background: linear-gradient(135deg, var(--fs-error-color), #ff416c);
}

/* Gold, silver, bronze medals for top 3 */
.fs-rank-bxh[data-rank="1"]::before {
    background: linear-gradient(135deg, var(--fs-primary-color), var(--fs-primary-light));
    color: #fff;
    font-weight: 800;
    width: 32px;
    height: 32px;
    font-size: 14px;
    border: none;
}

.fs-rank-bxh[data-rank="2"]::before {
    background: linear-gradient(135deg, #217A16, #29A81E);
    color: #fff;
    font-weight: 800;
    width: 30px;
    height: 30px;
    border: none;
}

.fs-rank-bxh[data-rank="3"]::before {
    background: linear-gradient(135deg, #155A0D, #217A16);
    color: #fff;
    font-weight: 800;
    width: 30px;
    height: 30px;
    border: none;
}

.fs-team-bxh {
    width: auto;
    min-width: 250px;
    padding-right: 25px !important;
}

.fs-played-bxh,
.fs-won-bxh,
.fs-draw-bxh,
.fs-lost-bxh,
.fs-gf-bxh,
.fs-ga-bxh,
.fs-gd-bxh {
    width: 50px;
    padding-right: 25px !important;
}

.fs-points-bxh {
    width: 60px;
    padding-right: 30px !important;
}

/* Team column styles */
.fs-team-bxh {
    text-align: left;
}

.fs-team-bxh-info {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.fs-team-bxh-content {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 50%;
    min-width: 200px;
}

.fs-team-bxh-logo {
    width: 30px;
    height: 30px;
    object-fit: contain;
    border-radius: 2px;
    flex-shrink: 0;
}

.fs-team-bxh-name {
    font-weight: 500;
    color: #fff;
    font-size: 14px;
    letter-spacing: 0.2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
}

/* Top 3 ranks */
tr:nth-child(1) .fs-rank-bxh[data-rank]::before {
    background: linear-gradient(45deg, #ffd700, #ffc800);
    width: 32px;
    height: 32px;
}

tr:nth-child(2) .fs-rank-bxh[data-rank]::before {
    background: linear-gradient(45deg, #c0c0c0, #b0b0b0);
    width: 30px;
    height: 30px;
}

tr:nth-child(3) .fs-rank-bxh[data-rank]::before {
    background: linear-gradient(45deg, #cd7f32, #bd6f22);
    width: 30px;
    height: 30px;
}

/* Add special text color for top 3 ranks */
tr:nth-child(1) .fs-rank-bxh,
tr:nth-child(2) .fs-rank-bxh,
tr:nth-child(3) .fs-rank-bxh {
    font-weight: bold;
}

/* Relegation zone */
tr:nth-last-child(-n+3) .fs-rank-bxh[data-rank]::before {
    background: linear-gradient(45deg, #ff4757, #ff3747);
}

/* Add special text color for bottom 3 ranks */
tr:nth-last-child(-n+3) .fs-rank-bxh {
    color: #fff;
    font-weight: bold;
}

/* Column colors */
.fs-won-bxh {
    color: var(--fs-success-color, #29A81E) !important;
}

.fs-draw-bxh {
    color: var(--fs-hot-color, #feba4b) !important;
}

.fs-lost-bxh {
    color: var(--fs-error-color, #ff4b2b) !important;
}

.fs-gf-bxh {
    color: var(--fs-primary-light, #38C42A) !important;
}

.fs-ga-bxh {
    color: var(--fs-error-color, #ff4b2b) !important;
}

.fs-gd-bxh {
    color: inherit;
}

.fs-gd-bxh:not(:empty) {
    color: #29A81E;
}

.fs-gd-bxh[innerHTML^="-"] {
    color: #ff4b2b;
}

.fs-points-bxh {
    color: #29A81E !important;
    font-weight: 600;
}

/* Responsive styles */
@media screen and (max-width: 768px) {
    .fs-nav-container-bxh {
        padding: 6px;
    }
    
    .fs-results-header-bxh {
        padding: 8px;
    }
    
    .fs-standings-bxh-content {
        padding: 6px !important;
        border-radius: 8px;
    }

    .fs-standings-bxh-table {
        min-width: unset !important;
        width: 100% !important;
    }

    /* Hide less important columns on mobile */
    .fs-played-bxh,
    .fs-gf-bxh,
    .fs-ga-bxh,
    .fs-gd-bxh {
        display: none !important;
    }

    .fs-standings-bxh-table thead.thead-bxh th {
        padding: 8px 4px !important;
        font-size: 12px !important;
    }
    
    .fs-standings-bxh-table thead.thead-bxh tr {
        background: transparent !important;
        height: 42px !important;
    }

    .fs-standings-bxh-table tbody.tbody-bxh td {
        padding: 6px 4px !important;
        font-size: 13px !important;
    }
    
    .fs-standings-bxh-table tbody.tbody-bxh tr {
        height: 48px !important;
    }

    /* Adjust team column */
    .fs-team-bxh {
        width: auto !important;
        min-width: 140px !important;
        max-width: 140px !important;
        padding-right: 8px !important;
    }

    .fs-team-bxh-content {
        min-width: unset !important;
        width: 100% !important;
        gap: 8px !important;
    }

    .fs-team-bxh-logo {
        width: 20px !important;
        height: 20px !important;
    }

    .fs-team-bxh-name {
        font-size: 13px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: 100px !important;
    }

    /* Adjust rank column */
    .fs-rank-bxh {
        width: 40px !important;
        padding: 8px 4px !important;
    }

    .fs-rank-bxh[data-rank]::before {
        width: 26px !important;
        height: 26px !important;
        font-size: 12px !important;
    }

    .fs-rank-bxh[data-rank="1"]::before,
    .fs-rank-bxh[data-rank="2"]::before,
    .fs-rank-bxh[data-rank="3"]::before {
        width: 26px !important;
        height: 26px !important;
    }

    /* Adjust W/D/L columns */
    .fs-won-bxh,
    .fs-draw-bxh,
    .fs-lost-bxh {
        width: 30px !important;
        padding: 8px 4px !important;
    }

    /* Adjust points column */
    .fs-points-bxh {
        width: 40px !important;
        padding: 8px 4px !important;
    }

    .fs-leagues-navbar-bxh {
        max-height: 80px;
        padding: 6px 0;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        mask-image: none;
        -webkit-mask-image: none;
    }
    
    .fs-leagues-scroll-bxh {
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 5px 10px;
        max-height: none;
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
        width: 100%;
    }
    
    .fs-league-btn-bxh {
        min-height: 30px;
        padding: 5px 8px;
        max-width: 110px;
        font-size: 10px;
    }
}

@media screen and (max-width: 480px) {
    .fs-nav-container-bxh {
        padding: 8px;
    }

    .fs-leagues-navbar-bxh {
        max-height: 80px;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 6px 0;
    }
    
    .fs-leagues-scroll-bxh {
        padding: 5px 10px;
        flex-wrap: nowrap;
        white-space: nowrap;
    }
    
    .fs-league-btn-bxh {
        padding: 4px 7px;
        min-height: 28px;
        font-size: 10px;
        max-width: none;
        flex-shrink: 0;
    }

    .fs-league-flag-bxh {
        width: 14px;
        height: 14px;
    }
}

@media screen and (max-width: 375px) {
    .fs-nav-container-bxh {
        padding: 4px;
    }
    
    .fs-results-header-bxh {
        padding: 6px;
    }
    
    .fs-standings-bxh-content {
        padding: 4px !important;
        border-radius: 6px;
    }
    
    .fs-standings-bxh-table thead tr {
        height: 40px !important;
        background: transparent !important;
    }

    .fs-standings-bxh-table tbody tr {
        height: 42px !important;
    }

    .fs-team-bxh {
        min-width: 120px !important;
        max-width: 120px !important;
    }

    .fs-team-bxh-name {
        max-width: 80px !important;
        font-size: 12px !important;
    }

    .fs-standings-bxh-table thead.thead-bxh th,
    .fs-standings-bxh-table tbody.tbody-bxh td {
        font-size: 12px !important;
        padding: 4px 2px !important;
    }

    .fs-won-bxh,
    .fs-draw-bxh,
    .fs-lost-bxh {
        width: 25px !important;
    }

    .fs-rank-bxh[data-rank]::before {
        width: 22px !important;
        height: 22px !important;
        font-size: 11px !important;
    }
    
    .fs-rank-bxh[data-rank="1"]::before,
    .fs-rank-bxh[data-rank="2"]::before,
    .fs-rank-bxh[data-rank="3"]::before {
        width: 22px !important;
        height: 22px !important;
    }

    .fs-rank-bxh {
        width: 40px !important;
        padding: 8px 4px !important;
    }

    .fs-leagues-navbar-bxh {
        max-height: 70px;
    }
}

.fs-standings-bxh-table tbody.tbody-bxh tr {
    border-bottom: 1px solid var(--fs-border-color, #2f2f2f);
    transition: all 0.2s ease;
    height: 60px;
}

/* Highlight for the team points */
.fs-points-bxh {
    font-weight: bold;
    color: #29A81E;
    min-width: 40px;
}