@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');

.podium-leaderboard-wrap {
    font-family: 'Inter', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    padding: 20px 10px 30px 10px;
    margin: 1.5rem auto 2rem;
    max-width: 100%;
    position: relative;
    overflow: hidden;
}

.leaderboard-header {
    text-align: center;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 2;
}

.leaderboard-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 0.3rem 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.leaderboard-subtitle {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.9);
    font-weight: 400;
    margin: 0;
}

.podium-row {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: nowrap;
    position: relative;
    z-index: 2;
}

.podium-card {
    flex: 1 1 0px;
    max-width: 180px;
    min-width: 0;
    background: rgba(255,255,255,0.95);
    border-radius: 16px 16px 12px 12px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    padding: 1rem 0.6rem 1.2rem 0.6rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    transition: all 0.3s ease;
    overflow: hidden;
    z-index: 1;
    border: 1px solid rgba(255,255,255,0.2);
}

.podium-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 25px rgba(0,0,0,0.2);
}

.podium-card.rank-1 {
    border: 3px solid #ffd700;
    background: linear-gradient(135deg, rgba(255, 251, 230, 0.95) 0%, rgba(255, 224, 114, 0.9) 100%);
    z-index: 3;
    margin-bottom: 0;
    margin-top: -20px;
    min-height: 200px;
    box-shadow: 0 15px 30px rgba(255, 224, 114, 0.4);
    transform: scale(1.1);
}

.podium-card.rank-2 {
    border: 2px solid #c0c0c0;
    background: linear-gradient(135deg, rgba(240, 240, 240, 0.95) 0%, rgba(207, 210, 207, 0.9) 100%);
    margin-bottom: 15px;
    min-height: 160px;
    box-shadow: 0 8px 20px rgba(192, 192, 192, 0.3);
    z-index: 2;
}

.podium-card.rank-3 {
    border: 2px solid #cd7f32;
    background: linear-gradient(135deg, rgba(255, 230, 208, 0.95) 0%, rgba(205, 127, 50, 0.9) 100%);
    margin-bottom: 10px;
    min-height: 140px;
    box-shadow: 0 8px 20px rgba(205, 127, 50, 0.3);
    z-index: 1;
}

.podium-card .rank-badge {
    font-weight: 700;
    font-size: 1rem;
    margin-top: -0.8rem;
    margin-bottom: 0.4rem;
    color: #fff;
    background: #c0b080;
    border-radius: 1.5rem;
    padding: 0.1rem 0.8rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    letter-spacing: 0.02em;
}

.podium-card.rank-1 .rank-badge { 
    background: #ffd700; 
    color: #1a1300; 
}
.podium-card.rank-2 .rank-badge { 
    background: #c0c0c0; 
    color: #1d1d1d;
}
.podium-card.rank-3 .rank-badge { 
    background: #cd7f32; 
    color: #fff; 
}

.podium-card .avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 3px solid #fff;
    margin-bottom: 0.6rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    object-fit: cover;
    background: #f9f9f9;
    transition: all 0.3s ease;
}

.podium-card.rank-1 .avatar { 
    border-color: #ffd700; 
    width: 60px;
    height: 60px;
}
.podium-card.rank-2 .avatar { border-color: #c0c0c0; }
.podium-card.rank-3 .avatar { border-color: #cd7f32; }

.podium-card .name, .podium-card .info-row {
    position: relative;
    z-index: 2;
}

.podium-card .highlight-bg {
    background: rgba(255,255,255,0.85);
    border-radius: 8px;
    padding: 0.15rem 0.5rem;
    display: inline-block;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    font-weight: 700;
}

.podium-card .info-row {
    margin-top: 0.2rem;
    margin-bottom: 0.1rem;
    font-size: 0.9rem;
    font-weight: 700;
    text-align: center;
}

.podium-card .stars {
    font-size: 1rem;
    color: #ff6b35;
    font-weight: 700;
    margin: 0.1rem 0 0.5rem 0;
    background: #fff9e0;
    border-radius: 1.5rem;
    padding: 0.1rem 0.6rem;
    box-shadow: 0 2px 6px rgba(255, 199, 74, 0.3);
    display: inline-block;
}

.podium-card .stars::after { 
    content: " ✓"; 
    font-size: 0.9rem; 
    color: #00d4aa; 
}

.podium-eff-bar {
    width: 100%;
    background: rgba(237, 237, 237, 0.8);
    border-radius: 0.8rem;
    overflow: hidden;
    margin-bottom: 0.3rem;
    height: 12px;
    position: relative;
    margin-top: 0.1rem;
}

.podium-eff-fill {
    background: linear-gradient(90deg, #00d4aa 0%, #00b894 100%);
    height: 100%;
    border-radius: 0.8rem 0 0 0.8rem;
    transition: width 1s ease;
    position: relative;
}

.podium-eff-bar span {
    position: absolute;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
    color: #0c2c12;
    font-size: 0.75rem;
    font-weight: 700;
    z-index: 2;
    line-height: 12px;
}

.podium-card .info-row .correct-highlight {
    color: #ff6b35;
    font-weight: 600;
}

.podium-card .info-row .total-highlight {
    color: #4a90e2;
    font-weight: 600;
}

/* Current User Card */
.current-user-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 1.5rem;
    margin: 2rem auto 1.5rem;
    max-width: 100%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    position: relative;
    overflow: hidden;
    border: 2px solid rgba(255,255,255,0.1);
}

.current-user-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.1) 0%, transparent 50%, rgba(255,255,255,0.05) 100%);
    pointer-events: none;
}

.current-user-header {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 2;
}

.current-user-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 4px solid rgba(255,255,255,0.3);
    margin-right: 1.5rem;
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
    background: #fff;
}

.current-user-info {
    flex: 1;
}

.current-user-name {
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 0.3rem 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.current-user-subtitle {
    font-size: 1rem;
    color: rgba(255,255,255,0.9);
    margin: 0;
    font-weight: 500;
}

.current-user-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    position: relative;
    z-index: 2;
}

.current-user-stat {
    background: rgba(255,255,255,0.95);
    border-radius: 16px;
    padding: 1.2rem;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    transition: all 0.3s ease;
}

.current-user-stat:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.current-user-stat-value {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: block;
}

.current-user-stat-label {
    font-size: 0.9rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.current-user-stat.correct .current-user-stat-value { color: #ff6b35; }
.current-user-stat.total .current-user-stat-value { color: #4a90e2; }
.current-user-stat.efficiency .current-user-stat-value { color: #00d4aa; }

.current-user-efficiency-bar {
    width: 100%;
    height: 8px;
    background: rgba(0,0,0,0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.current-user-efficiency-fill {
    height: 100%;
    background: linear-gradient(90deg, #00d4aa 0%, #00b894 100%);
    border-radius: 4px;
    transition: width 1s ease;
}

/* No Data Container */
.no-data-container {
    text-align: center;
    padding: 3rem 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    color: white;
}

.no-data-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* DataTable Styles */
.leaderboard-table-container {
    background: rgba(255,255,255,0.95);
    border-radius: 16px;
    padding: 1rem;
    margin-top: 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

table.dataTable {
    background: transparent;
    border-radius: 12px;
    margin: 0 auto;
    overflow: hidden;
    border: none;
    font-size: 0.9rem;
}

table.dataTable thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

table.dataTable thead th {
    padding: 0.8rem 0.6rem;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

table.dataTable tbody tr {
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

table.dataTable tbody tr:hover {
    background: rgba(102, 126, 234, 0.05);
    cursor: pointer;
}

table.dataTable tbody td {
    padding: 0.8rem 0.6rem;
    vertical-align: middle;
    font-size: 0.85rem;
    border: none;
}

.leaderboard-avatar {
    border-radius: 50%;
    width: 28px;
    height: 28px;
    margin-right: 8px;
    vertical-align: middle;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    border: 2px solid rgba(255,255,255,0.8);
}

.leaderboard-user {
    display: flex;
    align-items: center;
    font-weight: 600;
    color: #1a1a1a;
    font-size: 0.85rem;
}

.table-efficiency-bar {
    width: 100%;
    height: 12px;
    background: rgba(237, 237, 237, 0.8);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    margin-bottom: 2px;
}

.table-efficiency-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #00d4aa 0%, #00b894 100%);
    border-radius: 6px 0 0 6px;
    transition: width 0.8s ease;
}

.table-efficiency-text {
    position: absolute;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
    color: #222;
    font-size: 0.7rem;
    font-weight: 700;
    z-index: 2;
    line-height: 12px;
}

.rank-number {
    font-weight: 700;
    font-size: 0.9rem;
    color: #667eea;
}

.correct-highlight {
    font-weight: 600;
    color: #ff6b35;
}

.total-highlight {
    font-weight: 600;
    color: #4a90e2;
}

/* Popup Styles */
.user-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.3s ease-out;
}

.user-popup {
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    border-radius: 20px;
    padding: 2rem;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    animation: slideIn 0.3s ease-out;
}

.user-popup-header {
    text-align: center;
    margin-bottom: 1.5rem;
    position: relative;
}

.user-popup-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 1rem;
    border: 4px solid #667eea;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.user-popup-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
}

.user-popup-rank {
    font-size: 1.1rem;
    font-weight: 600;
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    padding: 0.3rem 1rem;
    border-radius: 20px;
    display: inline-block;
}

.user-popup-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
}

.stat-label {
    font-size: 0.8rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-correct .stat-value { color: #ff6b35; }
.stat-total .stat-value { color: #4a90e2; }
.stat-efficiency .stat-value { color: #764ba2; }

.user-popup-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #999;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.user-popup-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { 
        opacity: 0; 
        transform: translateY(-20px) scale(0.9); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1); 
    }
}

/* Mobile Responsive Styles */
@media (max-width: 480px) {
    .podium-leaderboard-wrap {
        padding: 15px 8px 25px 8px;
        margin: 1rem 0.5rem 1.5rem 0.5rem;
        border-radius: 16px;
    }
    
    .leaderboard-title {
        font-size: 1.5rem;
    }
    
    .leaderboard-subtitle {
        font-size: 0.8rem;
    }
    
    .podium-row {
        gap: 0.5rem;
        margin-bottom: 1rem;
    }
    
    .podium-card {
        max-width: 28vw;
        padding: 0.6rem 0.2rem 0.8rem 0.2rem;
        border-radius: 12px 12px 8px 8px;
    }
    
    .podium-card.rank-1 { 
        min-height: 160px; 
        margin-top: -15px; 
        transform: scale(1.05);
    }
    .podium-card.rank-2 { min-height: 130px; margin-bottom: 10px;}
    .podium-card.rank-3 { min-height: 110px; margin-bottom: 5px;}
    
    .podium-card .avatar { 
        width: 35px; 
        height: 35px; 
        margin-bottom: 0.4rem;
    }
    
    .podium-card.rank-1 .avatar {
        width: 45px;
        height: 45px;
    }
    
    .podium-card .name { 
        font-size: 0.75rem; 
        margin-bottom: 0.05rem;
    }
    .podium-card .info-row { 
        font-size: 0.7rem; 
        margin-top: 0.05rem;
    }
    .podium-card .stars { 
        font-size: 0.8rem; 
        padding: 0.05rem 0.4rem;
        margin: 0.05rem 0 0.3rem 0;
    }
    .podium-eff-bar { 
        height: 8px; 
        margin-bottom: 0.2rem;
    }
    .podium-eff-bar span { 
        font-size: 0.65rem; 
        line-height: 8px;
    }
    .podium-card .rank-badge { 
        font-size: 0.8rem; 
        padding: 0.05rem 0.5rem;
        margin-top: -0.6rem;
        margin-bottom: 0.3rem;
    }
    
    /* Current User Card Mobile */
    .current-user-card {
        padding: 0.8rem;
        margin: 1rem 0.5rem 0.8rem 0.5rem;
        border-radius: 12px;
    }
    
    .current-user-header {
        flex-direction: column;
        text-align: center;
        margin-bottom: 0.8rem;
    }
    
    .current-user-avatar {
        width: 50px;
        height: 50px;
        margin-right: 0;
        margin-bottom: 0.8rem;
    }
    
    .current-user-name {
        font-size: 1.2rem;
        margin-bottom: 0.2rem;
    }
    
    .current-user-subtitle {
        font-size: 0.8rem;
    }
    
    .current-user-stats {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }
    
    .current-user-stat {
        padding: 0.8rem 0.6rem;
    }
    
    .current-user-stat-value {
        font-size: 1.5rem;
        margin-bottom: 0.3rem;
    }
    
    .current-user-stat-label {
        font-size: 0.75rem;
    }
}

@media (max-width: 600px) {
    .leaderboard-table-container {
        padding: 0.8rem;
        margin-top: 1rem;
    }
    
    table.dataTable {
        font-size: 0.8rem;
    }
    
    table.dataTable tbody td { 
        font-size: 0.75rem; 
        padding: 0.6rem 0.4rem;
    }
    
    table.dataTable thead th {
        font-size: 0.75rem;
        padding: 0.6rem 0.4rem;
    }
    
    .leaderboard-avatar { 
        width: 22px; 
        height: 22px;
        margin-right: 6px;
    }
    
    .leaderboard-user {
        font-size: 0.75rem;
    }
    
    .table-efficiency-bar { 
        height: 8px; 
    }
    
    .table-efficiency-text { 
        font-size: 0.6rem; 
        line-height: 8px;
    }
    
    .user-popup {
        padding: 1.5rem;
        margin: 1rem;
    }
    
    .user-popup-avatar {
        width: 60px;
        height: 60px;
    }
    
    .user-popup-name {
        font-size: 1.2rem;
    }
    
    .user-popup-stats {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }
}

