/* Restore Bootstrap-select toggle button styling after WP 6.9.1 resets */
.bench-search-form .bootstrap-select > .dropdown-toggle {
    padding: 0.563rem 2.18rem;
    border-radius: 8px;
    background-color: #f2f2f2;
    border: 1px solid #ccc;
    width: 100%;
    text-align: center;
    color: #212529;
}

/* Ensure the native select stays hidden */
.bench-search-form select.selectpicker {
    display: none;
}

/* Restore dropdown menu styling */
.bench-search-form .bootstrap-select .dropdown-menu {
    border-radius: 4px;
    border: 1px solid #ccc;
    max-width: 100%;
    z-index: 2000;
    padding: 0;
}

/* Fix filter-option alignment */
.bench-search-form .bootstrap-select .filter-option {
    text-align: center;
}


/* Restore Compare Workstation select styling after WP 6.9.1 resets */
.compare-workstation__select {
    width: 100%;
    max-width: 300px;
    padding: 0.75rem;
    border: 1px solid #dddddd;
    border-radius: 4px;
    font-size: 1rem;
    background-color: #ffffff;
    color: #333333;
    appearance: none;
    background-image: none;
}

/* Fix focus state */
.compare-workstation__select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}


/* Restore Histogram Compare select styling after WP 6.9.1 resets */
.bench-histogram-compare .bench-histogram-compare__select {
    width: 100%;
    max-width: 300px;
    padding: 0.75rem;
    border: 1px solid #dddddd;
    border-radius: 4px;
    font-size: 1rem;
    background-color: #ffffff;
    color: #333333;
    appearance: none;
    background-image: none;
    margin-bottom: 1rem;
}

/* Fix focus state */
.bench-histogram-compare .bench-histogram-compare__select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}


/* Restore Bench Scores Table styling after WP 6.9.1 resets */
#scores-table .scores-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

#scores-table .scores-table thead {
    border: 1px solid #dee2e6;
    border-bottom: 3px solid black;
    color: #130c64;
    text-align: left;
}

#scores-table .scores-table th {
    padding: 0.75rem;
    vertical-align: bottom;
    background: #fff;
}

#scores-table .scores-table td {
    padding: 0.75rem;
    color: #212529;
    border-bottom: 1px solid #dee2e6;
}

#scores-table .table-border tr:nth-child(even) {
    background-color: #f2f2f2;
}

#scores-table .table-border {
    border: 1px solid rgba(0,0,0,.125);
}

#scores-table .scores-table tbody tr.major-score-divider {
    border-top: 3px solid #CCC;
}

#scores-table .scores-table-icon {
    margin-top: -4px;
}

.table-section > h4 {
    margin-top: 2rem;
}


/* Restore Recent Uploads table styling after WP 6.9.1 resets */
.table-section .recent-results-table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    background-color: #fff;
    table-layout: fixed;
    border: 1px solid #dee2e6;
    min-width: 600px;
}

/* Header styling */
.table-section .recent-results-table thead {
    border-bottom: 3px solid #000;
}

.table-section .recent-results-table th {
    padding: 12px;
    border: 1px solid #dee2e6;
    vertical-align: bottom;
    background-color: #fff;
    font-weight: 600;
    color: #333;
}

/* Body cells */
.table-section .recent-results-table td {
    padding: 12px;
    border: 1px solid #dee2e6;
    vertical-align: top;
    word-wrap: break-word;
    word-break: normal;
}

/* Alternating row colors */
.table-section .recent-results-table tbody tr:nth-child(odd) {
    background-color: #f8f9fa;
}

/* Hover state */
.table-section .recent-results-table tbody tr:hover td {
    background-color: #ddd;
}

/* DataTables wrapper fixes */
.table-section .dt-wrapper {
    width: 100%;
    margin: 5px;
}

.table-section .dt-paging {
    display: block;
}

.table-section .dt-info {
    margin-top: 5px;
    display: block;
    float: right;
}


/* Bench Individual Results */
.bench-individual-results .result-label {
    font-weight: 600;
    color:#130c64;
    font-size: 1.25rem;
}

.bench-individual-results .result-value {
    color:#130c64;
    font-size: 1.25rem;
}

.score-cards {
    border-radius: 1.125rem;
    border: 1px solid #130c64;
    padding-bottom: 10px;
}

.scores-row .result-label {
    background-color: #f2f2f2;
    border-top-left-radius: 1.125rem;
    border-top-right-radius: 1.125rem;
    color: #130c64;
    padding: 8px 0;
    font-weight: 600;
    border-bottom: 1px solid rgba(0,0,0,.125);
}

.scores-row .result-value {
    color: #130c64;
    font-weight: bold;
    padding-bottom: 8px;
}

.versions-row,
.cpu-gpu-row {
    background-color: #f2f2f2;
    padding-top: 10px;
    margin-bottom: 10px;
}

.full-details-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
}

.button-wrapper {
    background-color: #f2f2f2;
    padding-top: 8px;
    padding-bottom: 8px;
}

.full-details-button {
    border: none;
    color: #130c64;
    font-weight: 700;
    font-size: 1.25rem;
}

.toggle-icon {
    transition: transform 0.2s ease;
}

.full-details-button.active .toggle-icon {
    transform: rotate(90deg);
}

.full-details-tables.show-tables {
    display: block;
}

.full-details-content {
    transition: all 0.3s ease;
}

.full-details-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.full-details-table th {
    color: #130c64;
    padding: 0.75rem;
    text-align: left;
}

.full-details-table td {
    padding: 0.75rem;
    color: #212529;
    border-bottom: 1px solid #dee2e6;
}

.full-details-label {
    font-weight: 400;
}

.full-details-result {
    font-weight: 300;
}

.table-border tr:nth-child(even) {
    background-color: #f2f2f2;
}

.table-border {
    border: 1px solid rgba(0,0,0,.125);
}

.bench-individual-results .error-message {
    padding: 1rem;
    background-color: #d8e4ff;
    color: #c00;
    border-radius: 4px;
    text-align: center;
}

@media screen and (max-width: 425px) {
    .cpu-gpu-row .result-value {
        font-size: 1rem;
    }
}

@media screen and (max-width: 350px) {
    .cpu-gpu-row .result-value {
        font-size: .875rem;
    }
}


/* Restore Bench Parts Histogram select styling after WP 6.9.1 resets */
.bench-histogram .bench-histogram__select {
    width: 100%;
    max-width: 300px;
    padding: 0.75rem;
    border: 1px solid #dddddd;
    border-radius: 4px;
    font-size: 1rem;
    background-color: #ffffff;
    color: #333333;
    appearance: none;
    background-image: none;
    margin-bottom: 1rem;
}

/* Fix focus state */
.bench-histogram .bench-histogram__select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

.bench-top-results__chart {
    max-width: 928px;
    margin: 0 1rem;
    border: 2px solid #CCC;
    border-radius: 8px;
    padding: 10px;
}

/* Restore PugetBench button styling after WP 6.9.1 */
.wp-block-buttons .wp-block-button__link.has-black-color.has-white-background-color {
    width: 100%;
    background-color: #f2f2f2;
    color: #000000;
    border-radius: 9999px;
    padding: calc(.667em + 2px) calc(1.333em + 2px);
    font-size: 1.125em;
    text-decoration: none;
    box-shadow: none;
    display: inline-block;
    text-align: center;
    box-sizing: border-box;
    cursor: pointer;
}

.wp-block-buttons .wp-block-button__link.has-black-color.has-white-background-color:hover {
    text-decoration: underline;
}

.wp-block-buttons .wp-block-button__link.has-black-color.has-white-background-color:focus {
    outline: none;
    box-shadow: 0 0 0 2px #0073aa;
}

/* Ultimate Blocks Fixes */

.wp-block-ub-tabbed-content-tab-holder.horizontal-tab-width-mobile.horizontal-tab-width-tablet {
    display: block;
    width: 100%;
}

.wp-block-ub-tabbed-content-tabs-title,
.wp-block-ub-tabbed-content-tabs-title-mobile-horizontal-tab,
.wp-block-ub-tabbed-content-tabs-title-tablet-horizontal-tab {
    display: flex;
    flex-wrap: nowrap;
    gap: 0;
    border-bottom: 1px solid #ccc;
    margin-bottom: 1rem;
}


.wp-block-ub-tabbed-content-tab-title-wrap {
    padding: 0.75rem 1.25rem;
    background: var(--ub-tabbed-title-background-color, #f7f7f7);
    color: var(--ub-tabbed-title-color, #333);
    border: 1px solid #ccc;
    border-bottom: none;
    cursor: pointer;
    font-weight: 600;
    user-select: none;
    text-align: left;
    white-space: nowrap;
}

.wp-block-ub-tabbed-content-tab-title-wrap.active {
    background: var(--ub-tabbed-active-title-background-color, #160c64);
    color: var(--ub-tabbed-active-title-color, #fff);
    border-bottom: 1px solid #fff;
}


.wp-block-ub-tabbed-content-tab-content {
    display: none;
    padding: 1.25rem;
    border: 1px solid #ccc;
    background: #fff;
}


.wp-block-ub-tabbed-content-tab-content.active {
    display: block;
}

.wp-block-ub-tabbed-content-tab-title-wrap,
.wp-block-ub-tabbed-content-tab-content {
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.5;
}


.wp-block-ub-tabbed-content-tab-title-wrap.wp-element-button {
    all: unset;
    display: block;
    padding: 0.75rem 1.25rem;
    cursor: pointer;
}

/* Ultimate Blocks: ensure inactive tab panels are hidden */
.wp-block-ub-tabbed-content-tab-content-wrap.ub-hide {
  display: none;
}

/* Extra safety: if UB changes to .active instead of ub-hide
* Select every .wp-block-ub-tabbed-content-tab-content-wrap element that does NOT have the class .active, and hide it.
*/
.wp-block-ub-tabbed-content-tab-content-wrap:not(.active) {
  display: none;
}

.wp-block-ub-tabbed-content-tab-content-wrap.active {
  display: block;
}