/**
 * Quiz Leaderboard Location - Frontend Styles
 */

/* Leaderboard Container */
.qll-leaderboard-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.qll-leaderboard-wrapper {
    width: 100%;
}

.qll-leaderboard-title {
    margin: 0 0 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
    font-size: 1.5em;
    color: #333;
}

/* Filters */
.qll-filters {
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.qll-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
}

.qll-filter-row:last-child {
    margin-bottom: 0;
}

.qll-filter-group {
    flex: 1;
    min-width: 200px;
}

.qll-filter-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 0.9em;
    color: #555;
}

.qll-filter-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
    transition: border-color 0.3s;
}

.qll-filter-select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
}

/* Buttons */
.qll-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.qll-btn-primary {
    background: #0073aa;
    color: #fff;
}

.qll-btn-primary:hover {
    background: #005a87;
}

.qll-btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.qll-btn-secondary:hover {
    background: #e0e0e0;
}

/* Leaderboard Table */
.qll-leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.qll-leaderboard-table th,
.qll-leaderboard-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.qll-leaderboard-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #555;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.qll-leaderboard-table tbody tr {
    transition: background 0.2s;
}

.qll-leaderboard-table tbody tr:hover {
    background: #f8f9fa;
}

/* Top 3 Styling */
.qll-top-1 {
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.1) 0%, transparent 100%);
}

.qll-top-2 {
    background: linear-gradient(90deg, rgba(192, 192, 192, 0.1) 0%, transparent 100%);
}

.qll-top-3 {
    background: linear-gradient(90deg, rgba(205, 127, 50, 0.1) 0%, transparent 100%);
}

/* Rank Column */
.qll-rank {
    width: 60px;
    text-align: center !important;
    font-weight: 700;
    font-size: 1.1em;
}

.qll-medal {
    font-size: 1.5em;
}

/* Avatar Column */
.qll-avatar {
    width: 50px;
}

.qll-avatar img {
    border-radius: 50%;
    display: block;
}

/* Name Column */
.qll-name {
    font-weight: 600;
    color: #333;
}

/* Location Column */
.qll-location {
    color: #666;
    font-size: 0.9em;
}

/* Score Column */
.qll-score {
    text-align: right !important;
}

.qll-score strong {
    color: #0073aa;
    font-size: 1.1em;
}

.qll-score small {
    display: block;
    color: #999;
    font-size: 0.85em;
}

/* Date Column */
.qll-date {
    color: #666;
    font-size: 0.9em;
}

/* No Results */
.qll-no-results {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-style: italic;
}

/* User Rank Display */
.qll-user-rank {
    text-align: center;
    padding: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    color: #fff;
}

.qll-rank-display {
    margin-bottom: 10px;
}

.qll-rank-number {
    display: block;
    font-size: 3em;
    font-weight: 700;
    line-height: 1;
}

.qll-rank-total {
    font-size: 1em;
    opacity: 0.9;
}

.qll-rank-level {
    font-size: 0.9em;
    opacity: 0.8;
    margin-top: 10px;
}

.qll-no-rank {
    margin: 0;
    opacity: 0.9;
}

.qll-login-required {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    color: #666;
}

/* Loading State */
.qll-loading {
    position: relative;
    min-height: 100px;
}

.qll-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0073aa;
    border-radius: 50%;
    animation: qll-spin 1s linear infinite;
}

@keyframes qll-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .qll-filter-row {
        flex-direction: column;
    }
    
    .qll-filter-group {
        min-width: 100%;
    }
    
    .qll-leaderboard-table {
        display: block;
        overflow-x: auto;
    }
    
    .qll-leaderboard-table th,
    .qll-leaderboard-table td {
        padding: 10px;
        font-size: 0.9em;
    }
    
    .qll-avatar {
        display: none;
    }
    
    .qll-location {
        display: none;
    }
    
    .qll-rank-number {
        font-size: 2.5em;
    }
}

@media (max-width: 480px) {
    .qll-leaderboard-container {
        padding: 15px;
    }
    
    .qll-filters {
        padding: 15px;
    }
    
    .qll-btn {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .qll-btn:last-child {
        margin-bottom: 0;
    }
}
