/* Modern Rankings Page Styles */

.rankings-section {
    padding: 40px 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    min-height: 70vh;
}

.rankings-header {
    text-align: center;
    margin-bottom: 40px;
    animation: fadeInDown 0.6s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.rankings-header h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #2c5f2d;
    font-weight: 700;
}

.rankings-intro {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-size: 1.1rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

.admin-actions {
    text-align: center;
    margin-bottom: 30px;
    animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.rankings-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
    flex-wrap: wrap;
    animation: fadeIn 1s ease-out;
}

.tab-btn {
    padding: 12px 30px;
    background: white;
    color: #333;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.tab-btn:hover {
    background: #2c5f2d;
    color: white;
    border-color: #2c5f2d;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.tab-btn.active {
    background: #2c5f2d;
    color: white;
    border-color: #2c5f2d;
    box-shadow: 0 4px 12px rgba(44, 95, 45, 0.3);
}

.rankings-table-container {
    margin-top: 30px;
}

.rankings-table-container > .table-responsive,
.rankings-table-container > .chart-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    overflow: hidden;
    animation: fadeInUp 0.6s ease-out;
    margin-bottom: 30px;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.rankings-table-container h3 {
    text-align: center;
    font-size: 1.8rem;
    margin: 0;
    padding: 25px 20px;
    color: #2c5f2d;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-bottom: 3px solid #2c5f2d;
    font-weight: 700;
}

.table-responsive {
    overflow-x: auto;
}

.rankings-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.rankings-table thead {
    background: linear-gradient(135deg, #2c5f2d 0%, #1f4320 100%);
    color: white;
}

.rankings-table th {
    padding: 16px;
    text-align: left;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.rankings-table th.medal-col {
    width: 60px;
    text-align: center;
}

.rankings-table tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.25s ease;
}

.rankings-table tbody tr:hover {
    background: #f8f9fa;
    box-shadow: -3px 0 0 0 #2c5f2d inset, 0 2px 8px rgba(0,0,0,0.08);
}

.rankings-table tbody tr:last-child {
    border-bottom: none;
}

.rankings-table td {
    padding: 18px 16px;
    color: #333;
}

.rankings-table td.medal {
    font-size: 1.5rem;
    text-align: center;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.rankings-table .rank {
    font-weight: 700;
    color: #2c5f2d;
    font-size: 1.1rem;
    text-align: center;
    min-width: 50px;
}

/* Medal rows styling */
.rankings-table tbody tr:nth-child(1) {
    background: linear-gradient(135deg, #fff9e6 0%, #fffdf5 100%);
    border-left: 4px solid #ffd700;
}

.rankings-table tbody tr:nth-child(1):hover {
    background: linear-gradient(135deg, #fff5d6 0%, #fff9e6 100%);
    box-shadow: -4px 0 0 0 #ffd700 inset, 0 4px 12px rgba(255, 215, 0, 0.2);
}

.rankings-table tbody tr:nth-child(2) {
    background: linear-gradient(135deg, #f5f5f5 0%, #fafafa 100%);
    border-left: 4px solid #c0c0c0;
}

.rankings-table tbody tr:nth-child(2):hover {
    background: linear-gradient(135deg, #eeeeee 0%, #f5f5f5 100%);
    box-shadow: -4px 0 0 0 #c0c0c0 inset, 0 4px 12px rgba(192, 192, 192, 0.2);
}

.rankings-table tbody tr:nth-child(3) {
    background: linear-gradient(135deg, #fff0e6 0%, #fff8f0 100%);
    border-left: 4px solid #cd7f32;
}

.rankings-table tbody tr:nth-child(3):hover {
    background: linear-gradient(135deg, #ffe8d6 0%, #fff0e6 100%);
    box-shadow: -4px 0 0 0 #cd7f32 inset, 0 4px 12px rgba(205, 127, 50, 0.2);
}

.rankings-table .name {
    font-weight: 600;
    color: #333;
    font-size: 1.05rem;
}

.rankings-table .rating {
    font-weight: 700;
    font-size: 1.15rem;
    color: #2c5f2d;
    background: linear-gradient(135deg, #2c5f2d 0%, #4a8c4b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.rankings-table .win-rate {
    font-weight: 600;
    color: #2c5f2d;
}

/* Stats columns */
.rankings-table td:not(.medal):not(.name) {
    font-variant-numeric: tabular-nums;
}

/* No data message */
.no-data {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 1.1rem;
}

/* Responsive design */
@media (max-width: 768px) {
    .rankings-section {
        padding: 20px 0;
    }
    
    .rankings-header h2 {
        font-size: 2rem;
    }
    
    .rankings-intro {
        font-size: 1rem;
        padding: 0 20px;
    }
    
    .tab-btn {
        padding: 10px 20px;
        font-size: 0.95rem;
    }
    
    .rankings-table th,
    .rankings-table td {
        padding: 12px 10px;
        font-size: 0.9rem;
    }
    
    .rankings-table-container h3 {
        font-size: 1.5rem;
        padding: 20px 15px;
    }
}

/* Back link styling */
.back-link {
    display: inline-flex;
    align-items: center;
    color: #2c5f2d;
    text-decoration: none;
    font-weight: 600;
    margin-bottom: 20px;
    transition: all 0.2s;
}

.back-link:hover {
    color: #1f4320;
    transform: translateX(-5px);
}
