/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    background: rgba(255, 255, 255, 0.95);
    min-height: 100vh;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.1);
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px 0;
    border-bottom: 2px solid #e0e0e0;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.logo {
    height: 80px;
    width: auto;
}

.header-text h1 {
    color: #2c3e50;
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.header-text p {
    color: #7f8c8d;
    font-size: 1.1rem;
    font-weight: 300;
}

/* Controls */
.controls {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    flex-wrap: wrap;
    align-items: center;
}

.controls > div {
    display: flex;
    align-items: center;
    gap: 10px;
}

.controls label {
    font-weight: 600;
    color: #2c3e50;
    white-space: nowrap;
}

.controls select {
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    background: white;
    font-size: 14px;
    min-width: 150px;
    transition: border-color 0.3s ease;
}

.controls select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

/* Loading and Error States */
.loading {
    text-align: center;
    padding: 40px;
    color: #667eea;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid #f5c6cb;
}

/* Table Styles */
.table-container {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 30px;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.leaderboard-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 10px;
    text-align: center;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
}

.leaderboard-table th.clickable {
    cursor: pointer;
    transition: background-color 0.3s ease;
    user-select: none;
}

.leaderboard-table th.clickable:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

.leaderboard-table th.clickable.active {
    background: linear-gradient(135deg, #4a5bc7 0%, #5a3190 100%);
}

.leaderboard-table td {
    padding: 12px 10px;
    text-align: center;
    border-bottom: 1px solid #e0e0e0;
    vertical-align: middle;
}

.leaderboard-table tbody tr {
    transition: background-color 0.3s ease;
}

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

.leaderboard-table tbody tr:nth-child(even) {
    background-color: #fafafa;
}

.leaderboard-table tbody tr:nth-child(even):hover {
    background-color: #f0f0f0;
}

/* Column Styles */
.rank-col {
    width: 80px;
    font-weight: 700;
    color: #667eea;
    text-align: center;
}

.params-col {
    width: 220px;
    text-align: left !important;
    padding-left: 15px !important;
}

.overall-col {
    width: 120px;
    font-weight: 600;
}

.dataset-col {
    width: 100px;
}

/* Parameter Display */
.params-display {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
}

.param-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.param-label {
    font-weight: 600;
    color: #2c3e50;
    min-width: 60px;
}

.param-value {
    color: #667eea;
    font-weight: 500;
}


/* Medal Styles */
.rank-medal {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    height: 40px;
    animation: medalGlow 2s ease-in-out infinite alternate;
}

.rank-medal.gold {
    color: #ffd700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.4);
}

.rank-medal.silver {
    color: #c0c0c0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.4);
}

.rank-medal.bronze {
    color: #cd7f32;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.4);
}

@keyframes medalGlow {
    0% { transform: scale(1); }
    100% { transform: scale(1.1); }
}

.rank-number {
    font-size: 18px;
    font-weight: 700;
    color: #667eea;
}

.param-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.param-badge.true {
    background: #d4edda;
    color: #155724;
}

.param-badge.false {
    background: #f8d7da;
    color: #721c24;
}

/* Score Display */
.score-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.score-value {
    font-weight: 600;
    font-size: 14px;
}

.score-stderr {
    font-size: 10px;
    color: #6c757d;
    opacity: 0.8;
}

.score-value.high {
    color: #28a745;
}

.score-value.medium {
    color: #ffc107;
}

.score-value.low {
    color: #dc3545;
}


/* Dataset Info */
.dataset-info {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.dataset-info h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.5rem;
    text-align: center;
}

.dataset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.dataset-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.dataset-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.dataset-card h4 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.2rem;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
}

.dataset-card p {
    margin-bottom: 8px;
    font-size: 14px;
}

.dataset-card strong {
    color: #2c3e50;
}

.dataset-links {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.dataset-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
}

.dataset-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    color: white;
    text-decoration: none;
}

.dataset-link i {
    font-size: 11px;
}

/* Footer */
.footer {
    text-align: center;
    padding: 30px 0;
    border-top: 2px solid #e0e0e0;
    color: #6c757d;
    background: #f8f9fa;
    margin: 0 -20px -20px -20px;
    border-radius: 0 0 10px 10px;
}

.footer p {
    margin-bottom: 10px;
}

.footer a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: #5a6fd8;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .container {
        padding: 15px;
    }
    
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .controls > div {
        justify-content: space-between;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .header-text h1 {
        font-size: 2rem;
    }
    
    .table-container {
        overflow-x: auto;
    }
    
    .leaderboard-table {
        min-width: 800px;
    }
    
    .dataset-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .header-text h1 {
        font-size: 1.5rem;
    }
    
    .controls {
        padding: 15px;
    }
    
    .controls select {
        min-width: 120px;
    }
    
    .btn {
        padding: 8px 16px;
        font-size: 12px;
    }
}

/* Animation for table updates */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.leaderboard-table tbody tr {
    animation: fadeIn 0.5s ease-out;
}

/* Tooltip styles */
.tooltip {
    position: relative;
    cursor: help;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

.tooltip:hover::after {
    opacity: 1;
}
