/**
 * BCXP Competition Leaderboard Styles
 *
 * Clean, responsive table-based leaderboard layout.
 * Uses BEM-like naming to avoid CSS conflicts with themes/other plugins.
 */

/* ------------------------------------------------------------------------- *
 *  WIDGET CONTAINER
 * ------------------------------------------------------------------------- */

.bcxp-lb-widget {
    max-width: 100%;
    margin: 24px 0;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    color: #1d1d1f;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

/* .bcxp-lb-content {
    min-height: 320px;
} */

.bcxp-lb-content.bcxp-lb-content-loading {
    display: flex;
    align-items: center;
    justify-content: center;
}

.bcxp-lb-loading {
    margin: 0;
    padding: 20px;
    color: #666;
    font-size: 14px;
}

/* ------------------------------------------------------------------------- *
 *  TITLE
 * ------------------------------------------------------------------------- */

.bcxp-lb-title {
    margin: 0;
    padding: 16px 20px 0;
    font-size: 18px;
    font-weight: 600;
    color: #1d1d1f;
    border: none;
}

/* ------------------------------------------------------------------------- *
 *  TABLE
 * ------------------------------------------------------------------------- */

.bcxp-lb-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.bcxp-lb-table thead {
    background: #f5f5f5;
}

.bcxp-lb-table th.bcxp-lb-col-rank,
.bcxp-lb-table th.bcxp-lb-col-rank {
    text-align: center;
    width: 50px;
}

.bcxp-lb-table th.bcxp-lb-col-username {
    text-align: left;
    padding-left: 16px;
}

.bcxp-lb-table th.bcxp-lb-col-profit {
    text-align: right;
}

.bcxp-lb-table th.bcxp-lb-col-yield,
.bcxp-lb-table th.bcxp-lb-col-hit_rate {
    text-align: right;
}

.bcxp-lb-table th.bcxp-lb-col-picks,
.bcxp-lb-table th.bcxp-lb-col-eligible_picks {
    text-align: center;
}

.bcxp-lb-table th.bcxp-lb-col-unique_views {
    text-align: right;
}

.bcxp-lb-table th.bcxp-lb-col-avg_engagement_time,
.bcxp-lb-table th.bcxp-lb-col-engagement_rate {
    text-align: right;
}

.bcxp-lb-table td.bcxp-lb-col-rank {
    text-align: center;
    font-weight: 700;
    color: #666;
    width: 50px;
}

.bcxp-lb-table td.bcxp-lb-col-username {
    text-align: left;
    padding-left: 16px;
    font-weight: 500;
}

.bcxp-lb-table td.bcxp-lb-col-profit {
    text-align: right;
    font-weight: 500;
}

.bcxp-lb-table td.bcxp-lb-col-yield,
.bcxp-lb-table td.bcxp-lb-col-hit_rate {
    text-align: right;
}

.bcxp-lb-table td.bcxp-lb-col-picks,
.bcxp-lb-table td.bcxp-lb-col-eligible_picks {
    text-align: center;
}

.bcxp-lb-table td.bcxp-lb-col-unique_views {
    text-align: right;
}

.bcxp-lb-table td.bcxp-lb-col-avg_engagement_time,
.bcxp-lb-table td.bcxp-lb-col-engagement_rate {
    text-align: right;
}

/* ------------------------------------------------------------------------- *
 *  ROWS
 * ------------------------------------------------------------------------- */

.bcxp-lb-row:nth-child(even) {
    background: #fafafa;
}

.bcxp-lb-row:hover {
    background: #f0f4ff;
}

/* Top 3 highlights */
.bcxp-lb-row.bcxp-lb-top-1 td {
    font-weight: 700;
    color: #d4a017;
}

.bcxp-lb-row.bcxp-lb-top-2 td {
    font-weight: 600;
    color: #a0a0a0;
}

.bcxp-lb-row.bcxp-lb-top-3 td {
    font-weight: 600;
    color: #cd7f32;
}

/* ------------------------------------------------------------------------- *
 *  PROFIT COLORS
 * ------------------------------------------------------------------------- */

.bcxp-lb-profit-positive {
    color: #0a7d2e !important;
}

.bcxp-lb-profit-negative {
    color: #d32f2f !important;
}

/* ------------------------------------------------------------------------- *
 *  EMPTY / ERROR STATES
 * ------------------------------------------------------------------------- */

.bcxp-lb-empty,
.bcxp-lb-error {
    padding: 24px;
    text-align: center;
    color: #666;
    font-style: normal;
    font-size: 14px;
    margin: 0;
}

.bcxp-lb-error {
    color: #d32f2f;
    border: 1px solid #f5c6cb;
    background: #f8d7da;
    border-radius: 4px;
}

/* ------------------------------------------------------------------------- *
 *  RESPONSIVE
 * ------------------------------------------------------------------------- */

@media (max-width: 768px) {
    .bcxp-lb-widget {
        font-size: 13px;
    }

    .bcxp-lb-table th,
    .bcxp-lb-table td {
        padding: 8px 6px;
    }

    .bcxp-lb-table th.bcxp-lb-col-username,
    .bcxp-lb-table td.bcxp-lb-col-username {
        padding-left: 8px;
    }
}

/* ------------------------------------------------------------------------- *
 *  COMPETITION-SPECIFIC ACCENT COLORS (optional)
 * ------------------------------------------------------------------------- */

.bcxp-lb-competition-most_viewed .bcxp-lb-title {
    border-left: 4px solid #4a90d9;
}

.bcxp-lb-competition-bet300 .bcxp-lb-title {
    border-left: 4px solid #27ae60;
}

.bcxp-lb-competition-pro300 .bcxp-lb-title {
    border-left: 4px solid #8e44ad;
}

.bcxp-lb-competition-bet365 .bcxp-lb-title {
    border-left: 4px solid #e74c3c;
}

.bcxp-lb-trend-up {
    color: #148a32;
    font-weight: 700;
}

.bcxp-lb-trend-down {
    color: #c62828;
    font-weight: 700;
}

.bcxp-lb-trend-same {
    color: #999;
}

.bcxp-lb-current-user td {
    font-weight: 700;
    background: rgba(0, 115, 170, 0.08);
}

.bcxp-lb-outside-limit td {
    border-top: 2px solid #0073aa;
}

.bcxp-lb-tipster-link,
.bcxp-lb-prediction-link {
    text-decoration: none;
    font-weight: 600;
}

.bcxp-lb-tipster-link:hover,
.bcxp-lb-prediction-link:hover {
    text-decoration: underline;
}

.bcxp-lb-fire-streak td {
    border-top: 2px solid #ff6a00 !important;
    border-bottom: 2px solid #ff6a00 !important;
    background: rgba(255, 106, 0, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 193, 7, 0.45),
                inset 0 -1px 0 rgba(255, 61, 0, 0.35);
}

.bcxp-lb-fire-streak td:first-child {
    border-left: 2px solid #ff6a00 !important;
    border-radius: 8px 0 0 8px;
}

.bcxp-lb-fire-streak td:last-child {
    border-right: 2px solid #ff6a00 !important;
    border-radius: 0 8px 8px 0;
}

.bcxp-lb-fire-streak .bcxp-lb-tipster-link::before {
    content: "🔥 ";
}

.bcxp-lb-current-user.bcxp-lb-unranked td,
.bcxp-lb-row.bcxp-lb-unranked td {
    opacity: 0.9;
    font-style: italic;
}