/**
 * Global Points System - UI Styles
 * 
 * Styles for global points display, level badges, progress bars,
 * and leaderboard components.
 * 
 * @version 1.0
 * @date 2026-01-29
 */

/* ===========================
   Global Points Card
   =========================== */

.global-points-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 20px;
    color: white;
    margin: 20px 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.global-points-card h3 {
    margin: 0 0 15px 0;
    font-size: 1.5em;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.points-breakdown {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 15px;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.breakdown-item:last-child {
    border-bottom: none;
}

.breakdown-item.total {
    margin-top: 10px;
    padding-top: 15px;
    border-top: 2px solid rgba(255, 255, 255, 0.5);
    font-size: 1.3em;
    font-weight: bold;
}

.breakdown-item .label {
    font-weight: 500;
    opacity: 0.9;
}

.breakdown-item .value {
    font-weight: bold;
    font-size: 1.1em;
}

.breakdown-item .value.bonus {
    color: #90ee90;
}

/* ===========================
   User Level Display
   =========================== */

.user-level-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin: 20px 0;
}

.level-badge {
    font-size: 4em;
    text-align: center;
    margin-bottom: 10px;
}

.level-info {
    text-align: center;
}

.level-info h3 {
    color: #667eea;
    margin: 5px 0;
    font-size: 2em;
}

.level-info .level-title {
    color: #764ba2;
    font-size: 1.3em;
    font-weight: 600;
    margin: 5px 0;
}

.level-info .global-points {
    color: #666;
    font-size: 1.1em;
    margin: 10px 0;
}

.level-progress {
    margin-top: 20px;
}

/* .progress-bar {
    background: #e0e0e0;
    border-radius: 10px;
    height: 20px;
    overflow: hidden;
    margin-bottom: 10px;
} */

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    transition: width 0.5s ease;
}

.progress-text {
    text-align: center;
    color: #666;
    font-size: 0.9em;
    margin: 0;
}

/* ===========================
   Leaderboard Table
   =========================== */

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.leaderboard-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.leaderboard-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 1em;
}

.leaderboard-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #e0e0e0;
}

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

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

.leaderboard-table .rank {
    font-weight: bold;
    color: #667eea;
    min-width: 60px;
}

.leaderboard-table .player {
    font-weight: 600;
    color: #333;
}

.leaderboard-table .level {
    color: #764ba2;
    font-weight: 500;
}

.leaderboard-table .points {
    font-weight: bold;
    color: #667eea;
    text-align: right;
}

.leaderboard-table .achievements {
    color: #666;
    text-align: right;
    font-size: 0.9em;
}

/* ===========================
   Level Badges (inline)
   =========================== */

.level-badge-inline {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9em;
}

.level-badge-inline .emoji {
    font-size: 1.2em;
}

/* ===========================
   Points History
   =========================== */

.points-history {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin: 20px 0;
}

.points-history h3 {
    color: #667eea;
    margin: 0 0 15px 0;
    font-size: 1.3em;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid #e0e0e0;
    transition: background 0.2s;
}

.history-item:hover {
    background: #f9f9f9;
}

.history-item:last-child {
    border-bottom: none;
}

.history-item .quiz-info {
    flex: 1;
}

.history-item .quiz-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 3px;
}

.history-item .quiz-details {
    font-size: 0.85em;
    color: #666;
}

.history-item .points-earned {
    font-weight: bold;
    font-size: 1.2em;
    color: #667eea;
    margin-left: 15px;
}

.history-item .achievement-badge {
    margin-left: 10px;
}

.history-item.achieved {
    background: #f0f9ff;
}

/* ===========================
   Responsive Design
   =========================== */

@media (max-width: 768px) {
    .global-points-card,
    .user-level-card,
    .points-history {
        padding: 15px;
        margin: 15px 0;
    }

    .level-badge {
        font-size: 3em;
    }

    .level-info h3 {
        font-size: 1.5em;
    }

    .leaderboard-table {
        font-size: 0.9em;
    }

    .leaderboard-table th,
    .leaderboard-table td {
        padding: 10px 8px;
    }

    .breakdown-item {
        font-size: 0.9em;
    }
}

@media (max-width: 480px) {
    .leaderboard-table {
        font-size: 0.8em;
    }

    .leaderboard-table th,
    .leaderboard-table td {
        padding: 8px 5px;
    }

    .history-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .history-item .points-earned {
        margin-left: 0;
        margin-top: 10px;
    }
}
