/* ============================================
   Liderlik Tablosu
   ============================================ */

.page-liderlik .lb-hero__content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    max-width: 40rem;
}

.page-liderlik .page-tabs-hero-icon .lb-hero__icon-svg {
    filter: drop-shadow(0 2px 8px rgba(245, 158, 11, 0.35));
}

.page-liderlik .page-tabs-subtitle {
    max-width: 40rem;
}

.leaderboard-dashboard {
    background: transparent;
    margin-top: 1.5rem;
}

.leaderboard-layout {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.leaderboard-layout__bottom {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1rem;
    align-items: stretch;
}

.leaderboard-table-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    min-width: 0;
}

.leaderboard-table-card--weekly {
    width: 100%;
}

.leaderboard-dashboard > .leaderboard-table-card {
    width: 100%;
}

.table-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 50%, rgba(240, 147, 251, 0.05) 100%);
    position: relative;
    overflow: hidden;
}

[data-theme="dark"] .table-header {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.12) 0%, rgba(118, 75, 162, 0.1) 50%, rgba(240, 147, 251, 0.05) 100%);
    border-bottom-color: rgba(102, 126, 234, 0.2);
}

.table-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.3) 0%, rgba(118, 75, 162, 0.3) 50%, rgba(240, 147, 251, 0.3) 100%);
}

.table-header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.table-header-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    text-align: center;
}

.table-title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.02em;
    line-height: 1.25;
}

.table-period {
    font-size: 0.6875rem;
    color: var(--text-secondary);
    font-weight: 500;
    padding: 0.15rem 0.5rem;
    background: rgba(102, 126, 234, 0.08);
    border-radius: 6px;
    border: 1px solid rgba(102, 126, 234, 0.15);
    line-height: 1.3;
}

.table-list {
    overflow: visible;
}

.table-row {
    display: grid;
    grid-template-columns: 36px 1fr auto;
    gap: 0.625rem;
    padding: 0.4375rem 0.875rem;
    border-bottom: 1px solid var(--border-color);
    align-items: center;
    min-height: 40px;
}

.row-stats {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    flex-wrap: nowrap;
    justify-content: flex-end;
}

.row-badges {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.row-badge-icon {
    width: 14px;
    height: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-primary);
    opacity: 0.9;
}

.table-row:last-child {
    border-bottom: none;
}

.table-row:hover:not(.table-row-empty) {
    background-color: var(--bg-primary);
}

.table-row.current-user {
    background-color: rgba(102, 126, 234, 0.05);
}

.table-row-empty {
    opacity: 0.3;
    pointer-events: none;
}

.row-avatar-empty {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--border-color);
    flex-shrink: 0;
}

.row-name-empty {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.row-rank {
    text-align: center;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    line-height: 1;
    width: 36px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rank-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.rank-gold-icon {
    filter: drop-shadow(0 2px 4px rgba(255, 215, 0, 0.45));
}

.rank-silver-icon,
.rank-bronze-icon {
    width: 20px;
    height: 20px;
}

.rank-silver-icon {
    filter: drop-shadow(0 2px 4px rgba(192, 192, 192, 0.35));
}

.rank-bronze-icon {
    filter: drop-shadow(0 2px 4px rgba(205, 127, 50, 0.35));
}

.row-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.row-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1.5px solid var(--border-color);
    object-fit: cover;
    flex-shrink: 0;
}

.row-user-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.row-name-wrap {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
}

.row-name {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-primary);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s ease;
}

.row-name:hover {
    color: var(--accent-primary);
}

.row-badge {
    display: inline-block;
    padding: 0.1rem 0.3rem;
    background: var(--accent-primary);
    color: #fff;
    font-size: 0.5625rem;
    font-weight: 600;
    border-radius: 3px;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1.2;
}

.row-level {
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    min-width: 48px;
}

.row-xp {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.25rem;
    min-width: 56px;
}

.row-icon {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
    color: var(--accent-primary);
    opacity: 0.75;
}

.table-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-secondary);
}

.table-empty p {
    margin: 0;
    font-size: 0.8125rem;
}

@media (max-width: 900px) {
    .leaderboard-layout__bottom {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .leaderboard-dashboard {
        margin-top: 1.25rem;
    }

    .leaderboard-layout,
    .leaderboard-layout__bottom {
        gap: 0.75rem;
    }

    .table-header {
        padding: 0.625rem 0.75rem;
    }

    .table-title {
        font-size: 0.875rem;
    }

    .table-row {
        grid-template-columns: 32px 1fr auto;
        padding: 0.375rem 0.625rem;
        gap: 0.5rem;
        min-height: 36px;
    }

    .row-rank {
        width: 32px;
        font-size: 0.75rem;
    }

    .row-avatar,
    .row-avatar-empty {
        width: 28px;
        height: 28px;
    }

    .row-name {
        font-size: 0.75rem;
    }

    .row-stats {
        gap: 0.375rem;
    }

    .row-level {
        min-width: 42px;
        font-size: 0.625rem;
    }

    .row-xp {
        min-width: 48px;
        font-size: 0.6875rem;
    }

    .page-liderlik .page-tabs-subtitle {
        font-size: 0.8125rem;
        max-width: 100%;
        padding-inline: 0.25rem;
    }
}

[data-theme="dark"] .leaderboard-table-card {
    background: rgba(0, 0, 0, 0.2);
    border-color: rgba(102, 126, 234, 0.2);
}

[data-theme="dark"] .table-row {
    border-bottom-color: rgba(102, 126, 234, 0.15);
}
