/* Prop Trustpilot Rankings Table Styles */
.ptp-rankings-wrapper {
    --ptp-primary: #2563eb;
    --ptp-primary-dark: #1d4ed8;
    --ptp-success: #10b981;
    --ptp-danger: #ef4444;
    --ptp-warning: #f59e0b;
    --ptp-gray-100: #f3f4f6;
    --ptp-gray-200: #e5e7eb;
    --ptp-gray-300: #d1d5db;
    --ptp-gray-600: #4b5563;
    --ptp-gray-800: #1f2937;
    --ptp-cfd-color: #8b5cf6;
    --ptp-futures-color: #f97316;
    
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    max-width: 100%;
    margin: 2rem 0;
}

/* Filter Bar */
.ptp-filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.ptp-filter-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.ptp-filter-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    border: 2px solid var(--ptp-gray-200);
    background: #fff;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--ptp-gray-600);
    transition: all 0.2s ease;
}

.ptp-filter-tab:hover {
    border-color: var(--ptp-primary);
    color: var(--ptp-primary);
}

.ptp-filter-tab.active {
    background: var(--ptp-primary);
    border-color: var(--ptp-primary);
    color: #fff;
}

.ptp-tab-icon {
    font-size: 1.1rem;
}

.ptp-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 20px;
    padding: 0 6px;
    background: rgba(0,0,0,0.1);
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
}

.ptp-filter-tab.active .ptp-tab-count {
    background: rgba(255,255,255,0.3);
}

/* Sort Dropdown */
.ptp-sort-dropdown {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ptp-sort-dropdown label {
    font-size: 0.875rem;
    color: var(--ptp-gray-600);
    font-weight: 500;
}

.ptp-sort-select {
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    border: 2px solid var(--ptp-gray-200);
    border-radius: 8px;
    background: #fff url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="%234b5563" stroke-width="2"><path d="M6 9l6 6 6-6"/></svg>') no-repeat right 0.5rem center;
    font-size: 0.875rem;
    color: var(--ptp-gray-800);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

.ptp-sort-select:focus {
    outline: none;
    border-color: var(--ptp-primary);
}

/* Table Container */
.ptp-table-container {
    overflow-x: auto;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.ptp-rankings-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.ptp-rankings-table thead {
    background: linear-gradient(135deg, var(--ptp-gray-800) 0%, #374151 100%);
}

.ptp-rankings-table thead th {
    padding: 1rem 0.75rem;
    text-align: left;
    color: #fff;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.ptp-rankings-table thead th[data-sort] {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 1.5rem;
}

.ptp-rankings-table thead th[data-sort]::after {
    content: '↕';
    position: absolute;
    right: 0.5rem;
    opacity: 0.5;
    font-size: 0.7rem;
}

.ptp-rankings-table thead th[data-sort]:hover {
    background: rgba(255,255,255,0.1);
}

.ptp-rankings-table thead th.sort-asc::after {
    content: '↑';
    opacity: 1;
}

.ptp-rankings-table thead th.sort-desc::after {
    content: '↓';
    opacity: 1;
}

.ptp-rankings-table tbody tr {
    border-bottom: 1px solid var(--ptp-gray-200);
    transition: all 0.2s ease;
}

.ptp-rankings-table tbody tr:hover {
    background-color: var(--ptp-gray-100);
}

.ptp-rankings-table tbody tr:last-child {
    border-bottom: none;
}

.ptp-rankings-table td {
    padding: 1rem 0.75rem;
    vertical-align: middle;
}

/* Featured Row */
.ptp-featured-row {
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.05) 0%, rgba(37, 99, 235, 0.02) 100%);
    border-left: 4px solid var(--ptp-primary) !important;
}

/* Rank Badge */
.ptp-rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.875rem;
    background: var(--ptp-gray-200);
    color: var(--ptp-gray-800);
}

.ptp-rank-1 {
    background: linear-gradient(135deg, #ffd700 0%, #ffb800 100%);
    color: #92400e;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.4);
}

.ptp-rank-2 {
    background: linear-gradient(135deg, #c0c0c0 0%, #a8a8a8 100%);
    color: #374151;
    box-shadow: 0 2px 8px rgba(192, 192, 192, 0.4);
}

.ptp-rank-3 {
    background: linear-gradient(135deg, #cd7f32 0%, #b8722b 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(205, 127, 50, 0.4);
}

/* Firm Info */
.ptp-firm-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.ptp-firm-logo {
    flex-shrink: 0;
}

.ptp-firm-logo img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid var(--ptp-gray-200);
}

.ptp-no-logo {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ptp-primary);
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    border-radius: 8px;
    text-transform: uppercase;
}

.ptp-firm-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.ptp-firm-name {
    font-weight: 600;
    color: var(--ptp-gray-800);
    font-size: 1rem;
}

.ptp-profit-split {
    font-size: 0.75rem;
    color: var(--ptp-gray-600);
}

.ptp-promo-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--ptp-success) 0%, #059669 100%);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
}

.ptp-featured-badge {
    display: inline-block;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #92400e;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

/* Category Badges */
.ptp-category-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.ptp-category-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.375rem 0.625rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.ptp-category-cfd {
    background: rgba(139, 92, 246, 0.1);
    color: var(--ptp-cfd-color);
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.ptp-category-futures {
    background: rgba(249, 115, 22, 0.1);
    color: var(--ptp-futures-color);
    border: 1px solid rgba(249, 115, 22, 0.3);
}

.ptp-category-none {
    color: var(--ptp-gray-600);
}

/* Review Count */
.ptp-review-count {
    display: block;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--ptp-gray-800);
}

.ptp-trustpilot-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: #00b67a;
    text-decoration: none;
    margin-top: 0.25rem;
}

.ptp-trustpilot-link:hover {
    text-decoration: underline;
}

.ptp-trustpilot-icon {
    flex-shrink: 0;
}

/* Percentage Bars */
.ptp-percentage-bar {
    width: 100%;
    max-width: 100px;
    height: 8px;
    background: var(--ptp-gray-200);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.25rem;
}

.ptp-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.ptp-bar-positive {
    background: linear-gradient(90deg, var(--ptp-success) 0%, #34d399 100%);
}

.ptp-bar-negative {
    background: linear-gradient(90deg, var(--ptp-danger) 0%, #f87171 100%);
}

.ptp-percentage-text {
    font-weight: 600;
    font-size: 0.9rem;
}

.ptp-percentage-text small {
    font-weight: 400;
    color: var(--ptp-gray-600);
    font-size: 0.7rem;
}

.ptp-positive {
    color: var(--ptp-success);
}

.ptp-negative {
    color: var(--ptp-danger);
}

/* Trust Score */
.ptp-trust-score {
    display: inline-flex;
    align-items: baseline;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    font-weight: 700;
}

.ptp-score-value {
    font-size: 1.25rem;
}

.ptp-score-label {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-left: 2px;
}

.ptp-score-excellent {
    background: rgba(16, 185, 129, 0.1);
    color: var(--ptp-success);
}

.ptp-score-good {
    background: rgba(37, 99, 235, 0.1);
    color: var(--ptp-primary);
}

.ptp-score-average {
    background: rgba(245, 158, 11, 0.1);
    color: var(--ptp-warning);
}

.ptp-score-poor {
    background: rgba(239, 68, 68, 0.1);
    color: var(--ptp-danger);
}

/* Action Buttons */
.ptp-action-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.ptp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
    border: none;
    cursor: pointer;
}

.ptp-btn-primary {
    background: linear-gradient(135deg, var(--ptp-primary) 0%, var(--ptp-primary-dark) 100%);
    color: #fff;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3);
}

.ptp-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.4);
    color: #fff;
}

.ptp-btn-secondary {
    background: #fff;
    color: var(--ptp-primary);
    border: 2px solid var(--ptp-primary);
}

.ptp-btn-secondary:hover {
    background: var(--ptp-primary);
    color: #fff;
}

/* Table Footer */
.ptp-table-footer {
    padding: 1rem;
    background: var(--ptp-gray-100);
    border-radius: 0 0 12px 12px;
}

.ptp-disclaimer {
    margin: 0;
    font-size: 0.75rem;
    color: var(--ptp-gray-600);
    text-align: center;
}

.ptp-affiliate-disclosure {
    display: block;
    margin-top: 0.25rem;
    font-style: italic;
}

/* No Results */
.ptp-no-results {
    text-align: center;
    padding: 3rem;
    background: var(--ptp-gray-100);
    border-radius: 12px;
    color: var(--ptp-gray-600);
}

/* Loading State */
.ptp-loading {
    position: relative;
    min-height: 200px;
}

.ptp-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid var(--ptp-gray-200);
    border-top-color: var(--ptp-primary);
    border-radius: 50%;
    animation: ptp-spin 0.8s linear infinite;
}

@keyframes ptp-spin {
    to { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .ptp-rankings-table thead th,
    .ptp-rankings-table td {
        padding: 0.75rem 0.5rem;
    }
    
    .ptp-firm-logo img,
    .ptp-no-logo {
        width: 40px;
        height: 40px;
    }
    
    .ptp-filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .ptp-filter-tabs {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .ptp-filter-tab .ptp-tab-text {
        display: none;
    }
    
    .ptp-filter-tab {
        padding: 0.5rem 0.75rem;
    }
    
    .ptp-tab-icon {
        margin: 0;
    }
    
    .ptp-table-container {
        margin: 0 -1rem;
        border-radius: 0;
    }
    
    .ptp-rankings-table thead {
        display: none;
    }
    
    .ptp-rankings-table tbody {
        display: block;
    }
    
    .ptp-rankings-table tbody tr {
        display: block;
        padding: 1rem;
        margin-bottom: 0.75rem;
        border: 1px solid var(--ptp-gray-200);
        border-radius: 12px;
        background: #fff;
    }
    
    .ptp-rankings-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 0;
        border-bottom: 1px solid var(--ptp-gray-100);
    }
    
    .ptp-rankings-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--ptp-gray-600);
        font-size: 0.7rem;
        text-transform: uppercase;
        flex-shrink: 0;
        margin-right: 1rem;
    }
    
    .ptp-rankings-table td:last-child {
        border-bottom: none;
    }
    
    .ptp-col-rank {
        order: -2;
    }
    
    .ptp-col-firm {
        order: -1;
        flex-direction: column;
        align-items: flex-start !important;
    }
    
    .ptp-col-firm::before {
        display: none;
    }
    
    .ptp-col-actions {
        justify-content: center !important;
        padding-top: 1rem !important;
    }
    
    .ptp-col-actions::before {
        display: none;
    }
    
    .ptp-action-buttons {
        width: 100%;
        justify-content: center;
    }
    
    .ptp-action-buttons .ptp-btn {
        flex: 1;
    }
    
    .ptp-percentage-bar {
        max-width: 80px;
    }
}

/* Animation */
@keyframes ptp-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ptp-rankings-table tbody tr {
    animation: ptp-fade-in 0.3s ease forwards;
}

.ptp-rankings-table tbody tr:nth-child(1) { animation-delay: 0.05s; }
.ptp-rankings-table tbody tr:nth-child(2) { animation-delay: 0.1s; }
.ptp-rankings-table tbody tr:nth-child(3) { animation-delay: 0.15s; }
.ptp-rankings-table tbody tr:nth-child(4) { animation-delay: 0.2s; }
.ptp-rankings-table tbody tr:nth-child(5) { animation-delay: 0.25s; }
.ptp-rankings-table tbody tr:nth-child(n+6) { animation-delay: 0.3s; }

/* Hidden rows for filtering */
.ptp-rankings-table tbody tr.ptp-hidden {
    display: none;
}
/* Stats Cards Styling */
.ptp-stats-cards-wrapper {
    margin: 40px 0;
}

.ptp-stats-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 30px;
    color: #1d2327;
    border-bottom: 3px solid #2271b1;
    padding-bottom: 15px;
}

.ptp-stats-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.ptp-stats-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.ptp-stats-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.ptp-stats-card-header {
    display: flex;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, #f5f7fa 0%, #fff 100%);
    border-bottom: 1px solid #e0e0e0;
}

.ptp-stats-firm-logo {
    width: 60px;
    height: 60px;
    margin-right: 15px;
    flex-shrink: 0;
}

.ptp-stats-firm-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.ptp-stats-no-logo {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #2271b1 0%, #1557a0 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    border-radius: 8px;
    text-transform: uppercase;
}

.ptp-stats-firm-info {
    flex: 1;
    min-width: 0;
}

.ptp-stats-firm-name {
    font-size: 18px;
    font-weight: 700;
    color: #1d2327;
    margin: 0 0 5px 0;
    display: block;
}

.ptp-stats-updated {
    font-size: 13px;
    color: #757575;
    margin: 0;
}

.ptp-stats-card-body {
    padding: 20px;
}

.ptp-stats-metric {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.ptp-stats-metric:last-child {
    border-bottom: none;
}

.ptp-stats-label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.ptp-stats-value {
    font-size: 18px;
    font-weight: 700;
    color: #1d2327;
}

.ptp-stats-value small {
    font-size: 13px;
    font-weight: 400;
    color: #757575;
}

.ptp-stats-change {
    margin-left: 10px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
}

.ptp-stats-change.positive {
    background: #d7f7e8;
    color: #00a32a;
}

.ptp-stats-change.negative {
    background: #fce8e8;
    color: #d63638;
}

.ptp-no-stats {
    text-align: center;
    padding: 40px;
    color: #757575;
    font-size: 16px;
}

/* Responsive */
@media (max-width: 768px) {
    .ptp-stats-cards-grid {
        grid-template-columns: 1fr;
    }
    
    .ptp-stats-card-header {
        flex-direction: column;
        text-align: center;
    }
    
    .ptp-stats-firm-logo {
        margin-right: 0;
        margin-bottom: 12px;
    }
}