/* Leaderboard Styles v4.1 (With Tabs) */

/* General Wrapper */
.leaderboard-wrapper {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 20px;
}

/* Header */
.leaderboard-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 15px rgba(118, 75, 162, 0.3);
    flex-wrap: wrap;
    /* Allow wrapping for mobile */
    gap: 15px;
}

.leaderboard-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
}

.leaderboard-title i {
    font-size: 28px;
    margin-right: 15px;
    color: #ffd700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.leaderboard-subtitle {
    font-size: 14px;
    opacity: 0.9;
    font-weight: 400;
    margin-top: 5px;
}

/* Tabs / Toggle */
.leaderboard-tabs {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 30px;
    padding: 4px;
    display: flex;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.leaderboard-tab {
    padding: 8px 20px;
    border-radius: 25px;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
    opacity: 0.8;
}

.leaderboard-tab:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    text-decoration: none;
    opacity: 1;
}

.leaderboard-tab.active {
    background: #fff;
    color: #764ba2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    opacity: 1;
}

/* Podium Section */
.podium-container {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    margin-bottom: 60px;
    padding-top: 40px;
    /* Space for crowns/avatars */
    gap: 15px;
}

.winner-card {
    background: #fff;
    border-radius: 20px;
    padding: 0;
    text-align: center;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: none;
    overflow: visible;
    /* Allow elements to pop out */
    margin-top: 30px;
    /* Space for the floating badge */
}

.winner-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

/* Decorative Background Header */
.winner-card-header {
    background: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%);
    padding: 30px 15px 15px;
    border-radius: 20px 20px 0 0;
    position: relative;
    border-bottom: 1px solid #f0f0f0;
}

.winner-month-badge {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: #fff;
    padding: 8px 18px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 10px rgba(118, 75, 162, 0.3);
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    white-space: nowrap;
}

.winner-crown {
    font-size: 28px;
    color: #ffd700;
    margin-bottom: 10px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    animation: bounce 2s infinite;
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-10px);
    }

    60% {
        transform: translateY(-5px);
    }
}

.winner-avatar-container {
    margin-bottom: -40px;
    /* Pull avatar up into header */
    position: relative;
    z-index: 1;
}

.winner-avatar {
    width: 100px !important;
    height: 100px !important;
    max-width: 100px !important;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid #fff;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
    margin: 0 auto;
    display: block;
    background: #fff;
}

.winner-info {
    padding: 50px 15px 25px;
    /* Top padding to account for avatar overlay */
}

.winner-name {
    font-weight: 800;
    margin: 0 0 10px;
    color: #2d3436;
}

.winner-name a {
    color: #2d3436;
    text-decoration: none;
    transition: color 0.2s;
}

.winner-name a:hover {
    color: #764ba2;
}

.winner-points {
    background: rgba(255, 215, 0, 0.15);
    color: #d4ac0d;
    display: inline-block;
    padding: 8px 20px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 15px;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

/* Remove old styles references */
.winner-card::before,
.winner-month {
    display: none;
}

.podium-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    flex: 1;
    max-width: 220px;
}

.podium-item:hover {
    transform: translateY(-10px);
}

/* Rank Specific Sizing */
.podium-item.rank-1 {
    order: 2;
    /* Center */
    z-index: 3;
    margin-bottom: 20px;
    /* Lift up slightly */
}

.podium-item.rank-2 {
    order: 1;
    /* Left */
    z-index: 2;
}

.podium-item.rank-3 {
    order: 3;
    /* Right */
    z-index: 1;
}

/* Avatar Styling */
.podium-avatar-wrapper {
    position: relative;
    margin-bottom: 15px;
}

/* The original .winner-avatar was replaced by the new .winner-avatar above */
/* The original .winner-avatar was:
.winner-avatar {
    width: 90px !important;
    height: 90px !important;
    max-width: 90px !important;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #fff;
    box-shadow: 0 0 0 3px #ffd700;
    margin: 0 auto;
    display: block;
}
*/

.podium-avatar {
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #fff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    background: #fff;
}

.rank-1 .podium-avatar {
    width: 110px !important;
    height: 110px !important;
    max-width: 110px !important;
    border-color: #ffd700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
}

.rank-2 .podium-avatar {
    width: 90px !important;
    height: 90px !important;
    max-width: 90px !important;
    border-color: #c0c0c0;
}

.rank-3 .podium-avatar {
    width: 90px !important;
    height: 90px !important;
    max-width: 90px !important;
    border-color: #cd7f32;
}

/* Rank Badges */
.rank-badge {
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 16px;
    border: 3px solid #fff;
    z-index: 5;
}

.rank-1 .rank-badge {
    background: #ffd700;
    box-shadow: 0 2px 5px rgba(255, 215, 0, 0.4);
}

.rank-2 .rank-badge {
    background: #c0c0c0;
    box-shadow: 0 2px 5px rgba(192, 192, 192, 0.4);
}

.rank-3 .rank-badge {
    background: #cd7f32;
    box-shadow: 0 2px 5px rgba(205, 127, 50, 0.4);
}

/* Crown Icon */
.crown-icon {
    position: absolute;
    top: -45px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 40px;
    color: #ffd700;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateX(-50%) translateY(0);
    }

    50% {
        transform: translateX(-50%) translateY(-10px);
    }
}

/* User Info Card */
.podium-card {
    background: #fff;
    border-radius: 15px;
    padding: 15px;
    width: 100%;
    text-align: center;
    position: relative;
    /* Different colored borders at bottom */
    border-bottom: 4px solid transparent;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.rank-1 .podium-card {
    border-bottom-color: #ffd700;
    background: linear-gradient(to bottom, #fff, #fffcee);
}

.rank-2 .podium-card {
    border-bottom-color: #c0c0c0;
}

.rank-3 .podium-card {
    border-bottom-color: #cd7f32;
}

.podium-name {
    font-weight: 700;
    color: #2d3436;
    display: block;
    margin-bottom: 5px;
    text-decoration: none;
    font-size: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rank-1 .podium-name {
    font-size: 18px;
    color: #000;
}

.podium-points {
    display: inline-block;
    padding: 5px 12px;
    background: #f1f2f6;
    border-radius: 20px;
    font-weight: 600;
    font-size: 13px;
    color: #636e72;
}

.rank-1 .podium-points {
    background: #ffd700;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}


/* List View (Rest of users) */
.leaderboard-list {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.list-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #f1f2f6;
    transition: background-color 0.2s;
}

.list-item:last-child {
    border-bottom: none;
}

.list-item:hover {
    background-color: #f8f9fa;
}

.list-rank {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #b2bec3;
    font-size: 16px;
    margin-right: 15px;
}

.list-user {
    display: flex;
    align-items: center;
    flex-grow: 1;
    text-decoration: none;
    color: inherit;
}

.list-avatar {
    width: 48px !important;
    height: 48px !important;
    max-width: 48px !important;
    border-radius: 50%;
    margin-right: 15px;
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.list-name {
    font-weight: 600;
    color: #2d3436;
    font-size: 15px;
}

.list-points {
    font-weight: 700;
    color: #6c5ce7;
    background: rgba(108, 92, 231, 0.1);
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 14px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .podium-container {
        flex-direction: column;
        align-items: center;
        gap: 30px;
    }

    .podium-item {
        width: 100%;
        max-width: 300px;
        order: unset !important;
        /* Reset order to stack naturally or enforce specific stack */
    }

    /* Enforce 1st, then 2nd, then 3rd on mobile */
    .podium-item.rank-1 {
        order: 1 !important;
        margin-bottom: 10px;
    }

    .podium-item.rank-2 {
        order: 2 !important;
    }

    .podium-item.rank-3 {
        order: 3 !important;
    }

    .leaderboard-header {
        flex-direction: column;
        text-align: center;
        padding: 20px;
        justify-content: center;
    }

    .leaderboard-title {
        margin-bottom: 10px;
        justify-content: center;
    }

    .leaderboard-title i {
        margin-right: 10px;
    }

    .leaderboard-tabs {
        margin-top: 15px;
        width: 100%;
        justify-content: center;
    }
}