/**
 * VS Timed Quiz – Leaderboard Styles
 * 
 * @package VS_Daily_Quiz
 * @subpackage Timed_Quiz
 * @since 0.4.1
 */

/* =========================================================================
   CONTAINER
   ========================================================================= */

.vs-tq-leaderboard-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

.vs-tq-leaderboard {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    padding: 24px;
}

/* =========================================================================
   HEADER
   ========================================================================= */

.vs-tq-leaderboard-header {
    text-align: center;
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.vs-tq-leaderboard-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: #1a1a2e;
}

.vs-tq-leaderboard-count {
    color: #666;
    font-size: 14px;
}

/* =========================================================================
   USER POSITION CARD
   ========================================================================= */

.vs-tq-user-position-card {
    background: linear-gradient(135deg, #B0CEFF 100%, #6567F3 100%);
    color: #fff;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 20px;
}

.vs-tq-user-position-header {
    font-size: 13px;
    opacity: 0.9;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.vs-tq-user-position-content {
    display: flex;
    align-items: center;
    gap: 20px;
}

.vs-tq-user-rank {
    font-size: 42px;
    font-weight: 700;
    line-height: 1;
}

.vs-tq-user-stats {
    display: flex;
    gap: 24px;
}

.vs-tq-user-score,
.vs-tq-user-games {
    display: flex;
    flex-direction: column;
}

.vs-tq-user-score-value,
.vs-tq-user-games-value {
    font-size: 24px;
    font-weight: 600;
    line-height: 1.2;
}

.vs-tq-user-score-label,
.vs-tq-user-games-label {
    font-size: 11px;
    opacity: 0.8;
    text-transform: uppercase;
}

/* =========================================================================
   LEADERBOARD TABLE (using divs)
   ========================================================================= */

.vs-tq-leaderboard-table {
    display: flex;
    flex-direction: column;
}

.vs-tq-leaderboard-row {
    display: grid;
    grid-template-columns: 60px 1fr 80px 70px;
    align-items: center;
    padding: 12px 8px;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.15s ease;
}

.vs-tq-leaderboard-row:last-child {
    border-bottom: none;
}

.vs-tq-leaderboard-row:not(.vs-tq-leaderboard-row-header):hover {
    background: #f8f9fa;
}

/* Header row */
.vs-tq-leaderboard-row-header {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
    border-bottom: 2px solid #e0e0e0;
}

/* Columns */
.vs-tq-lb-rank {
    text-align: center;
    font-weight: 700;
    font-size: 15px;
    color: #1a1a2e;
}

.vs-tq-medal {
    font-size: 22px;
    line-height: 1;
}

.vs-tq-lb-player {
    font-weight: 500;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.vs-tq-you-badge {
    background: #667eea;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

.vs-tq-lb-score {
    text-align: right;
    font-weight: 700;
    font-size: 16px;
    color: #667eea;
}

.vs-tq-lb-games {
    text-align: right;
    color: #888;
    font-size: 13px;
}

/* Current user row highlight */
.vs-tq-leaderboard-row-me {
    background: linear-gradient(90deg, #f0f4ff 0%, #f8f9ff 100%);
}

.vs-tq-leaderboard-row-me .vs-tq-lb-player {
    font-weight: 600;
    color: #667eea;
}

/* =========================================================================
   FOOTER / LOAD MORE
   ========================================================================= */

.vs-tq-leaderboard-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
}

/* =========================================================================
   BUTTONS
   ========================================================================= */

.vs-tq-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.vs-tq-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.vs-tq-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.vs-tq-btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.vs-tq-btn-secondary:hover {
    background: #e0e0e0;
}

.vs-tq-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* =========================================================================
   LOADING STATE
   ========================================================================= */

.vs-tq-leaderboard-loading {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.vs-tq-leaderboard-loading p {
    margin: 16px 0 0 0;
}

.vs-tq-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto;
    border: 3px solid #f0f0f0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: vs-tq-spin 0.8s linear infinite;
}

@keyframes vs-tq-spin {
    to { transform: rotate(360deg); }
}

/* =========================================================================
   ERROR STATE
   ========================================================================= */

.vs-tq-leaderboard-error {
    text-align: center;
    padding: 40px 20px;
    color: #dc3545;
}

.vs-tq-error-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 12px;
}

.vs-tq-leaderboard-error p {
    margin: 0 0 20px 0;
}

/* =========================================================================
   EMPTY STATE
   ========================================================================= */

.vs-tq-leaderboard-empty {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.vs-tq-empty-icon {
    font-size: 64px;
    display: block;
    margin-bottom: 16px;
    opacity: 0.5;
}

.vs-tq-leaderboard-empty p {
    margin: 0;
    font-size: 16px;
}

/* =========================================================================
   RESPONSIVE
   ========================================================================= */

@media (max-width: 480px) {
    .vs-tq-leaderboard-container {
        padding: 12px;
    }
    
    .vs-tq-leaderboard {
        padding: 16px;
        border-radius: 12px;
    }
    
    .vs-tq-leaderboard-header h2 {
        font-size: 20px;
    }
    
    .vs-tq-user-position-card {
        padding: 14px 16px;
    }
    
    .vs-tq-user-position-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .vs-tq-user-rank {
        font-size: 36px;
    }
    
    .vs-tq-leaderboard-row {
        grid-template-columns: 50px 1fr 60px;
        padding: 10px 4px;
    }
    
    .vs-tq-lb-games {
        display: none;
    }
    
    .vs-tq-leaderboard-row-header .vs-tq-lb-games {
        display: none;
    }
}

/* =========================================================================
   DARK MODE
   ========================================================================= */

/*@media (prefers-color-scheme: dark) {*/
/*    .vs-tq-leaderboard {*/
/*        background: #1e1e2f;*/
/*        box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);*/
/*    }*/
    
/*    .vs-tq-leaderboard-header h2 {*/
/*        color: #fff;*/
/*    }*/
    
/*    .vs-tq-leaderboard-count {*/
/*        color: #aaa;*/
/*    }*/
    
/*    .vs-tq-leaderboard-row {*/
/*        border-color: #333;*/
/*    }*/
    
/*    .vs-tq-leaderboard-row-header {*/
/*        color: #888;*/
/*        border-color: #444;*/
/*    }*/
    
/*    .vs-tq-leaderboard-row:not(.vs-tq-leaderboard-row-header):hover {*/
/*        background: #2a2a3d;*/
/*    }*/
    
/*    .vs-tq-lb-rank {*/
/*        color: #fff;*/
/*    }*/
    
/*    .vs-tq-lb-player {*/
/*        color: #ddd;*/
/*    }*/
    
/*    .vs-tq-lb-games {*/
/*        color: #888;*/
/*    }*/
    
/*    .vs-tq-leaderboard-row-me {*/
/*        background: linear-gradient(90deg, #2a2a4d 0%, #252540 100%);*/
/*    }*/
    
/*    .vs-tq-leaderboard-footer {*/
/*        border-color: #333;*/
/*    }*/
    
/*    .vs-tq-btn-secondary {*/
/*        background: #2a2a3d;*/
/*        color: #ddd;*/
/*    }*/
    
/*    .vs-tq-btn-secondary:hover {*/
/*        background: #3a3a4d;*/
/*    }*/
    
/*    .vs-tq-leaderboard-loading {*/
/*        color: #aaa;*/
/*    }*/
    
/*    .vs-tq-spinner {*/
/*        border-color: #333;*/
/*        border-top-color: #667eea;*/
/*    }*/
    
/*    .vs-tq-leaderboard-empty {*/
/*        color: #888;*/
/*    }*/
/*}*/
