/* Fix for table alignment issue using CSS Grid */
.body-tabs__down {
    width: 25%;
    display: grid;
    /* Use auto-fit for better responsiveness across different devices */
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1.25rem;
    align-items: center;
    height: 3.625rem;
    /* Ensure consistent minimum width */
    min-width: 280px;
    max-width: none;
    grid-auto-flow: column;
}

/* Responsive adjustments for the grid */
@media (max-width: 96.875em) {
    .body-tabs__down {
        width: 40%;
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        min-width: 280px;
        max-width: none;
    }
}

@media (max-width: 81.25em) {
    .body-tabs__down {
        margin-left: 1.625rem;
        width: auto;
        gap: 3.125rem;
        /* Use auto-fit for better responsiveness */
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        min-width: 280px;
        max-width: none;
    }
}

/* Ensure buttons maintain their styling within the grid */
.body-tabs__button {
    display: flex;
    align-items: center;
    justify-self: start;
    /* Ensure buttons have consistent width */
    width: 100%;
    min-width: 100px;
    max-width: 150px;
}

/* Handle cases with fewer buttons than grid columns - will be handled by JavaScript */

/* Fix for supported section buttons to maintain proper spacing */
.item__button {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 1.25rem;
    /* Ensure button width doesn't exceed content width */
    width: 100%;
    max-width: 100%;
}

/* Limit supported item width */
.supported__item {
    max-width: 50%;
}



/* Additional fix for very small screens */
@media (max-width: 47.99875em) {
    .body-tabs__down {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 1rem;
        min-width: 200px;
        max-width: none;
    }
    .body-tabs__button {
        min-width: 100px;
        max-width: none;
    }
}

/* Ensure table rows have consistent height */
.body-tabs__item {
    min-height: 3.625rem;
}

/* Ensure the table container has consistent width */
.body-tabs__list {
    width: 100%;
    max-width: 1200px;
    overflow-x: visible;
}

/* Ensure consistent table layout */
.body-tabs__content {
    width: 100%;
    max-width: 1200px;
}

/* Add horizontal scroll for very small screens */
@media (max-width: 47.99875em) {
    .body-tabs__list {
        max-width: 100%;
        min-width: 600px;
    }
    .body-tabs__content {
        max-width: 100%;
        min-width: 600px;
    }
}

/* Remove the old flexbox properties that were causing alignment issues */
.body-tabs__down {
    /* Remove these properties that were causing the alignment issue:
    justify-content: space-between;
    */
}

/* Tab visibility fix - only hide non-active tabs */
.tabs__body:not(._tab-active) {
    display: none;
}

/* Remove vertical scrollbar from table containers */
.body-tabs__list,
.body-tabs__content,
.tabs__body {
    overflow-y: visible !important;
    max-height: none !important;
}

.body-tabs__list.body-tabs__list,
.body-tabs__content.body-tabs__content,
.tabs__body.tabs__body {
    overflow-y: visible;
    max-height: none;
    height: auto;
}

/* Fix table content overflow */
.body-tabs__list table,
.body-tabs__content table {
    height: auto !important;
    max-height: none !important;
}

/* Ensure table cells can expand for long content */
.body-tabs__list td,
.body-tabs__content td {
    height: auto !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    vertical-align: top !important;
    padding: 0.5rem !important;
}

/* Override any fixed height on table rows */
.body-tabs__list tr,
.body-tabs__content tr {
    height: auto !important;
    min-height: auto !important;
}

/* Fix changelog text wrapping */
.body-tabs__list p,
.body-tabs__content p,
.body-tabs__list div,
.body-tabs__content div {
    white-space: normal !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    line-height: 1.4 !important;
    margin: 0.25rem 0 !important;
}

/* Ensure long text content wraps properly */
.body-tabs__list *,
.body-tabs__content * {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
}

/* Ensure table has consistent width */
.body-tabs__list table,
.body-tabs__content table {
    width: 100%;
    table-layout: auto;
    height: auto !important;
    max-height: none !important;
}
