/* leaderboard.css - Premium Leaderboard Dashboard */

/* --- TOP SECTION (HERO & SUMMARY) --- */
.lb-top-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
    align-items: stretch;
}

.lb-top-grid > div {
    min-width: 0;
}

/* HERO */
.lb-hero {
    background: linear-gradient(135deg, #fdf2f8 0%, #fbcfe8 100%);
    border-radius: 20px;
    padding: 32px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.lb-hero-content {
    max-width: 60%;
    position: relative;
    z-index: 2;
}

.lb-hero-content h2 {
    font-size: 1.6rem;
    color: #be185d;
    margin: 0 0 12px;
    font-weight: 800;
}

.lb-hero-content p {
    color: #831843;
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0 0 24px;
    opacity: 0.9;
}

.btn-primary-pink {
    background: #db2777;
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(219, 39, 119, 0.3);
}

.btn-primary-pink:hover {
    background: #be185d;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(219, 39, 119, 0.4);
}

/* CSS Trophy Illustration */
.lb-hero-illustration {
    position: absolute;
    right: 40px;
    bottom: -10px;
    z-index: 1;
}

.trophy-container {
    position: relative;
    width: 140px;
    height: 160px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
}

.trophy-container i.fa-trophy {
    font-size: 110px;
    background: linear-gradient(180deg, #fef08a 0%, #eab308 50%, #ca8a04 100%);
    -webkit-background-clip: text;
    color: transparent;
    filter: drop-shadow(0 10px 15px rgba(234, 179, 8, 0.4));
    z-index: 2;
    margin-bottom: -15px;
}

.trophy-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 140px;
    height: 140px;
    background: radial-gradient(circle, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0) 70%);
    z-index: 1;
}

.trophy-base {
    width: 100px;
    height: 30px;
    background: #db2777;
    border-radius: 50%;
    filter: blur(8px);
    opacity: 0.5;
    position: absolute;
    bottom: -5px;
    z-index: 0;
}

/* SUMMARY BOX */
.lb-my-summary {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.summary-stats {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
}

.summary-box {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    flex: 1;
}

.summary-divider {
    width: 1px;
    height: 60px;
    background: var(--fellow-line);
}

.s-icon-wrap {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.pink-bg { background: #fdf2f8; color: #db2777; }
.orange-bg { background: #fff7ed; color: #ea580c; }

.s-text {
    display: flex;
    flex-direction: column;
}

.s-text small {
    font-size: 0.75rem;
    color: var(--fellow-muted);
    margin-bottom: 4px;
}

.s-main strong {
    font-size: 1.5rem;
    color: var(--fellow-text);
    line-height: 1;
}

.s-main span {
    font-size: 0.8rem;
    color: var(--fellow-text);
    font-weight: 500;
}

.s-text > span {
    font-size: 0.7rem;
    color: var(--fellow-muted);
    margin-top: 4px;
}

.text-green { color: #16a34a !important; font-weight: 500; }

.summary-progress {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.prog-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--fellow-text);
}

.prog-bar-bg {
    width: 100%;
    height: 8px;
    background: #f1f5f9;
    border-radius: 4px;
    overflow: hidden;
}

.prog-bar-fill {
    height: 100%;
    background: #db2777;
    border-radius: 4px;
}

.prog-footer {
    font-size: 0.7rem;
    color: var(--fellow-muted);
}


/* --- MAIN GRID LAYOUT --- */
.lb-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 32px;
    align-items: start;
}

.lb-main-column, .lb-widgets {
    min-width: 0; /* Prevents CSS grid blowout */
}

/* TABS */
.lb-tabs-container {
    border-bottom: 2px solid var(--fellow-line);
    margin-bottom: 24px;
    overflow-x: auto;
    scrollbar-width: none;
}

.lb-tabs-container::-webkit-scrollbar { display: none; }

.lb-tabs {
    display: flex;
    gap: 32px;
    white-space: nowrap;
}

.lb-tabs button {
    background: transparent;
    border: 0;
    padding: 0 0 16px 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--fellow-muted);
    cursor: pointer;
    position: relative;
    transition: color 0.2s;
}

.lb-tabs button:hover { color: var(--fellow-text); }
.lb-tabs button.active { color: var(--fellow-pink); }
.lb-tabs button.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--fellow-pink);
    border-radius: 2px 2px 0 0;
}

/* CONTROLS */
.lb-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.lb-controls .custom-select {
    margin-bottom: 0;
}

.lb-sort { width: 180px; }
.lb-time {
    width: 180px;
    position: relative;
}

.lb-time .select-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--fellow-muted);
    pointer-events: none;
}

.lb-time select {
    padding-left: 36px;
}

/* TABLE */
.lb-table-container {
    background: #fff;
    border: 1px solid var(--fellow-line);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(170, 52, 104, 0.03);
    overflow-x: auto; /* Responsive table */
}

.lb-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.lb-table th {
    padding: 16px 24px;
    text-align: left;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--fellow-muted);
    border-bottom: 1px solid var(--fellow-line);
    background: #f8fafc;
}

.lb-table td {
    padding: 16px 24px;
    border-bottom: 1px solid var(--fellow-line);
    vertical-align: middle;
}

.lb-table tr:last-child td {
    border-bottom: none;
}

.lb-table tbody tr {
    transition: background 0.2s;
}

.lb-table tbody tr:hover {
    background: #fdf2f8;
}

.highlight-row {
    background: #fff0f6;
}

/* Columns */
.w-rank { width: 80px; }
.w-fellow { width: auto; }
.w-poin { width: 120px; }
.w-trend { width: 120px; }
.w-badge { width: 100px; }

.text-center { text-align: center !important; }
.pink-text { color: #db2777 !important; }
.green-text { color: #16a34a !important; }
.fw-bold { font-weight: bold; }

.rank-col {
    font-weight: bold;
    font-size: 1.1rem;
    color: var(--fellow-text);
}

.rank-gold { color: #eab308; margin-right: 4px; }
.rank-silver { color: #94a3b8; margin-right: 4px; }
.rank-bronze { color: #d97706; margin-right: 4px; }

.lb-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.lb-user img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.lb-user-info {
    display: flex;
    flex-direction: column;
}

.lb-user-info strong {
    font-size: 0.95rem;
    color: var(--fellow-text);
}

.lb-user-info span {
    font-size: 0.75rem;
    color: var(--fellow-muted);
}

.lb-points {
    font-weight: 600;
    font-size: 1.05rem;
}

.lb-trend {
    font-size: 0.85rem;
    font-weight: 500;
}

.lb-badge i {
    font-size: 1.6rem;
}

.badge-gold { color: #fbbf24; filter: drop-shadow(0 2px 4px rgba(251, 191, 36, 0.4)); }
.badge-silver { color: #cbd5e1; filter: drop-shadow(0 2px 4px rgba(203, 213, 225, 0.4)); }
.badge-bronze { color: #d97706; filter: drop-shadow(0 2px 4px rgba(217, 119, 6, 0.4)); }
.badge-generic { color: #fbcfe8; }

/* Load More */
.lb-load-more {
    text-align: center;
    padding: 16px;
    border-top: 1px solid var(--fellow-line);
}

.lb-load-more button {
    background: transparent;
    border: none;
    color: var(--fellow-pink);
    font-size: 0.85rem;
    font-weight: bold;
    cursor: pointer;
}


/* --- RIGHT WIDGETS --- */
.lb-widgets {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.widget-card {
    background: #fff;
    border: 1px solid var(--fellow-line);
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(170, 52, 104, 0.03);
}

.widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.widget-header h3 {
    margin: 0;
    font-size: 1.05rem;
    color: var(--fellow-text);
}

.view-all-link {
    font-size: 0.75rem;
    color: var(--fellow-pink);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
}

.view-all-link:hover {
    text-decoration: underline;
}

/* Point Guide List */
.lb-point-guide {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.guide-item {
    display: flex;
    align-items: center;
    gap: 16px;
}

.guide-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.pink-bg-light { background: #fdf2f8; }
.purple-bg-light { background: #faf5ff; }
.orange-bg-light { background: #fff7ed; }
.green-bg-light { background: #f0fdf4; }

.pink-text { color: #db2777; }
.purple-text { color: #9333ea; }
.orange-text { color: #ea580c; }
.green-text { color: #16a34a; }

.guide-info {
    display: flex;
    flex-direction: column;
}

.guide-info strong {
    font-size: 0.85rem;
    color: var(--fellow-text);
    margin-bottom: 2px;
}

.guide-info span {
    font-size: 0.75rem;
    color: var(--fellow-muted);
}

/* Achievements List */
.lb-achievements {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.achieve-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.achieve-badge-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #fff;
    flex-shrink: 0;
}

.pink-badge-glow { background: #db2777; box-shadow: 0 4px 12px rgba(219, 39, 119, 0.3); }
.purple-badge-glow { background: #9333ea; box-shadow: 0 4px 12px rgba(147, 51, 234, 0.3); }
.orange-badge-glow { background: #ea580c; box-shadow: 0 4px 12px rgba(234, 88, 12, 0.3); }

.achieve-info {
    display: flex;
    flex-direction: column;
}

.achieve-info strong {
    font-size: 0.9rem;
    color: var(--fellow-text);
    margin-bottom: 2px;
}

.achieve-info span {
    font-size: 0.75rem;
    color: var(--fellow-text);
    line-height: 1.3;
    margin-bottom: 4px;
}

.achieve-info small {
    font-size: 0.7rem;
    color: #94a3b8;
}


/* --- RESPONSIVE --- */
@media (max-width: 1200px) {
    .lb-top-grid {
        grid-template-columns: 1fr;
    }

    .lb-hero {
        padding: 32px;
    }
}

@media (max-width: 1080px) {
    .lb-layout {
        grid-template-columns: 1fr;
    }

    .lb-widgets {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
}

@media (max-width: 768px) {
    .lb-hero {
        flex-direction: column;
        text-align: center;
        padding: 24px;
    }

    .lb-hero-content {
        max-width: 100%;
        margin-bottom: 20px;
    }

    .lb-hero-illustration {
        position: relative;
        right: auto;
        bottom: auto;
        margin: 0 auto;
    }

    .summary-stats {
        flex-direction: column;
        gap: 16px;
    }

    .summary-divider {
        width: 100%;
        height: 1px;
    }

    .lb-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }

    .lb-sort, .lb-time {
        width: 100%;
    }
}
