/* Agent Leaderboard Compact
 * Mobile-first design for displaying top 7 AI trading agents
 */

.agent-lb-compact {
    background: linear-gradient(135deg, rgba(30, 10, 60, 0.5), rgba(50, 20, 80, 0.4));
    border: 1px solid rgba(123, 104, 238, 0.3);
    border-radius: 12px;
    padding: 16px 20px;
    margin: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.agent-lb-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(123, 104, 238, 0.2);
}

.agent-lb-title {
    font-size: 16px;
    font-weight: 700;
    background: linear-gradient(135deg, #00cfff, #7b68ee);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

.agent-lb-view-all {
    color: #7b68ee;
    font-size: 11px;
    text-decoration: none;
    transition: color 0.2s ease;
}

.agent-lb-view-all:hover {
    color: #00cfff;
}

.agent-lb-entries {
    display: flex;
    flex-direction: column;
}

.agent-lb-entry {
    display: flex;
    align-items: center;
    padding: 10px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    border-radius: 8px;
    margin: 2px 0;
    position: relative;
}

.agent-lb-entry::before {
    content: '';
    position: absolute;
    left: 0;
    top: 4px;
    bottom: 4px;
    width: 3px;
    border-radius: 3px;
    background: var(--agent-color, #7b68ee);
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.agent-lb-entry:last-child {
    border-bottom: none;
}

.agent-lb-entry:hover {
    background: rgba(123, 104, 238, 0.1);
}

.agent-lb-entry:hover::before {
    opacity: 1;
}

/* Rank Badge */
.agent-lb-rank {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    margin-right: 8px;
    flex-shrink: 0;
}

.agent-lb-rank.rank-1 {
    font-size: 16px;
}

.agent-lb-rank.rank-2 {
    font-size: 16px;
}

.agent-lb-rank.rank-3 {
    font-size: 16px;
}

.agent-lb-rank.rank-default {
    background: rgba(255, 255, 255, 0.1);
    color: #9DA3A8;
    font-size: 12px;
}

/* Agent Avatar */
.agent-lb-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-right: 10px;
    flex-shrink: 0;
    border: 2px solid var(--agent-color, #7b68ee);
    box-shadow: 0 0 8px rgba(123, 104, 238, 0.3);
}

/* Agent Info */
.agent-lb-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.agent-lb-name {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.agent-lb-symbol {
    font-size: 11px; /* iOS minimum legible font size */
    font-family: 'JetBrains Mono', monospace;
    color: #9DA3A8;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Agent Stats */
.agent-lb-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    flex-shrink: 0;
}

.agent-lb-profit {
    font-size: 13px;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
}

.agent-lb-profit.positive {
    color: #10b981;
}

.agent-lb-profit.negative {
    color: #ef4444;
}

.agent-lb-meta {
    display: flex;
    gap: 8px;
    font-size: 11px; /* iOS minimum legible font size */
    color: #9DA3A8;
}

.agent-lb-winrate {
    font-family: 'JetBrains Mono', monospace;
}

.agent-lb-clones {
    opacity: 0.8;
}

/* Empty & Loading States */
.agent-lb-empty {
    color: #9ca3af; /* Improved contrast from #6B7280 */
    font-size: 12px;
    text-align: center;
    padding: 20px;
}

.agent-lb-loading {
    display: flex;
    justify-content: center;
    padding: 30px;
}

.agent-lb-loading::after {
    content: '';
    width: 24px;
    height: 24px;
    border: 2px solid rgba(123, 104, 238, 0.3);
    border-top-color: #7b68ee;
    border-radius: 50%;
    animation: agent-lb-spin 0.8s linear infinite;
}

@keyframes agent-lb-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Mobile responsive */
@media (max-width: 768px) {
    .agent-lb-compact {
        padding: 12px;
    }

    .agent-lb-entries {
        gap: 4px;
    }

    .agent-lb-entry {
        padding: 8px 6px;
        background: rgba(30, 10, 60, 0.3);
        border-radius: 10px;
        border: 1px solid rgba(123, 104, 238, 0.15);
        margin: 3px 0;
    }

    .agent-lb-entry::before {
        display: none;
    }

    .agent-lb-entry:hover {
        border-color: rgba(123, 104, 238, 0.4);
    }

    .agent-lb-rank {
        width: 22px;
        height: 22px;
        font-size: 12px;
        margin-right: 6px;
    }

    .agent-lb-rank.rank-1,
    .agent-lb-rank.rank-2,
    .agent-lb-rank.rank-3 {
        font-size: 14px;
    }

    .agent-lb-avatar {
        width: 32px;
        height: 32px;
        font-size: 16px;
        margin-right: 8px;
    }

    .agent-lb-name {
        font-size: 12px;
    }

    .agent-lb-symbol {
        font-size: 11px; /* iOS minimum legible font size */
    }

    .agent-lb-profit {
        font-size: 12px;
    }

    .agent-lb-meta {
        font-size: 11px; /* iOS minimum legible font size */
        gap: 6px;
    }
}

/* Desktop - grid layout */
@media (min-width: 769px) {
    .agent-lb-compact {
        background: linear-gradient(180deg, rgba(30, 10, 60, 0.6), rgba(40, 15, 70, 0.5));
    }

    .agent-lb-entries {
        gap: 0;
    }

    .agent-lb-entry {
        display: grid;
        grid-template-columns: 32px 44px 1fr 100px;
        align-items: center;
        gap: 12px;
        padding: 12px 16px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        border-radius: 0;
        margin: 0;
    }

    .agent-lb-entry:nth-child(odd) {
        background: rgba(123, 104, 238, 0.05);
    }

    .agent-lb-entry:hover {
        background: rgba(123, 104, 238, 0.12);
    }

    .agent-lb-entry::before {
        display: none;
    }

    .agent-lb-rank {
        width: 28px;
        height: 28px;
        margin: 0;
    }

    .agent-lb-avatar {
        width: 40px;
        height: 40px;
        font-size: 22px;
        margin: 0;
    }

    .agent-lb-info {
        flex-direction: row;
        align-items: center;
        gap: 8px;
    }

    .agent-lb-name {
        font-size: 14px;
    }

    .agent-lb-symbol {
        font-size: 11px;
        background: rgba(123, 104, 238, 0.2);
        padding: 2px 6px;
        border-radius: 4px;
    }

    .agent-lb-stats {
        flex-direction: row;
        align-items: center;
        gap: 16px;
    }

    .agent-lb-profit {
        font-size: 14px;
        min-width: 70px;
        text-align: right;
    }

    .agent-lb-meta {
        gap: 12px;
        font-size: 11px;
    }
}
