/* Top Markets Compact Leaderboard
 * Mobile-first design for displaying top 5 prediction markets by volume
 */

.top-markets-leaderboard {
    background: linear-gradient(135deg, rgba(0, 50, 100, 0.4), rgba(0, 80, 150, 0.3));
    border: 1px solid rgba(0, 150, 255, 0.3);
    border-radius: 12px;
    padding: 16px 20px;
    margin: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.top-markets-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0, 150, 255, 0.2);
}

.top-markets-title {
    font-size: 16px;
    font-weight: 700;
    color: #00cfff;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    text-shadow: 0 0 10px rgba(0, 207, 255, 0.3);
}

.top-markets-view-all {
    color: #00cfff;
    font-size: 11px;
    text-decoration: none;
    transition: color 0.2s ease;
}

.top-markets-view-all:hover {
    color: #00ff88;
}

.top-markets-entries {
    display: flex;
    flex-direction: column;
}

.top-markets-entry {
    display: flex;
    align-items: center;
    padding: 12px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    border-radius: 8px;
    margin: 4px 0;
}

.top-markets-entry:last-child {
    border-bottom: none;
}

.top-markets-entry:hover {
    background: rgba(0, 150, 255, 0.1);
    border-radius: 6px;
    margin: 0 -8px;
    padding: 8px;
}

.top-markets-rank {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    margin-right: 10px;
    flex-shrink: 0;
}

.top-markets-thumbnail {
    width: 80px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
    margin-right: 16px;
    flex-shrink: 0;
    border: 2px solid rgba(0, 150, 255, 0.4);
    box-shadow: 0 4px 12px rgba(0, 150, 255, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.top-markets-entry:hover .top-markets-thumbnail {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 150, 255, 0.3);
}

.rank-1 {
    background: linear-gradient(135deg, #ffd700, #ffaa00);
    color: #000;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
}

.rank-2 {
    background: linear-gradient(135deg, #c0c0c0, #a0a0a0);
    color: #000;
}

.rank-3 {
    background: linear-gradient(135deg, #cd7f32, #b87333);
    color: #fff;
}

.rank-4,
.rank-5 {
    background: rgba(255, 255, 255, 0.1);
    color: #9DA3A8;
}

.top-markets-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.top-markets-title-text {
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.top-markets-stats {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-family: 'JetBrains Mono', monospace;
    color: #9DA3A8;
}

.stat-item:first-child {
    color: #00ff88;
    font-weight: 600;
}

.stat-icon {
    font-size: 11px; /* iOS minimum legible font size */
}

.top-markets-volume {
    font-size: 12px;
    font-family: 'JetBrains Mono', monospace;
    color: #00ff88;
    font-weight: 500;
    flex-shrink: 0;
}

.top-markets-empty {
    color: #6B7280;
    font-size: 12px;
    text-align: center;
    padding: 16px;
}

.top-markets-loading {
    display: flex;
    justify-content: center;
    padding: 20px;
}

.top-markets-loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0, 207, 255, 0.3);
    border-top-color: #00cfff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Mobile responsive */
@media (max-width: 768px) {
    .top-markets-leaderboard {
        padding: 12px;
    }

    .top-markets-entries {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .top-markets-entry {
        display: flex;
        flex-direction: row;
        align-items: center;
        padding: 10px;
        background: rgba(0, 50, 100, 0.3);
        border-radius: 10px;
        border: 1px solid rgba(0, 150, 255, 0.2);
    }

    .top-markets-thumbnail {
        width: 70px;
        height: 50px;
        margin-right: 12px;
        border-radius: 6px;
        flex-shrink: 0;
    }

    .top-markets-rank {
        width: 24px;
        height: 24px;
        font-size: 11px;
        margin-right: 10px;
        flex-shrink: 0;
    }

    .top-markets-info {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    .top-markets-title-text {
        font-size: 12px;
        line-height: 1.3;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .top-markets-stats {
        display: flex;
        flex-direction: row;
        gap: 10px;
        flex-wrap: wrap;
    }

    .stat-item {
        font-size: 11px; /* iOS minimum legible font size */
    }

    .stat-icon {
        font-size: 11px; /* iOS minimum legible font size */
    }
}


/* Desktop - compact stats-focused table */
@media (min-width: 769px) {
    .top-markets-leaderboard {
        background: linear-gradient(180deg, rgba(0, 40, 80, 0.6), rgba(0, 30, 60, 0.7));
    }

    .top-markets-entries {
        display: flex;
        flex-direction: column;
        gap: 0;
    }

    .top-markets-entry {
        display: grid;
        grid-template-columns: 40px 100px 1fr 100px 80px 80px;
        align-items: center;
        gap: 16px;
        padding: 14px 16px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        background: transparent;
        border-radius: 0;
        margin: 0;
    }

    .top-markets-entry:nth-child(odd) {
        background: rgba(0, 50, 100, 0.2);
    }

    .top-markets-entry:hover {
        background: rgba(0, 150, 255, 0.15);
        margin: 0;
        padding: 14px 16px;
    }

    .top-markets-thumbnail {
        width: 100px;
        height: 56px;
        border-radius: 6px;
        margin: 0;
    }

    .top-markets-rank {
        width: 32px;
        height: 32px;
        font-size: 14px;
        margin: 0;
    }

    .top-markets-info {
        display: contents;
    }

    .top-markets-title-text {
        font-size: 14px;
        font-weight: 500;
    }

    .top-markets-stats {
        display: contents;
    }

    .stat-item {
        font-size: 13px;
        justify-content: flex-end;
    }

    .stat-item:first-child {
        font-size: 14px;
    }

    .stat-icon {
        display: none;
    }
}
