/* ============================================
   EMERGENCY FIX - PREVENT ALL TAB OVERLAPS
   ============================================ */

/* Force separation between tabs and content */
body {
    overflow-x: hidden;
}

/* Main container fixes */
.STING-WEB-Match-Page {
    position: relative;
    overflow: visible;
}

/* Tab navigation container - CRITICAL FIX */
.nav-tabs-main-container {
    position: relative !important;
    z-index: 200 !important;
    margin-bottom: 40px !important;
    padding-bottom: 20px !important;
    background: var(--A-Color) !important;
    border-bottom: 2px solid var(--Primary-D-Color) !important;
}

/* Tab wrapper */
.nav-tabs-wrapper {
    position: relative !important;
    z-index: 201 !important;
}

/* Individual tabs */
.STING-WEB-Event-Toggle {
    position: relative !important;
    z-index: 202 !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
    padding: 10px !important;
}

/* Tab buttons - FORCE NO OVERLAP */
.STING-WEB-Toggle-Event-Button {
    position: relative !important;
    z-index: 203 !important;
    margin: 5px !important;
    pointer-events: auto !important;
}

/* Content sections - FORCE BELOW TABS */
.STING-WEB-Hadafin,
.STING-WEB-Feraq,
.STING-WEB-Statistics,
.STING-WEB-Team,
.STING-WEB-H2H,
.STING-WEB-Match-Events,
.STING-WEB-Match-News {
    position: relative !important;
    z-index: 1 !important;
    margin-top: 40px !important;
    padding-top: 30px !important;
    clear: both !important;
}

/* Scorers/Standings specific tabs */
.Team-Buttons {
    position: relative !important;
    z-index: 150 !important;
    margin-bottom: 40px !important;
    padding: 15px !important;
    background: var(--B-Color) !important;
    border-radius: 12px !important;
    display: flex !important;
    gap: 15px !important;
    flex-wrap: wrap !important;
}

.Team-Button {
    position: relative !important;
    z-index: 151 !important;
    margin: 0 !important;
    padding: 12px 24px !important;
    background: var(--C-Color) !important;
    border: 2px solid var(--Primary-D-Color) !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    font-weight: 700 !important;
    color: var(--Primary-B-Color) !important;
}

.Team-Button:hover {
    background: rgba(227, 30, 36, 0.1) !important;
    border-color: var(--Primary-A-Color) !important;
}

.Team-Button.Lenup,
.Team-Button.active {
    background: var(--Primary-A-Color) !important;
    color: #fff !important;
    border-color: var(--Primary-A-Color) !important;
}

/* Content below Team-Buttons */
.Team-Buttons+* {
    margin-top: 30px !important;
    clear: both !important;
}

/* Tables and lists - ensure they're below tabs */
table,
.standings-table,
.scorers-list,
.STING-WEB-Standings-Table,
.STING-WEB-Scorers-List {
    position: relative !important;
    z-index: 1 !important;
    margin-top: 20px !important;
    clear: both !important;
}

/* Prevent any floating elements from overlapping */
.clearfix::after {
    content: "";
    display: table;
    clear: both;
}

/* Add clearfix to all sections */
.STING-WEB-Hadafin::before,
.STING-WEB-Feraq::before,
.STING-WEB-Statistics::before {
    content: "";
    display: block;
    height: 30px;
    clear: both;
}

/* Mobile specific fixes */
@media (max-width: 768px) {
    .nav-tabs-main-container {
        margin-bottom: 30px !important;
    }

    .Team-Buttons {
        flex-direction: row !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        padding: 10px !important;
    }

    .Team-Button {
        flex-shrink: 0 !important;
        white-space: nowrap !important;
    }

    .STING-WEB-Hadafin,
    .STING-WEB-Feraq,
    .STING-WEB-Statistics {
        margin-top: 30px !important;
        padding-top: 20px !important;
    }
}

/* Force layout recalculation */
.STING-WEB-Match-Page * {
    box-sizing: border-box;
}

/* Ensure no absolute positioning conflicts */
.STING-WEB-Hadafin>*,
.STING-WEB-Feraq>*,
.STING-WEB-Statistics>* {
    position: relative;
}