/* ============================================
   Leaderboard Styles - Red Theme
   Matches notification-header design system
   ============================================ */

/* Leaderboard Card */
.leaderboard-card {
    background: white;
    border: 2px solid #f1d6d7;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 20px;
}

/* Header */
.leaderboard-card-header {
    padding: 24px 28px 20px;
    border-bottom: 1px solid #f1d6d7;
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
}

.leaderboard-title-section {
    text-align: center;
}

.leaderboard-title {
    font-size: 28px;
    font-weight: 700;
    color: #7c2d2e;
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.leaderboard-title i {
    color: #cc4549;
    font-size: 24px;
}

.leaderboard-subtitle {
    font-size: 14px;
    color: #992b2b;
    margin: 0;
}

/* Current User Stats */
.current-user-stats {
    margin: 20px 28px;
    padding: 20px;
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border-radius: 12px;
    border: 1px solid #fca5a5;
}

.current-user-stats-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.user-rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 14px;
    font-size: 20px;
    font-weight: 700;
    flex-shrink: 0;
}

.user-rank-badge.rank-1 {
    background: linear-gradient(135deg, #ffd700 0%, #ffb800 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(255, 184, 0, 0.4);
}

.user-rank-badge.rank-2 {
    background: linear-gradient(135deg, #c0c0c0 0%, #a0a0a0 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(160, 160, 160, 0.4);
}

.user-rank-badge.rank-3 {
    background: linear-gradient(135deg, #cd7f32 0%, #b87333 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(184, 115, 51, 0.4);
}

.user-rank-badge.rank-default {
    background: #f1d6d7;
    color: #992b2b;
}

.user-details {
    flex: 1;
}

.user-username {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 8px;
}

.user-badges {
    display: flex;
    gap: 8px;
}

.user-level-badge, .user-tier-badge {
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
}

.user-level-badge {
    background: linear-gradient(135deg, #cc4549 0%, #a63639 100%);
    color: white;
}

.user-tier-badge {
    background: white;
    color: #a63639;
    border: 1px solid #fca5a5;
}

.current-user-stats-body {
    display: flex;
    gap: 40px;
    padding-top: 16px;
    border-top: 1px solid #fca5a5;
}

.user-stat-item {
    text-align: center;
}

.user-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #a63639;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.user-stat-value i {
    color: #cc4549;
    font-size: 20px;
}

.user-stat-label {
    font-size: 12px;
    color: #992b2b;
    margin-top: 4px;
}

/* Table Section */
.leaderboard-table-section {
    padding: 0 28px 28px;
}

.leaderboard-table-wrapper {
    border: 1px solid #f1d6d7;
    border-radius: 12px;
    overflow: hidden;
    background: white;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
}

.leaderboard-table thead {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
}

.leaderboard-table th {
    padding: 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #992b2b;
    border-bottom: 1px solid #fca5a5;
}

.leaderboard-table tbody tr {
    border-bottom: 1px solid #f1d6d7;
    transition: background 0.15s ease;
}

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

.leaderboard-table tbody tr:hover {
    background: #fef2f2;
}

.leaderboard-table tbody tr.current-user {
    background: #fee2e2;
    border-left: 3px solid #cc4549;
}

.leaderboard-table tbody tr.current-user:hover {
    background: #fcdcdc;
}

.leaderboard-table td {
    padding: 16px;
    vertical-align: middle;
}

.col-rank {
    width: 80px;
}

.col-user {
    width: auto;
}

.col-level {
    width: 140px;
}

.col-xp {
    width: 120px;
}

.col-streak {
    width: 100px;
}

/* Rank Badge */
.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 14px;
}

.rank-badge.rank-1 {
    background: linear-gradient(135deg, #ffd700 0%, #ffb800 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(255, 184, 0, 0.3);
}

.rank-badge.rank-2 {
    background: linear-gradient(135deg, #c0c0c0 0%, #a0a0a0 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(160, 160, 160, 0.3);
}

.rank-badge.rank-3 {
    background: linear-gradient(135deg, #cd7f32 0%, #b87333 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(184, 115, 51, 0.3);
}

.rank-badge.rank-default {
    background: #f1d6d7;
    color: #992b2b;
}

/* User Avatar */
.user-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #cc4549 0%, #a63639 100%);
    color: white;
    font-weight: 600;
    font-size: 14px;
    margin-right: 12px;
}

.username {
    font-weight: 500;
    color: #1f2937;
    font-size: 14px;
}

/* Level Badge */
.level-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    background: linear-gradient(135deg, #cc4549 0%, #a63639 100%);
    color: white;
    font-weight: 500;
    font-size: 12px;
}

.level-name {
    margin-left: 8px;
    font-size: 12px;
    color: #992b2b;
}

/* XP Value */
.xp-value {
    font-weight: 600;
    color: #a63639;
    font-size: 14px;
}

/* Streak Badge */
.streak-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 12px;
    background: #f1d6d7;
    color: #992b2b;
    font-size: 13px;
    font-weight: 500;
}

.streak-badge.streak-active {
    background: linear-gradient(135deg, #cc4549 0%, #a63639 100%);
    color: white;
}

.streak-badge.streak-active i {
    color: #fecaca;
}

/* Pagination */
.leaderboard-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 20px;
}

.pagination-btn {
    padding: 10px 20px;
    border-radius: 8px;
    border: 1px solid #fca5a5;
    background: white;
    color: #1f2937;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pagination-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #cc4549 0%, #a63639 100%);
    color: white;
    border-color: #cc4549;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(204, 69, 73, 0.4);
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-info {
    font-weight: 500;
    color: #1f2937;
    font-size: 14px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .leaderboard-card-header {
        padding: 20px 16px 16px;
    }

    .leaderboard-table-section {
        padding: 0 16px 20px;
    }

    .current-user-stats {
        margin: 16px;
        padding: 16px;
    }

    .leaderboard-title {
        font-size: 22px;
    }

    .current-user-stats-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .current-user-stats-body {
        flex-direction: column;
        gap: 16px;
        padding-top: 12px;
    }

    .user-stat-item {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0;
    }

    .user-stat-value {
        font-size: 20px;
    }

    .leaderboard-table th,
    .leaderboard-table td {
        padding: 12px 8px;
        font-size: 12px;
    }

    .col-rank, .col-level, .col-xp, .col-streak {
        width: auto;
    }

    .rank-badge {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }

    .user-avatar {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }

    .level-name {
        display: none;
    }

    .pagination-btn {
        padding: 8px 14px;
        font-size: 13px;
    }

    .pagination-btn span:not(.page-info) {
        display: none;
    }

    .pagination-btn i {
        margin: 0;
    }
}

/* ============================================
   Dark Mode Support
   ============================================ */

/* WP Night Mode */
body.wp-night-mode-on .leaderboard-card {
    background: #1e1e1e;
    border-color: #7c2d2e;
}

body.wp-night-mode-on .leaderboard-card-header {
    background: linear-gradient(135deg, #2d1f1f 0%, #3d2828 100%);
    border-bottom-color: #7c2d2e;
}

body.wp-night-mode-on .leaderboard-title {
    color: #fca5a5;
}

body.wp-night-mode-on .leaderboard-subtitle {
    color: #fca5a5;
}

body.wp-night-mode-on .current-user-stats {
    background: linear-gradient(135deg, #2d1f1f 0%, #3d2828 100%);
    border-color: #7c2d2e;
}

body.wp-night-mode-on .user-rank-badge.rank-default {
    background: #7c2d2e;
    color: #fca5a5;
}

body.wp-night-mode-on .user-username {
    color: #e5e5e5;
}

body.wp-night-mode-on .user-tier-badge {
    background: #2d1f1f;
    color: #fca5a5;
    border-color: #7c2d2e;
}

body.wp-night-mode-on .user-stat-value {
    color: #fca5a5;
}

body.wp-night-mode-on .user-stat-label {
    color: #fca5a5;
}

body.wp-night-mode-on .leaderboard-table-wrapper {
    background: #252525;
    border-color: #7c2d2e;
}

body.wp-night-mode-on .leaderboard-table thead {
    background: linear-gradient(135deg, #2d1f1f 0%, #3d2828 100%);
}

body.wp-night-mode-on .leaderboard-table th {
    color: #fca5a5;
    border-bottom-color: #7c2d2e;
}

body.wp-night-mode-on .leaderboard-table tbody tr {
    border-bottom-color: #3d2828;
}

body.wp-night-mode-on .leaderboard-table tbody tr:hover {
    background: #2d1f1f;
}

body.wp-night-mode-on .leaderboard-table tbody tr.current-user {
    background: #3d2828;
}

body.wp-night-mode-on .rank-badge.rank-default {
    background: #7c2d2e;
    color: #fca5a5;
}

body.wp-night-mode-on .username {
    color: #e5e5e5;
}

body.wp-night-mode-on .level-name {
    color: #a0a0a0;
}

body.wp-night-mode-on .xp-value {
    color: #fca5a5;
}

body.wp-night-mode-on .streak-badge {
    background: #7c2d2e;
    color: #fca5a5;
}

body.wp-night-mode-on .streak-badge.streak-active i {
    color: #fca5a5;
}

body.wp-night-mode-on .pagination-btn {
    background: #252525;
    border-color: #7c2d2e;
    color: #e5e5e5;
}

body.wp-night-mode-on .page-info {
    color: #e5e5e5;
}
