/* Leaderboard Controls */
.leaderboard-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 20px;
    background: #2a2a2a;
    padding: 15px;
    border-radius: 8px;
    border: 2px solid var(--primary-color);
}

.filter-controls, .sort-controls {
    display: flex;
    gap: 10px;
}

.filter-controls button, .sort-controls button {
    background: #1a1a1a;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-controls button:hover, .sort-controls button:hover {
    background: #3a3a3a;
}

.filter-controls button.active, .sort-controls button.active {
    background: var(--primary-color);
    color: #000;
}

.sort-indicator {
    margin-left: 4px;
    font-size: 0.9em;
}

.date-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #1a1a1a;
    padding: 10px;
    border-radius: 4px;
}

.date-selector label {
    color: #fff;
    font-size: 0.9em;
    white-space: nowrap;
}

.date-selector input[type="date"] {
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    color: #fff;
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    min-width: 150px;
    transition: border-color 0.2s;
}

.date-selector input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

.date-selector input[type="date"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.date-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-direction: column;
}

.date-range-display {
    margin-top: 4px;
    text-align: center;
}

.date-range-display small {
    color: var(--primary-color);
    font-weight: 500;
    font-size: 0.85em;
    white-space: nowrap;
}

.nav-button {
    background: #1a1a1a;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
}

.nav-button:hover:not(:disabled) {
    background: #3a3a3a;
}

.nav-button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.nav-button.active {
    background: var(--primary-color);
    color: #000;
}

/* Leaderboard Stats */
.leaderboard-stats {
    margin-bottom: 20px;
}

.stat-box {
    background: #2a2a2a;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    border: 2px solid var(--primary-color);
    transition: transform 0.2s;
}

.stat-box h3 {
    margin: 0 0 10px 0;
    color: #888;
    font-size: 0.9em;
}

.stat-box p {
    margin: 0;
    font-size: 1.5em;
    font-weight: bold;
    color: #fff;
    transition: transform 0.2s;
}

/* Leaderboard Table */
.leaderboard-table {
    margin-bottom: 20px;
    overflow-x: auto;
}

.table-container {
    background: #2a2a2a;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
    border: 2px solid var(--primary-color);
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
}

.leaderboard-table th,
.leaderboard-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #3a3a3a;
}

.leaderboard-table th {
    background: #1a1a1a;
    color: var(--primary-color);
    font-weight: normal;
    position: sticky;
    top: 0;
    z-index: 1;
}

.leaderboard-table tr:last-child td {
    border-bottom: none;
}

.leaderboard-table tr:hover {
    background: #3a3a3a;
}

/* Special row styling */
.leaderboard-table tr.current-user {
    background: rgba(var(--primary-color-rgb), 0.1);
    border-left: 4px solid var(--primary-color);
}

.leaderboard-table tr.rank-1 {
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.1), transparent);
}

.leaderboard-table tr.rank-2 {
    background: linear-gradient(90deg, rgba(192, 192, 192, 0.1), transparent);
}

.leaderboard-table tr.rank-3 {
    background: linear-gradient(90deg, rgba(205, 127, 50, 0.1), transparent);
}

/* Column specific styling */
.leaderboard-table .rank {
    font-weight: bold;
    text-align: center;
    width: 60px;
}

.leaderboard-table .score,
.leaderboard-table .bytes {
    font-family: 'Courier New', monospace;
    text-align: right;
}

.leaderboard-table .timestamp {
    font-size: 0.9em;
    color: #aaa;
}

/* Loading and empty states */
.loading, .no-entries {
    text-align: center;
    color: #888;
    font-style: italic;
    padding: 40px 20px;
}

.loading {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.pagination-btn {
    background: #2a2a2a;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 40px;
}

.pagination-btn:hover:not(:disabled) {
    background: #3a3a3a;
    transform: translateY(-1px);
}

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

.pagination-btn.active {
    background: var(--primary-color);
    color: #000;
    font-weight: bold;
}

.pagination-ellipsis {
    color: #888;
    padding: 8px 4px;
}

#page-info {
    color: #888;
    margin: 0 10px;
    white-space: nowrap;
}

/* Toast notifications */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 4px;
    color: #fff;
    font-weight: 500;
    z-index: 1000;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    max-width: 300px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-info {
    background: #3498db;
}

.toast-success {
    background: #2ecc71;
}

.toast-warning {
    background: #f39c12;
}

.toast-error {
    background: #e74c3c;
}

/* Active Filters */
.btn.active {
    background-color: var(--accent-color);
    transform: scale(1.05);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.leaderboard-table {
    animation: fadeIn 0.5s ease-in;
}

/* Stats overview grid */
.stats-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .leaderboard-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-controls, .sort-controls {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .date-selector {
        justify-content: center;
    }
    
    .stats-overview {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
}

@media (max-width: 768px) {
    .leaderboard-table th,
    .leaderboard-table td {
        padding: 8px 4px;
        font-size: 0.9em;
    }
    
    .leaderboard-table .timestamp {
        display: none;
    }
    
    .leaderboard-table th:last-child,
    .leaderboard-table td:last-child {
        display: none;
    }
    
    .stats-overview {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stat-box {
        padding: 15px 10px;
    }
    
    .toast {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .leaderboard-controls {
        padding: 10px;
        gap: 15px;
    }
    
    .filter-controls button, .sort-controls button {
        padding: 6px 12px;
        font-size: 0.9em;
    }
    
    .leaderboard-table .car {
        display: none;
    }
    
    .leaderboard-table th:nth-child(6),
    .leaderboard-table td:nth-child(6) {
        display: none;
    }
    
    .stats-overview {
        grid-template-columns: 1fr;
    }
    
    .pagination {
        gap: 5px;
    }
    
    .pagination-btn {
        padding: 6px 10px;
        font-size: 0.9em;
    }
}

/* Leaderboard container */
.leaderboard-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.leaderboard-container h1 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--primary-color);
    font-size: 2.5em;
}

/* Error message styling */
.error-message {
    background: #e74c3c;
    color: #fff;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    text-align: center;
}

/* Enhanced filter styling */
.leaderboard-filters {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-group label {
    color: #888;
    font-size: 0.9em;
}

.filter-select {
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    color: #fff;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
}

/* Button styles */
.btn {
    display: inline-block;
    padding: 10px 20px;
    margin: 5px;
    border: none;
    border-radius: 4px;
    font-size: 1em;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary-color);
    color: #000;
}

.btn-primary:hover {
    background: #00e077;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 255, 136, 0.3);
}

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

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Quick actions styling */
.quick-actions {
    border-top: 1px solid #3a3a3a;
    padding-top: 20px;
}

/* Additional utility classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.font-mono { font-family: 'Courier New', monospace; }
.font-bold { font-weight: bold; }

/* Loading overlay for better UX */
.leaderboard-container.loading {
    position: relative;
}

.leaderboard-container.loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100;
    pointer-events: none;
} 