/* ==============================
   Tabs Layout
   ============================== */
.bapi-tabs {
    border-radius: 12px;
    overflow: hidden;
    background: #232939;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.3);
    color: #fff;
}

.bapi-tabs .bapi-tabs-header {
    padding: 14px 20px;
    border-bottom: 1px solid #444;
    background: #1a202c;
}

.bapi-tabs .bapi-tabs-title {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 700;
    color: #caab72;
}

/* Vertical layout */
.bapi-tabs .tabs-vertical-wrapper {
    display: flex;
    min-height: 400px;
}

/* Sidebar (vertical menu) */
.bapi-tabs .tab-sidebar {
    display: flex;
    flex-direction: column;
    width: 220px;
    background: linear-gradient(180deg, #1a202c, #232939);
    border-right: 1px solid #444;
    padding: 10px 0;
    position: relative;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.5);
}

/* Sidebar buttons */
.bapi-tabs .tab-sidebar .tab-btn {
    position: relative;
    padding: 12px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: left;
    border: none;
    background: transparent;
    cursor: pointer;
    color: #ccc;
    margin: 2px 0;
    overflow: hidden;
    border-bottom: #caab72 1px solid;
    transition: all 0.5s ease;
}

/* Hover effect */
.bapi-tabs .tab-sidebar .tab-btn:hover {
    color: #fff;
    background: #2c3346;
    box-shadow: inset 0 0 10px rgba(202, 171, 114, 0.2);
}

/* Active tab */
.bapi-tabs .tab-sidebar .tab-btn.active {
    color: #caab72;
    border-left: 6px solid #caab72;
    background: #2c3346;
    box-shadow: inset 0 0 12px rgba(202, 171, 114, 0.3);
}

/* Arrow indicator */
.bapi-tabs .tab-sidebar .tab-btn::after {
    content: "\25B8";
    /* ▸*/
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%) rotate(0deg);
    transition: transform 0.3s, color 0.3s;
    color: #aaa;
}

.bapi-tabs .tab-sidebar .tab-btn.active::after {
    transform: translateY(-50%) rotate(90deg);
    color: #caab72;
}

/* Optional gradient underline for active */
.bapi-tabs .tab-sidebar .tab-btn.active::before {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #caab72, #fff);
    border-radius: 2px;
    opacity: 0.7;
}

/* Tab content */
.bapi-tabs .tab-content-wrapper {
    flex: 1;
    background: #232939;
    padding: 16px;
    overflow-y: auto;
}

.bapi-tabs .tab-content {
    display: none;
}

.bapi-tabs .tab-content.active {
    display: block;
}

/* ==============================
   Odds Widget Styling
   ============================== */
.betsapi-widget-odds {
    font-family: var(--font-family-base);
    font-size: 13px;
    color: #ddd;
    margin-top: 20px;
    background-color: #2c2f44;
    margin-bottom: 40px;
}

/* Market Title */
.betsapi-widget-odds .market-title {
    font-size: 1.2rem;
    font-weight: 700;
    text-align: center;
    color: #caab72;
    margin: 12px 0 16px;
    padding-bottom: 6px;
    border-bottom: 1px solid #444;
}

/* League container */
.betsapi-widget-odds .league-container {
    margin-bottom: 12px;
    border-radius: 8px;
    overflow: hidden;
    background: #1a202c;
    border: 1px solid #444;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Accordion title */
.betsapi-widget-odds .league-title {
    background: #232939;
    color: #caab72;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 10px 14px;
    border: none;
    text-align: left;
    cursor: pointer;
    width: 100%;
    position: relative;
    transition: all 0.3s;
}

.betsapi-widget-odds .league-title:hover {
    background: #2c3346;
}

.betsapi-widget-odds .league-title::after {
    content: "\25B8";
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    transition: transform 0.2s;
}

.betsapi-widget-odds .league-title.active::after {
    transform: translateY(-50%) rotate(90deg);
}

/* League body */
.betsapi-widget-odds .league-table-container {
    border-radius: 0 0 8px 8px;
    margin-bottom: 0;
    transition: all 1s ease;
}

/* Match block (legacy list style) */
.betsapi-widget-odds .match-container {
    background: #2c3346;
    padding: 10px 12px;
    transition: all 0.3s;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    border-bottom: #caab72 1px solid;
}

.betsapi-widget-odds .match-container:last-child {
    border-radius: 0 0 8px 8px;
    margin-bottom: 0;
    border-bottom: none;
}

/* Team names */
.betsapi-widget-odds .team_names {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 6px;
    color: #fff;
}

.betsapi-widget-odds .team_names .vs {
    margin: 0 6px;
    font-weight: normal;
    color: #aaa;
}

/* Variant wrapper for scroll */
.betsapi-widget-odds .variant-wrapper {
    width: 100%;
    overflow-x: auto;
    position: relative;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    margin-top: 6px;
}

/* Variant block */
.betsapi-widget-odds .variant {
    margin-bottom: 8px;
}

.betsapi-widget-odds .variant-name {
    font-size: 12px;
    font-weight: 600;
    color: #caab72;
    margin-bottom: 4px;
}

/* ===== Odds grid ===== */
.odd-header,
.odd-row {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: 4px;
    font-size: 12px;
    align-items: center;
    text-align: center;
}

/* Columns */
.odd-col {
    padding: 6px 8px;
    white-space: nowrap;
    box-sizing: border-box;
}

.odd-col.highlighted {
    background: #caab72;
    border-radius: 6px;
    transition: background 0.8s ease;
}

.odd-col-link,
.odd-col-link:hover,
.odd-col-link:visited,
.odd-col-link:active {
    color: #FFF !important;
    text-decoration: none !important;
}

.odd-col-arrow {
    display: inline-block;
    margin-left: 4px;
    font-size: 0.8em;
    vertical-align: middle;
}

.odd-up {
    color: #4caf50;
}

.odd-down {
    color: #f44336;
}

/* Header styling */
.odd-header {
    font-weight: 600;
    color: #aaa;
    border-bottom: 1px solid #444;
    padding-bottom: 6px;
    margin-bottom: 6px;
}

/* Row styling */
.odd-row {
    padding: 6px 0;
    transition: all 0.3s;
}

.odd-row:hover {
    background: #3a3f57;
    border-radius: 6px;
}

.odd-row .odd-col:hover {
    background: #caab72;
    color: #232939;
    font-weight: 700;
    transition: all 0.3s;
    border-radius: 6px;
}

/* Custom scrollbar */
.betsapi-widget-odds .variant-wrapper::-webkit-scrollbar {
    height: 6px;
}

.betsapi-widget-odds .variant-wrapper::-webkit-scrollbar-track {
    background: #2c3346;
    border-radius: 3px;
}

.betsapi-widget-odds .variant-wrapper::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 3px;
}

.betsapi-widget-odds .variant-wrapper::-webkit-scrollbar-thumb:hover {
    background: #caab72;
}

.bapi-odds .tab-content {
    background-color: #1a1f2d;
}

.sabah-content.updated {
    box-shadow: 0 0 8px #caab72;
    transition: box-shadow 0.5s;
}

@keyframes flash {
    0% {
        background-color: rgba(202, 171, 114, 0.2);
    }

    100% {
        background-color: transparent;
    }
}

.tab-sidebar-wrapper .tab-scroll-left,
.tab-sidebar-wrapper .tab-scroll-right {
    display: none;
}

/* ==============================
   New Card Odds Layout
   ============================== */
.betsapi-widget-odds.odds_ah_card .odds-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.betsapi-widget-odds.odds_ah_card .match-card {
    background: #1a202c;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 220px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    height: 100%;
    width: 100%;
}

.betsapi-widget-odds.odds_ah_card .match-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.betsapi-widget-odds.odds_ah_card .match-datetime {
    font-size: 12px;
    color: #aaa;
    margin-bottom: 8px;
    text-align: center;
}

.betsapi-widget-odds.odds_ah_card .teams {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    gap: 8px;
}

.betsapi-widget-odds.odds_ah_card .team-name {
    font-weight: 600;
    color: #fff;
    font-size: 14px;
    line-height: 1.3;
}

.betsapi-widget-odds.odds_ah_card .team img {
    width: 80px;
    height: auto;
    margin-top: 4px;
}

.betsapi-widget-odds.odds_ah_card .odds-buttons {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: auto;
}

.betsapi-widget-odds.odds_ah_card .odd-col-link {
    flex: 1;
    display: block;
    background: #232939;
    color: #DDD !important;
    padding: 10px 0;
    border-radius: 6px;
    font-weight: 600;
    text-align: center;
    font-size: 14px;
    transition: background 0.2s ease;
    border: 1px solid #caab72;
}

.betsapi-widget-odds.odds_ah_card .odd-col-link:hover {
    background: #caab72;
    color: #232939 !important;
}

/* ==============================
   Responsive for Mobile
   ============================== */
@media (max-width: 991px) {
    .bapi-tabs .tabs-vertical-wrapper {
        flex-direction: column;
        min-height: auto;
    }

    .bapi-tabs .tab-sidebar {
        width: 100%;
        flex-direction: row;
        overflow-x: auto;
        border-right: none;
        border-bottom: 1px solid #444;
        box-shadow: none;
        padding: 0 30px;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
    }

    .bapi-tabs .tab-sidebar .tab-btn {
        flex: 0 0 auto;
        margin: 0 2px;
        border: none;
        border-radius: 0;
        text-align: center;
        padding: 10px 16px;
        font-size: 0.9rem;
    }

    .bapi-tabs .tab-sidebar .tab-btn.active {
        border-left: none;
        border-right: 3px solid #caab72;
        border-bottom: none;
    }

    .bapi-tabs .tab-content-wrapper {
        padding: 12px;
    }

    .tab-sidebar-wrapper {
        position: relative;
        overflow: hidden;
    }

    .tab-sidebar-wrapper::before,
    .tab-sidebar-wrapper::after {
        content: "";
        position: absolute;
        top: 0;
        bottom: 0;
        width: 20px;
        pointer-events: none;
        z-index: 2;
        transition: opacity 0.3s;
    }

    .tab-sidebar-wrapper::before {
        left: 0;
        background: linear-gradient(to right, #232939, transparent);
        opacity: 0;
    }

    .tab-sidebar-wrapper.show-left-indicator::before {
        opacity: 1;
    }

    .tab-sidebar-wrapper::after {
        right: 0;
        background: linear-gradient(to left, #232939, transparent);
        opacity: 0;
    }

    .tab-sidebar-wrapper.show-right-indicator::after {
        opacity: 1;
    }

    .tab-sidebar-wrapper {
        display: flex;
        align-items: center;
    }

    .tab-sidebar-wrapper .tab-sidebar {
        flex: 1;
        overflow-x: auto;
        display: flex;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
        padding: 0;
    }

    .tab-sidebar-wrapper .tab-scroll-left,
    .tab-sidebar-wrapper .tab-scroll-right {
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
        width: 32px;
        background: rgba(35, 41, 57, 0.8);
        color: #caab72;
        border: none;
        font-size: 16px;
        cursor: pointer;
        z-index: 3;
        transition: background 0.3s;
        flex: 0 0 32px;
        padding: 0 !important;
    }

    .tab-sidebar-wrapper .tab-scroll-left:hover,
    .tab-sidebar-wrapper .tab-scroll-right:hover {
        background: rgba(35, 41, 57, 1);
    }

    .tab-sidebar-wrapper .tab-scroll-left {
        left: 0;
        border-top-left-radius: 6px;
        border-bottom-left-radius: 6px;
    }

    .tab-sidebar-wrapper .tab-scroll-right {
        right: 0;
        border-top-right-radius: 6px;
        border-bottom-right-radius: 6px;
    }

    @media (min-width: 992px) {

        .tab-sidebar-wrapper .tab-scroll-left,
        .tab-sidebar-wrapper .tab-scroll-right {
            display: none;
        }
    }
}

@media (max-width: 575px) {
    .layout-container {
        padding: 0;
    }

    .bapi-tabs .tab-sidebar .tab-btn {
        padding: 5px 5px;
        font-size: 0.8rem;
        border-left: #caab72 1px solid;
    }

    .betsapi-widget-odds {
        font-size: 12px;
    }

    .betsapi-widget-odds .team_names {
        font-size: 13px;
    }

    .betsapi-widget-odds .variant-wrapper {
        padding-bottom: 2px;
    }

    .betsapi-widget-odds .odd-col {
        padding: 4px 6px;
        font-size: 11px;
    }
}

/* ==============================
   Single Odds Card (728x300 Desktop)
   ============================== */
.betsapi-widget-odds.odds_ah_card .match-card-single {
    position: relative;
    width: 100%;
    max-width: 728px;
    min-height: 300px;
    margin: 0 auto;
    background: #1a202c url('../img/ah-card-single.jpg') no-repeat center center;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-sizing: border-box;
}

.betsapi-widget-odds.odds_ah_card .match-header {
    position: absolute;
    top: 12px;
    right: 16px;
}

.betsapi-widget-odds.odds_ah_card .match-header .match-date {
    font-size: 0.85rem;
    color: #caab72;
    font-weight: 600;
}

.betsapi-widget-odds.odds_ah_card .teams-section {
    display: flex;
    justify-content: space-around;
    align-items: center;
    flex: 1;
    text-align: center;
    margin-top: 30px;
    width: 50%
}

.betsapi-widget-odds.odds_ah_card .team {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.betsapi-widget-odds.odds_ah_card .team-name {
    font-weight: 700;
    color: #fff;
    font-size: 1.2rem;
    margin-bottom: 8px;
}

.betsapi-widget-odds.odds_ah_card .team img {
    width: 100px;
    height: auto;
    border-radius: 6px;
    background: #232939;
    object-fit: contain;
}

.betsapi-widget-odds.odds_ah_card .vs-block {
    flex: 0 0 auto;
    font-size: 1.8rem;
    color: #caab72;
    font-weight: 700;
}

.betsapi-widget-odds.odds_ah_card .odds-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 24px;
}

.betsapi-widget-odds.odds_ah_card .odd-box {
    flex: 1;
    /* all boxes take equal width */
    display: flex;
    justify-content: space-between;
    /* label left, value right */
    align-items: center;
    padding: 10px;
    background: #232939;
    border: 1px solid #caab72;
    border-radius: 6px;
    font-weight: 600;
    color: #fff;
    font-size: 14px;
    box-sizing: border-box;
}

.betsapi-widget-odds.odds_ah_card .odd-box:hover {
    background: #caab72;
    color: #232939;
}

.betsapi-widget-odds.odds_ah_card .odd-box:hover .label {
    color: #232939;
}

.betsapi-widget-odds.odds_ah_card .odd-box .label {
    display: block;
    font-size: 0.9rem;
    color: #caab72;
    margin-bottom: 4px;
}

.betsapi-widget-odds.odds_ah_card .odd-box .value {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
    margin-left: 5px;
}

/* ==============================
   Responsive (Mobile)
   ============================== */
@media (max-width: 768px) {
    .betsapi-widget-odds.odds_ah_card .match-card-single {
        min-height: auto;
        padding: 12px;
        background-position: center top;
    }

    .betsapi-widget-odds.odds_ah_card .teams-section {
        flex-direction: column;
        gap: 12px;
        margin-top: 24px;
        width: 100%
    }

    .betsapi-widget-odds.odds_ah_card .vs-block {
        margin: 8px 0;
    }

    .betsapi-widget-odds.odds_ah_card .team img {
        width: 80px;
    }

    .betsapi-widget-odds.odds_ah_card .odds-row {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        gap: 8px;
        /* space between boxes */
    }

    .betsapi-widget-odds.odds_ah_card .odd-box {
        padding: 8px 0;
    }

    .betsapi-widget-odds.odds_ah_card .odd-box .label {

        margin-left: 4px;
    }

    .betsapi-widget-odds.odds_ah_card .odd-box .value {
        /* font-size: 1.1rem; */
        margin-right: 4px;
    }
}

/* ==============================
   Odds Outright Widget (Admin Page)
   ============================== */
.betsapi-widget-odds.odds-outright {
    font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
    color: #fff;
    background: #1a202c;
    border-radius: 6px;
    overflow: hidden;
    margin: 0 !important;
}

.betsapi-widget-odds.odds_ah_card,
.betsapi-widget-odds.odds_ah_card_single {
    background: none;
}

/* Header */
.betsapi-widget-odds.odds-outright .widget-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #caab72;
    padding: 1rem;
    border-bottom: 2px solid #caab72;
}

/* Market block */
.betsapi-widget-odds.odds-outright .market-block {
    border-bottom: 1px solid #2c3242;
}

/* Header as button (accessible) */
.betsapi-widget-odds.odds-outright .market-header-button {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    border: none;
    background: #232939;
    color: #caab72;
    padding: 0.9rem 1rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: background 0.3s ease;
}

.betsapi-widget-odds.odds-outright .market-header-button:hover {
    background: #2e3648;
}

.betsapi-widget-odds.odds-outright .market-header-button:focus {
    outline: 2px solid rgba(202, 171, 114, 0.25);
    outline-offset: 2px;
}

.betsapi-widget-odds.odds-outright .market-header-button .toggle-icon {
    transition: transform 0.25s ease;
    font-size: 1.2rem;
}

.betsapi-widget-odds.odds-outright .market-header-button.open .toggle-icon {
    transform: rotate(180deg);
}

/* Body (animated open/close) */
.betsapi-widget-odds.odds-outright .market-body {
    background: #2c3242;
    overflow: hidden;
    max-height: none;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding: 0.5rem 0;
}

/* Team row */
.betsapi-widget-odds.odds-outright .team-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-decoration: none;
    color: #fff;
    padding: 0.75rem 1rem;
    transition: background 0.18s ease;
    background-color: #DDD;
    border-bottom: solid 1px #111827;
}

.betsapi-widget-odds.odds-outright .team-row:hover {
    background: #3b4257;
}

.betsapi-widget-odds.odds-outright .team-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.betsapi-widget-odds.odds-outright .team-flag img {
    width: 36px;
    height: 24px;
    object-fit: cover;
    border-radius: 4px;
    background: #fff;
}

.betsapi-widget-odds.odds-outright .team-name {
    font-weight: 500;
    font-size: 1rem;
}

/* Odds pill on right */
.betsapi-widget-odds.odds-outright .team-odds {
    background: #232939;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-weight: 700;
    color: #caab72;
    margin-left: 1rem;
    white-space: nowrap;
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.betsapi-widget-odds.odds-outright .team-row:hover .team-odds {
    background: #caab72;
    color: #232939;
    transform: scale(1.02);
}

/* Responsive */
@media (max-width: 768px) {
    .betsapi-widget-odds.odds-outright .team-flag img {
        width: 28px;
        height: 18px;
    }

    .betsapi-widget-odds.odds-outright .team-name {
        font-size: 0.95rem;
    }

    .betsapi-widget-odds.odds-outright .team-odds {
        font-size: 0.9rem;
    }
}