/* AEM Labs - Seller Leaderboard CSS */
/* ================================== */

.leaderboard-page {
    margin: 0 auto;
    padding: 50px 0;
    background-color: #f8f8f8;
}

/* Global Revenue Chart & Top Three Container */
.chart-pedestal-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    align-items: start;
    max-width: min(95%, var(--section-max-width));
    margin: 0 auto 40px;
}

/* Global Chart Section */
.global-chart-section {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid #f0f0f0;
}

.chart-header {
    text-align: center;
    margin-bottom: 30px;
}

.chart-header h3 {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin-bottom: 8px;
}

.chart-header p {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.global-chart {
    width: 100%;
    height: 200px;
    margin-bottom: 30px;
}

.chart-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.chart-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.chart-stat {
    background: white;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.chart-stat::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #a71c1c, transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.chart-stat:hover {
    transform: translateY(-2px);
    border-color: #d1d5db;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.chart-stat:hover::before {
    opacity: 0.6;
}

.chart-stat-content {
    text-align: center;
    margin-bottom: 12px;
}

.chart-stat-value {
    font-size: 18px;
    font-weight: 700;
    color: #a71c1c;
    margin-bottom: 4px;
}

.chart-stat-label {
    font-size: 11px;
    color: #6b7280;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chart-stat-progress {
    margin-top: 8px;
}

.progress-bar {
    position: relative;
    width: 100%;
    height: 4px;
    background: #f3f4f6;
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(270deg, #a71c1c, #6907c5);
    border-radius: 2px;
    width: var(--progress-width, 0%);
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 8px rgba(167, 28, 28, 0.6), 0 0 16px rgba(105, 7, 197, 0.4);
}

.progress-pulse {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: var(--progress-width, 0%);
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.8) 20%, 
        rgba(255, 255, 255, 1) 50%, 
        rgba(255, 255, 255, 0.8) 80%, 
        transparent 100%);
    border-radius: 2px;
    animation: sparklePulse 2s ease-in-out infinite;
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.8);
}

@keyframes sparklePulse {
    0% {
        transform: translateX(-100%);
        opacity: 0;
    }
    20% {
        opacity: 1;
    }
    80% {
        opacity: 1;
    }
    100% {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Pedestal Section */
/* Pedestal Section - Crypto DEX Style */
.pedestal-section {
    background: white;
    border-radius: 16px;
    padding: 24px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    overflow: visible;
}

.pedestal-header {
    text-align: center;
    margin-bottom: 20px;
}

.pedestal-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 4px;
}

.pedestal-header p {
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
}

.pedestal-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: visible;
}

.pedestal-item {
    background: #f9fafb;
    border-radius: 12px;
    padding: 16px;
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
    position: relative;
    overflow: visible;
    margin-top: 8px;
}

.pedestal-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, currentColor, transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pedestal-item:hover {
    transform: translateY(-2px);
    border-color: #d1d5db;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.pedestal-item:hover::before {
    opacity: 0.6;
}

.gold-pedestal {
    border-color: rgba(255, 215, 0, 0.4);
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15) 0%, rgba(255, 193, 7, 0.08) 50%, rgba(255, 215, 0, 0.12) 100%);
}

.gold-pedestal::before {
    background: linear-gradient(90deg, transparent, #ffd700, transparent);
}

.silver-pedestal {
    border-color: rgba(192, 192, 192, 0.4);
    background: linear-gradient(135deg, rgba(192, 192, 192, 0.12) 0%, rgba(229, 231, 235, 0.08) 50%, rgba(192, 192, 192, 0.10) 100%);
}

.silver-pedestal::before {
    background: linear-gradient(90deg, transparent, #c0c0c0, transparent);
}

.bronze-pedestal {
    border-color: rgba(245, 158, 11, 0.4);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(217, 119, 6, 0.08) 50%, rgba(245, 158, 11, 0.12) 100%);
}

.bronze-pedestal::before {
    background: linear-gradient(90deg, transparent, #f59e0b, transparent);
}

.pedestal-rank-badge {
    position: absolute;
    top: -10px;
    left: 8px;
    background: linear-gradient(135deg, #374151 0%, #4b5563 100%);
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid #6b7280;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 20;
}

.gold-pedestal .pedestal-rank-badge {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #1f2937;
    border-color: #f59e0b;
}

.silver-pedestal .pedestal-rank-badge {
    background: linear-gradient(135deg, #e5e7eb 0%, #f3f4f6 100%);
    color: #374151;
    border-color: #9ca3af;
}

.bronze-pedestal .pedestal-rank-badge {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #ffffff;
    border-color: #d97706;
}

.pedestal-content {
    display: grid;
    grid-template-columns: 44px 1fr auto; /* avatar | info | movement */
    align-items: center;
    column-gap: 12px;
    row-gap: 6px;
    margin-top: 6px;
}

.pedestal-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
    flex-shrink: 0;
}

.pedestal-avatar img,
.seller-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.pedestal-info {
    min-width: 0;
    display: grid;
    grid-template-columns: 1fr auto auto auto; /* name | revenue | stats | action */
    align-items: center;
    column-gap: 12px;
}

.pedestal-name {
    font-size: 13px;
    font-weight: 600;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pedestal-revenue {
    font-size: 12px;
    font-weight: 700;
    color: #059669;
}

.pedestal-stats {
    display: inline-flex;
    gap: 6px;
}

.pedestal-orders,
.pedestal-products {
    font-size: 10px;
    color: #64748b;
    background: rgba(100, 116, 139, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

.pedestal-movement {
    font-size: 10px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.pedestal-movement.up {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.pedestal-movement.down {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* No data messages */
.no-data-message {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
    font-style: italic;
}

.no-data-message p {
    margin: 0;
    font-size: 14px;
}

/* --- Leaderboard Table Start --- */
.leaderboard-container {
    background: transparent;
    border-radius: 20px;
    max-width: min(80%, var(--section-max-width));
    margin: 0 auto 40px;
}

.table-header {
    display: grid;
    grid-template-columns: 5% 25% 25% 10% 12.5% 12.5%;
    gap: 2%;
    padding: 20px 30px;
    background: rgba(35, 35, 35, 0.9);
    color: white;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 160px;
    z-index: 10;
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
}

.header-cell {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}


.leaderboard-rows {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px 0;
}

.leaderboard-row {
    display: grid;
    grid-template-columns: 5% 25% 25% 10% 12.5% 12.5%;
    gap: 2%;
    padding: 16px 20px;
    transition: 0.3s ease-in-out;
    position: relative;
    align-items: center;
    background: white;
    color: #222;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.05);
    border: 1px solid #d3d3d3;
}

.leaderboard-row:hover {
    box-shadow: 0 6px 4px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
    cursor: pointer;
}

.leaderboard-row small {
    font-size: 10px;
    font-weight: 600;
    color: #666;
}

.rank-cell {
    display: flex;
    align-items: center;
    flex-direction: row-reverse;
    gap: 8px;
    justify-content: flex-end;
}

.rank-badge {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
}

.rank-delta {
    font-size: 11px;
    font-weight: 900;
    padding: 2px 6px;
    border-radius: 8px;
    text-align: center;
    min-width: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.rank-delta i {
    font-size: 12px;
}

.rank-delta.up {
    color: #10b981;
}

.rank-delta.down {
    color: #ef4444;
}

.rank-delta.new {
    background: rgba(59, 130, 246, 0.3);
    color: #3b82f6;
}

/* Seller Cell */
.seller-cell {
    display: flex;
    align-items: center;
    width: 100%;
    justify-content: space-between;
    gap: 5%;
}

.seller-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.seller-actions {
    margin-top: 8px;
}

.visit-store-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: linear-gradient(270deg, #d64545, #a71c1c, #d64545, #a71c1c);
    background-size: 300% 100%;
    background-position: 0% 0%;
    color: white;
    text-decoration: none;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

.visit-store-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(167, 28, 28, 0.4);
    background-position: 100% 0%;
}

.visit-store-btn i {
    font-size: 10px;
}

.pedestal-actions {
    margin-top: 0;
}

.visit-store-btn.pedestal-btn {
    padding: 4px 8px;
    font-size: 9px;
    gap: 4px;
}

.visit-store-btn.pedestal-btn i {
    font-size: 8px;
}

.seller-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(270deg, #a71c1c, #6907c5);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 13px;
    box-shadow: 0 4px 15px rgba(167, 28, 28, 0.3);
}

.seller-details {
    flex: 1;
}

.seller-name {
    font-weight: 600;
    font-size: 14px;
    color: #222;
    margin-bottom: 4px;
}

.seller-id {
    font-size: 11px;
    color: #666;
    font-weight: 500;
}

.mini-chart {
    width: 80px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sparkline {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.sparkline path {
    vector-effect: non-scaling-stroke;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: all 0.3s ease;
}

.sparkline path[stroke] {
    filter: drop-shadow(0 0 2px rgba(16, 185, 129, 0.3));
}


/* Revenue Cell */
.revenue-cell {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 18%;
}

.revenue-content {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    width: fit-content;
}

.revenue-amount {
    font-weight: 700;
    font-size: 16px;
    color: #10b981;
}

/* Universal Table Cell */
.table-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cell-value {
    font-size: 14px;
    font-weight: 800;
    display: flex;
    align-items: flex-end;
    gap: 6px;
}

/* Rating Cell */
.rating-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rating-stars {
    font-size: 14px;
    color: #fbbf24;
    display: flex;
    gap: 2px;
    justify-content: center;
}

.rating-stars i {
    font-size: 12px;
}

/* Pagination */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 50px;
}

.pagination-btn {
    padding: 12px 24px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    background: white;
    color: #333;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pagination-btn:hover:not(:disabled) {
    border-color: var(--accent-color);
    color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(167, 28, 28, 0.1);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-pages {
    display: flex;
    gap: 8px;
    align-items: center;
}

.page-number {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: white;
    color: #333;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.page-number:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.page-number.active {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

.page-dots {
    color: #666;
    font-weight: 500;
}

/* CTA Section */
.leaderboard-cta {
    background: linear-gradient(135deg, var(--accent-color) 0%, #6907c5 100%);
    border-radius: 20px;
    padding: 50px 30px;
    text-align: center;
    color: white;
    box-shadow: 0 8px 40px rgba(167, 28, 28, 0.3);
}

.cta-content h3 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 10px;
}

.cta-content p {
    font-size: 16px;
    opacity: 0.9;
    margin-bottom: 30px;
}

.cta-button {
    display: inline-block;
    padding: 15px 40px;
    background: white;
    color: var(--accent-color);
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .leaderboard-page {
        padding: 30px 30px 80px;
    }
    
    .chart-pedestal-container {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    
    .table-header,
    .leaderboard-row {
        grid-template-columns: 10% 30% 15% 10% 15% 10%;
        gap: 1%;
        padding: 15px 25px;
    }
}

@media (max-width: 768px) {
    .leaderboard-page {
        padding: 20px 20px 60px;
    }
    
    
    .gold-pedestal,
    .silver-pedestal,
    .bronze-pedestal {
        transform: none;
    }
    
    .table-header,
    .leaderboard-row {
        grid-template-columns: 12% 2fr 18% 15% 12% 15% 12%;
        gap: 0.5%;
        padding: 12px 20px;
    }
    
    .seller-info {
        gap: 10px;
    }
    
    .seller-avatar {
        width: 35px;
        height: 35px;
        font-size: 12px;
    }
    
    .seller-name {
        font-size: 14px;
    }
    
    .seller-id {
        font-size: 11px;
    }
    
    .rank-badge {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }
    
    .revenue-amount {
        font-size: 14px;
    }
    
    .rating-stars {
        font-size: 12px;
    }
    
    .visit-store-btn {
        padding: 4px 8px;
        font-size: 10px;
        gap: 4px;
    }
    
    .visit-store-btn i {
        font-size: 8px;
    }
    
    .percentile-separator {
        margin: 0.5rem 0;
        padding: 0 0.5rem;
    }
    
    .separator-label {
        font-size: 0.625rem;
        padding: 0 0.5rem;
    }
    
    .pagination-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .cta-content h3 {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .table-header,
    .leaderboard-row {
        grid-template-columns: 15% 2fr 20% 18% 15% 18% 15%;
        gap: 0.3%;
        padding: 10px 15px;
    }
    
    .seller-avatar {
        width: 30px;
        height: 30px;
        font-size: 10px;
    }
    
    .seller-name {
        font-size: 13px;
    }
    
    .seller-id {
        font-size: 10px;
    }
    
    .rank-badge {
        width: 25px;
        height: 25px;
        font-size: 10px;
    }
    
    .revenue-amount {
        font-size: 12px;
    }
    
    .rating-stars {
        font-size: 10px;
    }
    
}

/* Percentile Separators */
.percentile-separator {
    display: flex;
    align-items: center;
    margin: 16px 0;
    padding: 0 16px;
}

.separator-line {
    flex: 1;
    height: 3px;
    background: linear-gradient(90deg, transparent, currentColor, transparent);
    opacity: 0.3;
}

.separator-label {
    padding: 0 16px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

/* Tier Colors */
.tier-elite {
    color: #fbbf24; /* Gold */
}

.tier-elite .separator-line {
    background: linear-gradient(90deg, transparent, #fbbf24, transparent);
}

.tier-gold {
    color: #f59e0b; /* Amber */
}

.tier-gold .separator-line {
    background: linear-gradient(90deg, transparent, #f59e0b, transparent);
}

.tier-silver {
    color: #6b7280; /* Gray */
}

.tier-silver .separator-line {
    background: linear-gradient(90deg, transparent, #6b7280, transparent);
}

.tier-bronze {
    color: #d97706; /* Orange */
}

.tier-bronze .separator-line {
    background: linear-gradient(90deg, transparent, #d97706, transparent);
}

/* Print styles */
@media print {
    .leaderboard-page {
        background: white;
        color: black;
    }
    
    .pagination-container,
    .leaderboard-cta {
        display: none;
    }
    
    .pedestal-item,
    .leaderboard-row {
        background: white !important;
        color: black !important;
        border: 1px solid #ccc !important;
    }
}