/* Test Leaderboard - Main Styles */

/* Modal Styles */
.tlb-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
}

.tlb-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
}

.tlb-modal-content {
    position: relative;
    max-width: 500px;
    margin: 100px auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: tlbSlideDown 0.3s ease-out;
}

@keyframes tlbSlideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tlb-modal-header {
    padding: 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px 12px 0 0;
    color: #fff;
}

.tlb-modal-header h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
}

.tlb-modal-body {
    padding: 30px 25px;
}

#tlb-score-message {
    font-size: 18px;
    margin-bottom: 20px;
    color: #333;
}

#tlb-score-display {
    color: #667eea;
    font-size: 22px;
}

.tlb-input-group {
    margin-top: 20px;
}

.tlb-input-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #333;
}

.tlb-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.tlb-input:focus {
    outline: none;
    border-color: #667eea;
}

.tlb-error-message {
    display: block;
    margin-top: 8px;
    color: #e74c3c;
    font-size: 14px;
}

.tlb-modal-footer {
    padding: 20px 25px;
    background: #f8f9fa;
    border-radius: 0 0 12px 12px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.tlb-button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.tlb-button-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.tlb-button-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.tlb-button-secondary {
    background: #e0e0e0;
    color: #333;
}

.tlb-button-secondary:hover {
    background: #d0d0d0;
}

/* Toast Message */
.tlb-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #27ae60;
    color: #fff;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    z-index: 999999;
    animation: tlbToastSlide 0.3s ease-out;
}

@keyframes tlbToastSlide {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.tlb-toast-icon {
    display: inline-block;
    width: 24px;
    height: 24px;
    background: #fff;
    color: #27ae60;
    border-radius: 50%;
    text-align: center;
    line-height: 24px;
    margin-right: 10px;
    font-weight: bold;
}

/* Leaderboard Container */
.tlb-leaderboard-container {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 25px;
    margin: 30px 0;
}

.tlb-leaderboard-header {
    text-align: center;
    margin-bottom: 25px;
}

.tlb-leaderboard-title {
    font-size: 28px;
    font-weight: 700;
    color: #333;
    margin: 0 0 10px 0;
}

.tlb-leaderboard-subtitle {
    color: #666;
    font-size: 16px;
    margin: 0;
}

.tlb-no-scores {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 16px;
}

/* Leaderboard Rows */
.tlb-leaderboard-content {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 0 0 8px 8px;
    overflow: hidden;
}

/* Leaderboard Header Row */
.tlb-leaderboard-header-row {
    display: grid;
    grid-template-columns: 70px 200px 100px 100px 100px 160px;
    padding: 15px 0;
    background: #f0f2f5;
    border-radius: 8px 8px 0 0;
    border: 1px solid #ddd;
    border-bottom: 2px solid #ddd;
    font-weight: 700;
    font-size: 14px;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.tlb-position-header,
.tlb-name-header,
.tlb-percent-header,
.tlb-points-header,
.tlb-time-header,
.tlb-date-header {
    padding: 0 15px;
    display: flex;
    align-items: center;
    border-right: 1px solid #ddd;
}

.tlb-date-header {
    border-right: none;
}

.tlb-position-header {
    justify-content: center;
}

.tlb-name-header {
    justify-content: flex-start;
}

.tlb-percent-header,
.tlb-points-header,
.tlb-time-header,
.tlb-date-header {
    justify-content: center;
}

/* Leaderboard Rows */
.tlb-leaderboard-row {
    display: grid;
    grid-template-columns: 70px 200px 100px 100px 100px 160px;
    padding: 0;
    background: #fff;
    border-bottom: 1px solid #e5e5e5;
    align-items: center;
    transition: all 0.2s ease;
    min-height: 60px;
}

.tlb-leaderboard-row:hover {
    background: #f8f9ff;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

.tlb-leaderboard-row:last-child {
    border-bottom: none;
    border-radius: 0 0 8px 8px;
}

.tlb-position-gold {
    background: linear-gradient(90deg, #fff9e6 0%, #ffffff 100%);
    border-left: 4px solid #ffd700;
}

.tlb-position-silver {
    background: linear-gradient(90deg, #f5f5f5 0%, #ffffff 100%);
    border-left: 4px solid #c0c0c0;
}

.tlb-position-bronze {
    background: linear-gradient(90deg, #fff4ed 0%, #ffffff 100%);
    border-left: 4px solid #cd7f32;
}

.tlb-position,
.tlb-user-name,
.tlb-percent,
.tlb-points,
.tlb-time,
.tlb-date {
    padding: 15px;
    border-right: 1px solid #e5e5e5;
}

.tlb-date {
    border-right: none;
}

/* Position Column */
.tlb-position {
    display: flex;
    align-items: center;
    justify-content: center;
}

.tlb-medal {
    font-size: 28px;
}

.tlb-rank {
    font-size: 20px;
    font-weight: 700;
    color: #999;
}

/* User Name Column */
.tlb-user-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: left;
}

/* Percent Column */
.tlb-percent {
    font-size: 18px;
    font-weight: 700;
    color: #667eea;
    text-align: center;
}

/* Points Column */
.tlb-points {
    font-size: 14px;
    color: #666;
    text-align: center;
}

/* Time Column */
.tlb-time {
    font-size: 14px;
    color: #666;
    text-align: center;
}

/* Date Column */
.tlb-date {
    font-size: 13px;
    color: #666;
    text-align: center;
}

/* Old styles - keep for backwards compatibility */
.tlb-meta-info {
    display: none;
}

.tlb-score-info {
    text-align: right;
}

.tlb-score-percent {
    font-size: 22px;
    font-weight: 700;
    color: #667eea;
    display: block;
}

.tlb-score-points {
    font-size: 14px;
    color: #666;
}

.tlb-time {
    text-align: center;
    min-width: 80px;
}

.tlb-time-value {
    font-size: 14px;
    color: #666;
}

.tlb-date {
    text-align: right;
    min-width: 90px;
}

.tlb-date-value {
    font-size: 14px;
    color: #999;
}

/* Global Leaderboard - Podium */
.tlb-global-leaderboard-container {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 30px;
    margin: 30px 0;
}

.tlb-global-podium {
    margin: 40px 0;
}

.tlb-podium-container {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 20px;
    max-width: 700px;
    margin: 0 auto;
}

.tlb-podium-place {
    flex: 1;
    text-align: center;
    animation: tlbPodiumPop 0.6s ease-out backwards;
}

.tlb-podium-first {
    animation-delay: 0.2s;
}

.tlb-podium-second {
    animation-delay: 0.1s;
}

.tlb-podium-third {
    animation-delay: 0.3s;
}

@keyframes tlbPodiumPop {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.tlb-podium-medal {
    font-size: 64px;
    margin-bottom: 10px;
}

.tlb-podium-name {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tlb-podium-score {
    font-size: 24px;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 5px;
}

.tlb-podium-stats {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
}

.tlb-podium-stand {
    height: 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px 10px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
    color: #fff;
    position: relative;
}

.tlb-stand-first {
    height: 120px;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
}

.tlb-stand-second {
    height: 100px;
    background: linear-gradient(135deg, #c0c0c0 0%, #e8e8e8 100%);
}

.tlb-stand-third {
    height: 80px;
    background: linear-gradient(135deg, #cd7f32 0%, #e9a96c 100%);
}

/* Global Leaderboard Table */
.tlb-global-leaderboard-table {
    margin-top: 40px;
}

.tlb-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.tlb-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.tlb-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

.tlb-table td {
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.tlb-table tbody tr:hover {
    background: #f8f9fa;
}

.tlb-table .tlb-top-1 {
    background: rgba(255, 215, 0, 0.1);
}

.tlb-table .tlb-top-2 {
    background: rgba(192, 192, 192, 0.1);
}

.tlb-table .tlb-top-3 {
    background: rgba(205, 127, 50, 0.1);
}

.tlb-th-position,
.tlb-td-position {
    width: 80px;
    text-align: center;
    font-weight: 700;
}

.tlb-th-name,
.tlb-td-name {
    font-weight: 600;
}

.tlb-th-points,
.tlb-td-points {
    text-align: right;
    color: #667eea;
}

.tlb-th-tests,
.tlb-td-tests,
.tlb-th-avg,
.tlb-td-avg {
    text-align: center;
    width: 100px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .tlb-modal-content {
        margin: 50px 20px;
    }
    
    .tlb-leaderboard-header-row {
        display: none;
    }
    
    .tlb-leaderboard-row {
        grid-template-columns: 60px 1fr;
        grid-template-rows: auto auto auto auto;
        gap: 5px;
        padding: 15px;
        min-height: auto;
    }
    
    .tlb-position,
    .tlb-user-name,
    .tlb-percent,
    .tlb-points,
    .tlb-time,
    .tlb-date {
        border-right: none;
        padding: 5px;
    }
    
    .tlb-position {
        grid-column: 1;
        grid-row: 1 / 5;
        align-self: center;
    }
    
    .tlb-user-name {
        grid-column: 2;
        grid-row: 1;
        font-size: 16px;
        font-weight: 700;
    }
    
    .tlb-percent {
        grid-column: 2;
        grid-row: 2;
        text-align: left;
        font-size: 16px;
    }
    
    .tlb-points,
    .tlb-time,
    .tlb-date {
        grid-column: 2;
        text-align: left;
        font-size: 12px;
        color: #888;
    }
    
    .tlb-points {
        grid-row: 3;
    }
    
    .tlb-time {
        grid-row: 4;
    }
    
    .tlb-date {
        grid-row: 5;
    }
    
    .tlb-points::before {
        content: "Scor: ";
        font-weight: 600;
    }
    
    .tlb-time::before {
        content: "Durată: ";
        font-weight: 600;
    }
    
    .tlb-date::before {
        content: "Data: ";
        font-weight: 600;
    }
    
    .tlb-podium-container {
        flex-direction: column;
        align-items: center;
    }
    
    .tlb-podium-place {
        width: 100%;
        max-width: 300px;
    }
    
    .tlb-table {
        font-size: 14px;
    }
    
    .tlb-table th,
    .tlb-table td {
        padding: 10px 5px;
    }
}
