/**
 * Country Benchmark Template Styles
 * Template: page-country-benchmark.php
 * 
 * This file contains all styles specific to the Country Benchmark template,
 * including hero section, table layout, tabs, filters, and pagination.
 */

/* ==========================================
   Country Benchmark Table
   ========================================== */
.ast-container .country-benchmark-table{
    display: block !important;
}
.country-benchmark-table {
    max-width: 1240px;
    margin: 0 auto;
    padding: 24px 20px;
}

@media (min-width: 922px) {
    .country-benchmark-table {
        padding: 32px 40px;
    }
}

.country-benchmark-table__header {
    font-family: Fira Sans;
    font-weight: 700;
    font-size: 24px;
    line-height: 100%;
    letter-spacing: 0;
    color: #000000;
    margin-bottom: 24px;
}

@media (min-width: 1024px) {
    .country-benchmark-table__header {
        font-size: 32px;
    }
}


/* ==========================================
   Section Header
   ========================================== */
.country-benchmark-table__header {
    font-family: Fira Sans;
    font-size: 28px;
    font-weight: 700;
    color: #000000;
    margin-bottom: 24px;
    line-height: 1.2;
}

/* ==========================================
   Tabs Styling
   ========================================== */
.country-benchmark-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    justify-content: center;
    background-color: #f1f1f1;
    padding: 8px;
    border-radius: 12px;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.country-benchmark-tab {
    background: transparent;
    border: none;
    border-radius: 8px;
    color: #000;
    cursor: pointer;
    font-family: Fira Sans;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    padding: 8px 25px;
    transition: all 0.2s ease;
    box-shadow: none;
}

.country-benchmark-tab:hover {
    background-color: transparent;
    color: var(--text-primary);
}

.country-benchmark-tab.active {
    background-color: #00188c;
    color: #fff;
    font-weight: 600;
}

/* ==========================================
   Filter Styling
   ========================================== */
.country-benchmark-filter {
    margin-bottom: 24px;
    display: flex;
    justify-content: flex-end;
    width: 100%;
    max-width: 250px;
}

.country-filter__select-wrapper {
    max-width: 300px;
    width: 100%;
}

.country-filter__select-wrapper .choices {
    margin-bottom: 0;
}

.country-filter__select-wrapper .choices__inner {
    background: #fff;
    border: 1px solid #d9dcee;
    border-radius: 6px;
    font-family: Fira Sans;
    font-size: 14px;
    padding: 8px 12px;
    min-height: 44px;
}

.country-filter__select-wrapper .choices__list--multiple .choices__item {
    background-color: #00188c;
    border: 1px solid #00188c;
    border-radius: 4px;
    color: #fff;
    font-size: 13px;
    padding: 4px 8px;
    margin-right: 4px;
    margin-bottom: 4px;
}

.country-filter__select-wrapper .choices__list--dropdown .choices__item--selectable {
    padding: 8px 12px;
    font-size: 14px;
}

.country-filter__select-wrapper .choices__list--dropdown .choices__item--selectable.is-highlighted {
    background-color: #e6e8f4;
    color: #001370;
}
.country-benchmark-filter .choices__inner {
    padding: 0;
}

.country-benchmark-filter input.choices__input.choices__input--cloned {
    margin: 0;
    border: unset;
}
/* ==========================================
   Table Styling
   ========================================== */
#benchmarkTable {
    margin-bottom: 24px;
    border: none !important;
    border-radius: 12px;
    box-shadow: none !important;
    background: transparent;
    border-bottom: 1px solid #E2E8F0 !important;
}

#benchmarkTable .tabulator {
    border: none !important;
    border-radius: 12px;
    font-family: Fira Sans;
    overflow: hidden;
    background-color: #fff;
    box-shadow: none !important;

}

#benchmarkTable .tabulator-header .tabulator-col:first-child {
    border-top-left-radius: 12px;
}

#benchmarkTable .tabulator-header .tabulator-col:last-child {
    border-top-right-radius: 12px;
}

#benchmarkTable .tabulator-row:last-child .tabulator-cell:first-child {
    border-bottom-left-radius: 12px;
}

#benchmarkTable .tabulator-row:last-child .tabulator-cell:last-child {
    border-bottom-right-radius: 12px;
}

#benchmarkTable .tabulator-tableHolder {
    overflow: visible;
}

#benchmarkTable .tabulator-table {
    width: 100%;
}

/* Table Header */
#benchmarkTable .tabulator-header {
    background-color: #e6e8f4;
    border-bottom: none;
}

#benchmarkTable .tabulator-col {
    background-color: #e6e8f4;
    border-right: 1px solid #B0B7DB;
    padding: 0;
    height: 52px !important;
}

#benchmarkTable .tabulator-col:first-child {
    background-color: #B0B7DB;
}

#benchmarkTable .tabulator-col:not(:first-child) {
    border-bottom: 1px solid #B0B7DB;
}
.country-benchmark-table__header-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--border-boder);
    margin-bottom: 20px;
}
.tabulator-col-content img.emoji {
    height: 2em !important;
    width: 1.5em !important;
}
#benchmarkTable .tabulator-col-content {
    padding: 8px 12px;
    height: 52px;
    box-sizing: border-box;
    display: flex;
    display: flex;
    align-items: center;
}

#benchmarkTable .tabulator-col:first-child .tabulator-col-content {
    font-weight: 700;
    font-size: 14px;
    color: #001370;
    text-align: left;
    padding-left: 24px;
}

/* Country Header (Flag + Name) */
#benchmarkTable .country-header {
    text-align: center;
    font-size: 20px;
    line-height: 1;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

#benchmarkTable .country-header span {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #001370;
    margin-top: 0;
}

/* Table Rows */
#benchmarkTable .tabulator-row {
    border-bottom: none;
    height: 52px !important;
}

.tabulator-col.tabulator-frozen.tabulator-frozen-left{
    border-bottom: 1px solid #00188c;
}

#benchmarkTable .tabulator-row:hover {
    background-color: transparent;
}

/* Table Cells */
#benchmarkTable .tabulator-cell {
    padding: 16px 12px;
    text-align: left;
    font-size: 14px;
    line-height: 20px;
    color: #001370;
    border-right: 1px solid #d9dcee;
    background-color: #fff;
    border-bottom: 1px solid #d9dcee;
    height: 52px !important;
    box-sizing: border-box;
}

/* Remove border-bottom for last row cells */
#benchmarkTable .tabulator-row:last-child .tabulator-cell {
    border-bottom: none;
}

#benchmarkTable .tabulator-cell:last-child {
    border-right: none;
}

#benchmarkTable .tabulator-cell:first-child {
    text-align: left;
    font-weight: 600;
    background-color: #B0B7DB;
    color: #001370;
    padding-left: 24px;
    padding-right: 24px;
    font-size: 14px;
    border-bottom: 1px solid #00188c;
    position: relative;
}

#benchmarkTable .tabulator-row:last-child .tabulator-cell:first-child {
    border-bottom: none;
}

#benchmarkTable .metric-cell-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 100%;
    gap: 8px;
}

#benchmarkTable .metric-cell-content strong {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#benchmarkTable .tabulator-col:first-child .tabulator-col-content {
    padding-left: 54px !important;
    padding-right: 24px;
}

#benchmarkTable .tabulator-row .tabulator-cell:first-child .metric-cell-content {
    padding-left: 0;
}
.tabulator-frozen-left .tabulator-col-title-holder {
    width: 100%;
}
#benchmarkTable .metric-delete-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #64748b;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    flex-shrink: 0;
    opacity: 0.6;
    min-width: 22px;
    width: 22px;
}

#benchmarkTable .tabulator-frozen-left .metric-cell-content.country-header-sort {
    justify-content: space-between;
    width: 100%;
}
#benchmarkTable .metric-delete-btn:hover {
    background-color: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    opacity: 1;
}

#benchmarkTable .metric-delete-btn svg {
    display: block;
}

#benchmarkTable .metric-sort-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 6px;
    margin-left: 8px;
    font-size: 10px;
    color: #001370;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    flex-shrink: 0;
    min-width: 30px;
    width: 30px;
    height: 30px;
}

#benchmarkTable .metric-sort-btn:hover {
    background-color: rgba(0, 19, 112, 0.1);
}

#benchmarkTable .metric-sort-btn .sort-icon {
    display: inline-block;
    line-height: 1;
    font-style: normal;
    width: 16px;
    text-align: center;
}

#benchmarkTable .metric-sort-btn .sort-icon.sort-active {
    color: #00188c;
    font-weight: bold;
    font-size: 12px;
}

.tabulator-col.tabulator-frozen.tabulator-frozen-left{
    background-color: #B0B7DB;
}

#benchmarkTable .tabulator-row .tabulator-cell.country-col-even {
    background-color: #FFF !important;
}

#benchmarkTable .tabulator-row .tabulator-cell.country-col-odd {
    background-color: #F1F1F1 !important;
}

/* View Profile Links */
#benchmarkTable .view-profile-link {
    color: #00188c;
    text-decoration: underline;
    font-weight: 500;
    transition: color 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

#benchmarkTable .view-profile-link svg {
    flex-shrink: 0;
    vertical-align: middle;
}

#benchmarkTable .view-profile-link:hover {
    color: #000e54;
    text-decoration: none;
}

/* ==========================================
   Pagination & Reset Button
   ========================================== */
#country-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    gap: 16px;
}

.btn-reset-filters {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background-color: transparent;
    border: 1px solid #d9dcee;
    border-radius: 6px;
    color: #64748b;
    font-family: 'Fira Sans', sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-reset-filters:hover {
    background-color: #f8fafc;
    border-color: #cbd5e1;
    color: #475569;
}

.btn-reset-filters svg {
    flex-shrink: 0;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ==========================================
   Responsive Adjustments
   ========================================== */
@media (max-width: 768px) {
    #country-pagination {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .btn-reset-filters {
        width: auto;
        justify-content: flex-start;
        align-self: flex-start;
    }

    .pagination {
        justify-content: center;
        align-self: stretch;
    }

    .country-benchmark-tabs {
        flex-wrap: wrap;
    }

    .country-benchmark-tab {
        flex: 1;
        min-width: 140px;
        padding: 10px 16px;
    }

    #benchmarkTable .tabulator-cell {
        font-size: 12px;
        padding: 8px 4px;
    }

    #benchmarkTable .country-header {
        font-size: 20px;
    }

    #benchmarkTable .country-header span {
        font-size: 12px;
    }

    #benchmarkTable .metric-cell-content {
        display: grid;
        grid-template-columns: auto 1fr auto;
        grid-template-rows: auto auto;
        gap: 2px 8px;
        align-items: center;
    }

    #benchmarkTable .metric-sort-btn {
        grid-column: 1;
        grid-row: 1;
        margin-left: 0;
    }

    #benchmarkTable .metric-delete-btn {
        grid-column: 1;
        grid-row: 2;
    }

    #benchmarkTable .metric-cell-content strong {
        grid-column: 2 / 4;
        grid-row: 1 / 3;
        align-self: center;
    }

    #benchmarkTable .tabulator-col:first-child .tabulator-col-content {
        padding-left: 8px !important;
    }

    #benchmarkTable .tabulator-cell:first-child {
        padding-left: 8px;
        padding-right: 8px;
    }
}
