/* --- GŁÓWNE STYLE KONTENERA I KONTROLEK --- */
.prop-firm-table-container {
    --table-primary-color: #007bff;
    --table-primary-color-dark: #0056b3;
    --table-success-color: #28a745;
    --table-success-color-dark: #218838;
    --table-header-bg: #f8f9fa;
    --table-border-color: #dee2e6;
    --table-row-hover-bg: #f1f8ff;
    --sticky-bg-color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px;
}

/* --- KONTROLKI NAD TABELĄ --- */
.table-controls {
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

/* NAWIGACJA "SEGMENTED CONTROL" */
.segmented-control-nav {
    display: inline-flex;
    background-color: #e9ecef;
    border-radius: 8px;
    padding: 4px;
    border: 1px solid #dee2e6;
}

.segmented-control-button {
    padding: 8px 16px;
    border: none;
    background-color: transparent;
    color: #495057;
    font-weight: 600;
    font-size: 0.9em;
    border-radius: 6px;
    text-decoration: none !important;
    cursor: pointer;
    transition: all 0.25s ease-in-out;
    white-space: nowrap;
}

.segmented-control-button.active {
    background-color: #ffffff;
    color: var(--table-primary-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.segmented-control-button:not(.active):hover {
    color: #212529;
}

/* WYSZUKIWARKA */
.search-box {
    display: flex;
}

.prop-firm-search {
    width: 100%;
    max-width: 350px;
    padding: 10px;
    border: 1px solid var(--table-border-color);
    border-radius: 8px;
    font-size: 0.95em;
}

/* --- STYLE TABELI --- */
.prop-firm-table-wrapper {
    overflow-x: auto;
    position: relative;
    width: 100%;
    border: 1px solid var(--table-border-color);
    border-radius: 8px;
    -webkit-overflow-scrolling: touch;
}

.prop-firm-table {
    width: 100%;
    min-width: 800px;
    border-collapse: collapse;
    border-spacing: 0;
}

.prop-firm-table td,
.prop-firm-table th {
    padding: 14px 12px;
    text-align: left;
    vertical-align: middle;
    border: none;
}

.prop-firm-table thead th {
    background-color: var(--table-header-bg);
    color: #4A5568;
    font-weight: 600;
    font-size: 0.78em;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 3px solid var(--table-primary-color);
    user-select: none;
    position: sticky;
    top: 0;
    z-index: 10;
}

.prop-firm-table tbody tr:hover {
    background-color: var(--table-row-hover-bg);
}

.prop-firm-table tbody tr {
    border-bottom: 1px solid #EDF2F7;
}

.prop-firm-table tbody tr:last-child {
    border-bottom: none;
}

.th-flex-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
}

.prop-firm-table thead th[data-sort-col] {
    cursor: pointer;
    padding-right: 22px;
}

.prop-firm-table thead th[data-sort-col] .sort-arrow {
    display: inline-block;
    width: 0.85em;
    text-align: center;
    opacity: .3;
    transition: opacity .2s, transform .2s;
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
}

.prop-firm-table thead th.sorting-asc .sort-arrow {
    opacity: 1;
    color: var(--table-primary-color);
    transform: translateY(-50%) rotate(180deg);
}

.prop-firm-table thead th.sorting-desc .sort-arrow {
    opacity: 1;
    color: var(--table-primary-color);
    transform: translateY(-50%) rotate(0);
}

.prop-firm-table tbody tr[data-href] {
    cursor: pointer;
}

.firm-link-in-table {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none!important;
    color: inherit;
    font-weight: 600;
}

.table-logo {
    width: 42px;
    height: 42px;
    object-fit: contain;
    
    padding: 3px;
   /* background-color: #fff;
   border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .1);*/
    flex-shrink: 0;
}

.firm-name-text {
    font-size: 0.92em;
}

/* ==================================== */
/*   POPRAWIONE STYLE PROPINDEKSU v3    */
/* ==================================== */
.prop-index-visual {
    position: relative;
    /* Kluczowe dla pozycjonowania dziecka */
    width: 50px;
    height: 50px;
    margin: 0 auto;
}

.prop-index-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    /* Idealne wyśrodkowanie */
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.prop-index-score {
    font-size: 1.05em;
    font-weight: 700;
    color: var(--progress-color);
}

.prop-index-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

/* ==================================== */
/*     KONIEC POPRAWEK PROPINDEKSU      */
/* ==================================== */

.country-cell {
    display: flex;
    align-items: center;
    gap: 7px;
}

.table-flag {
    width: 24px;
    height: auto;
    border-radius: 3px;
}

.rating-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    text-align: center;
}

.star-rating-display {
    color: #ffc107;
    font-size: 1em;
    line-height: 1;
}

.rating-text-value {
    font-size: 0.8em;
    color: #718096;
    font-weight: 500;
    line-height: 1.2;
}

.experience-meter-container-table {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    text-align: center;
}

.experience-meter-table {
    display: flex;
    align-items: flex-end;
    gap: 2px;
}

.experience-meter-bar-table {
    display: block;
    width: 7px;
    background-color: #e9ecef;
    border-radius: 2px;
}

.experience-meter-bar-table.active {
    background-color: var(--active-color);
}

.experience-meter-bar-table.half-active {
    background: linear-gradient(to top, var(--active-color) 50%, #e9ecef 50.1%);
}

.experience-meter-bar-table:nth-child(1) {
    height: 7px;
}

.experience-meter-bar-table:nth-child(2) {
    height: 10px;
}

.experience-meter-bar-table:nth-child(3) {
    height: 13px;
}

.experience-meter-bar-table:nth-child(4) {
    height: 16px;
}

.experience-meter-bar-table:nth-child(5) {
    height: 19px;
}

.experience-meter-container-table.color-level-1 {
    --active-color: var(--table-primary-color);
}

.experience-meter-container-table.color-level-2 {
    --active-color: #17a2b8;
}

.experience-meter-container-table.color-level-3 {
    --active-color: #28a745;
}

.experience-meter-label-table {
    font-size: 0.8em;
    font-weight: 500;
    color: #718096;
    line-height: 1.2;
}

.asset-badges-wrapper-table {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
    justify-content: flex-start;
}

.asset-badge-table {
    background-color: #e9ecef;
    color: #495057;
    padding: 3px 7px;
    border-radius: 4px;
    font-size: .75em;
    white-space: nowrap;
}

.promo-cell {
    text-align: center;
    vertical-align: middle;
}

.promo-cell-content {
    display: inline-block;
    font-weight: 600;
    font-size: 0.82em;
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
    line-height: 1.3;
    border: 1px solid transparent;
}

.promo-cell-content.is-percentage {
    background-color: #fffbe6;
    color: #9c4221;
    border-color: #ffe58f;
    font-size: 0.85em;
}

.promo-cell-content.is-general {
    background-color: #edf2f7;
    color: #4a5568;
    border-color: #e2e8f0;
}

.platform-icons-wrapper {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
    align-items: center;
}

.platform-icon {
    height: 24px;
    width: auto;
    max-width: 75px;
}

.platform-more-badge {
    background-color: #e2e8f0;
    color: #4a5568;
    font-size: 0.75em;
    font-weight: 600;
    padding: 4px 6px;
    border-radius: 4px;
    line-height: 1;
    cursor: help;
}

.promo-button {
    font-size: .85em;
    padding: 6px 12px;
    border-radius: 18px;
    text-decoration: none;
    text-align: center;
    display: inline-block;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: all .2s;
    white-space: nowrap;
    background-color: var(--table-success-color);
    color: #fff !important;
}

.promo-button:hover {
    background-color: var(--table-success-color-dark);
    transform: translateY(-1px);
}

.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 25px
}

#prop-firm-table-container .pagination-btn {
    all: unset;
    box-sizing: border-box;
    background-color: #fff !important;
    border: 1px solid #ddd !important;
    color: #333 !important;
    padding: 8px 14px !important;
    border-radius: 6px !important;
    cursor: pointer;
    font-weight: 600;
    transition: all .2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
    line-height: 1.2
}

#prop-firm-table-container .pagination-btn:hover {
    background-color: #e9e9e9 !important;
    border-color: #ccc !important
}

#prop-firm-table-container .pagination-btn.active {
    background-color: var(--table-primary-color) !important;
    color: #fff !important;
    border-color: var(--table-primary-color) !important
}

#prop-firm-table-container .pagination-btn.disabled {
    opacity: .5 !important;
    cursor: not-allowed !important;
    background-color: #fff !important
}

.pagination-ellipsis {
    padding: 8px 0;
    font-weight: 600;
    color: #aaa
}

@media screen and (max-width: 992px) {
    .table-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .segmented-control-nav {
        width: 100%;
        display: flex;
        margin-bottom: 15px;
    }

    .segmented-control-button {
        flex: 1;
        text-align: center;
    }

    .prop-firm-table {
        min-width: 0;
    }

    .prop-firm-table td,
    .prop-firm-table th {
        white-space: nowrap;
        padding: 12px 8px;
    }

    .header-desktop-label {
        display: none;
    }

    .th-flex-content {
        justify-content: center;
    }

    .prop-firm-table th.th-prop-index,
    .prop-firm-table td:nth-child(1) {
        position: sticky;
        left: 0;
        z-index: 5;
        background-color: var(--sticky-bg-color);
        transition: transform .3s ease-out, opacity .3s ease-out;
        min-width: 55px !important;
    }

    .prop-firm-table th.th-prop-index {
        background-color: var(--table-header-bg);
    }

    .prop-firm-table tbody tr:hover td:nth-child(1) {
        background-color: var(--table-row-hover-bg);
    }

    .prop-firm-table th.th-firm-name,
    .prop-firm-table td:nth-child(2) {
        position: static;
        transition: all .2s;
        min-width: 190px !important;
    }

    .prop-firm-table-wrapper.scrolled-state .prop-firm-table th.th-prop-index,
    .prop-firm-table-wrapper.scrolled-state .prop-firm-table td:nth-child(1) {
        transform: translateX(-100%);
        opacity: 0;
        pointer-events: none;
        z-index: 1;
    }

    .prop-firm-table-wrapper.scrolled-state .prop-firm-table th.th-firm-name,
    .prop-firm-table-wrapper.scrolled-state .prop-firm-table td:nth-child(2) {
        position: sticky;
        left: 0;
        z-index: 5;
        background-color: var(--sticky-bg-color);
        min-width: 55px !important;
        width: 55px !important;
        padding-left: 5px !important;
        padding-right: 5px !important;
        box-sizing: border-box;
    }

    .prop-firm-table-wrapper.scrolled-state .prop-firm-table th.th-firm-name {
        background-color: var(--table-header-bg);
        font-size: 0;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }

    .prop-firm-table-wrapper.scrolled-state .prop-firm-table td:nth-child(2) .firm-link-in-table {
        justify-content: center;
    }

    .prop-firm-table-wrapper.scrolled-state .prop-firm-table tbody tr:hover td:nth-child(2) {
        background-color: var(--table-row-hover-bg);
    }

    .prop-firm-table-wrapper.scrolled-state .firm-name-text {
        opacity: 0;
        visibility: hidden;
        max-width: 0;
        margin-left: -10px;
    }

    .prop-index-visual {
        width: 40px;
        height: 40px;
    }

    .prop-index-visual .prop-index-score {
        font-size: 0.9em;
    }
}

.full-ranking-button-container {
    text-align: center;
    margin-top: 25px
}

#prop-firm-table-container .view-full-ranking-button {
    all: unset;
    box-sizing: border-box;
    display: inline-block;
    background-color: var(--table-primary-color) !important;
    color: #fff !important;
    padding: 12px 24px !important;
    font-size: 1.1em !important;
    font-weight: 700 !important;
    border-radius: 8px !important;
    text-decoration: none !important;
    line-height: 1.5;
    cursor: pointer;
    transition: all .3s ease;
    border: none !important
}

#prop-firm-table-container .view-full-ranking-button:hover {
    background-color: var(--table-primary-color-dark) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, .1)
}
/* --- Link do Analizy Eksperckiej w Tabeli (Ikona Weryfikacji) --- */
a.expert-analysis-icon-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px;
    color: #007bff;
    text-decoration: none !important;
    transition: transform 0.2s ease;
    /* Brak tła, sama "pieczęć" wygląda lepiej */
    background-color: transparent; 
    width: auto;
    height: auto;
    position: relative;
    z-index: 10;
}

a.expert-analysis-icon-link:hover {
    transform: scale(1.2);
    color: #0056b3;
    background-color: transparent; /* Reset tła */
    box-shadow: none; /* Reset cienia kontenera */
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1)); /* Cień rzucany przez samą ikonę */
}

a.expert-analysis-icon-link svg {
    width: 20px; /* Optymalny rozmiar w tabeli */
    height: 20px;
    fill: currentColor;
}

/* ============================================ */
/*   KOLUMNA CTA — PRZYCISK AFILIACYJNY v1.0    */
/* ============================================ */

.th-cta {
    text-align: center;
    white-space: nowrap;
    min-width: 130px;
}

.cta-cell {
    text-align: center;
    vertical-align: middle;
    padding: 10px 12px;
}

.table-cta-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

/* Badge z kodem promocyjnym nad przyciskiem */
.table-cta-promo-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.70em;
    font-weight: 700;
    background-color: #fffbe6;
    color: #9c4221;
    border: 1px solid #ffe58f;
    border-radius: 4px;
    padding: 3px 7px;
    white-space: nowrap;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.table-cta-promo-badge svg {
    width: 10px;
    height: 10px;
    fill: currentColor;
    flex-shrink: 0;
    opacity: 0.7;
}

.table-cta-promo-badge:hover {
    background-color: #fff3cd;
    border-color: #ffc107;
    color: #7d3400;
}

.table-cta-promo-badge.copied {
    background-color: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

/* Główny przycisk CTA */
.table-cta-btn {
    display: inline-block;
    background-color: var(--table-success-color);
    color: #fff !important;
    font-weight: 700;
    font-size: 0.82em;
    padding: 8px 15px;
    border-radius: 20px;
    text-decoration: none !important;
    white-space: nowrap;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.30);
    line-height: 1.3;
}

.table-cta-btn:hover {
    background-color: var(--table-success-color-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.45);
    color: #fff !important;
    text-decoration: none !important;
}

/* Link secondary — Czytaj recenzję */
.table-cta-review-link {
    display: inline-block;
    font-size: 0.75em;
    font-weight: 500;
    color: #718096;
    text-decoration: none !important;
    white-space: nowrap;
    transition: color 0.15s ease;
    line-height: 1.3;
}

.table-cta-review-link:hover {
    color: var(--table-primary-color);
    text-decoration: underline !important;
}

/* Mobile: kolumna CTA przyklejona do prawej krawędzi */
@media screen and (max-width: 992px) {
    .prop-firm-table th.th-cta,
    .prop-firm-table td.cta-cell {
        position: sticky;
        right: 0;
        z-index: 5;
        background-color: var(--sticky-bg-color);
        border-left: 1px solid var(--table-border-color);
    }

    .prop-firm-table th.th-cta {
        background-color: var(--table-header-bg);
        z-index: 6;
    }

    .prop-firm-table tbody tr:hover td.cta-cell {
        background-color: var(--table-row-hover-bg);
    }

    .table-cta-btn {
        font-size: 0.78em;
        padding: 7px 11px;
    }
}

/* ============================================== */
/*   STYL PASKA OCENY SPOŁECZNOŚCI W TABELI (v2)  */
/* ============================================== */
.sp-table-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.sp-table-score-row {
    display: flex;
    align-items: baseline;
    gap: 2px;
}

.sp-table-score {
    font-size: 1.05em;
    font-weight: 800;
}

.sp-table-max {
    font-size: 0.75em;
    color: #a0aec0;
    font-weight: 500;
}

/* Tło paska */
.sp-table-bar-bg {
    width: 60px;
    height: 5px;
    background-color: #edf2f7;
    border-radius: 4px;
    overflow: hidden;
}

/* Pasek progresu */
.sp-table-bar-fill {
    height: 100%;
    border-radius: 4px;
}

/* Kolory w zależności od wyniku */
.sp-table-score.sp-color-good { color: #28a745; }
.sp-table-bar-fill.sp-color-good { background-color: #28a745; }

.sp-table-score.sp-color-mid { color: #f6ad55; }
.sp-table-bar-fill.sp-color-mid { background-color: #f6ad55; }

.sp-table-score.sp-color-bad { color: #e53e3e; }
.sp-table-bar-fill.sp-color-bad { background-color: #e53e3e; }