/* ================= GAMIFICATION SYSTEM STYLES ================= */
/* Sistema de gamificação para Metas Concursos */

/* Container principal da gamificação */
.gamification-container {
    position: relative;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-radius: 12px;
    padding: 16px 20px;
    margin-top: 20px;
    border: 1px solid rgba(14, 165, 233, 0.2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

/* Header da gamificação */
.gamification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.gamification-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.gamification-title i {
    color: #fbbf24;
}

/* Score display */
.score-display {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    position: relative;
}

.score-value {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #0ea5e9, #fbbf24);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent;
    animation: pulse 2s infinite;
    position: relative;
}

.score-label {
    font-size: 0.9rem;
    color: #94a3b8;
    font-weight: 500;
}

/* Feedback de pontos adicionados */
.score-feedback {
    position: absolute;
    top: -40px; /* Começa mais acima */
    right: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
    padding: 6px 10px;
    border-radius: 4px;
    animation: scoreFeedback 4s ease-out forwards;
    z-index: 10;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.score-feedback::before {
    content: '+';
    margin-right: 4px;
}

@keyframes scoreFeedback {
    0% {
        opacity: 0;
        transform: translateY(-20px) scale(0.7); /* Começa acima e menor */
    }
    15% {
        opacity: 1;
        transform: translateY(-10px) scale(1.05); /* Desce um pouco e aumenta */
    }
    30% {
        opacity: 1;
        transform: translateY(0) scale(1.1); /* Posição normal, máximo tamanho */
    }
    60% {
        opacity: 1;
        transform: translateY(0) scale(1); /* Mantém na posição */
    }
    80% {
        opacity: 0.7;
        transform: translateY(5px) scale(0.95); /* Começa a descer e diminuir */
    }
    100% {
        opacity: 0;
        transform: translateY(15px) scale(0.8); /* Termina abaixo */
        display: none;
    }
}

/* Progress bars */
.progress-container {
    margin-bottom: 16px;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 0.85rem;
    color: #cbd5e1;
}

.progress-bar {
    height: 10px;
    background: #1e293b;
    border-radius: 5px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #0ea5e9, #6366f1);
    border-radius: 5px;
    transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: shimmer 2s infinite;
}

/* Level system */
.level-system {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding: 12px;
    background: rgba(30, 41, 59, 0.5);
    border-radius: 8px;
    border: 1px solid rgba(14, 165, 233, 0.1);
}

.level-icon {
    font-size: 1.5rem;
    color: #fbbf24;
}

.level-info {
    flex: 1;
}

.level-name {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
}

.level-range {
    font-size: 0.8rem;
    color: #94a3b8;
}

/* Streak system */
.streak-system {
    margin-bottom: 16px;
    padding: 12px;
    background: rgba(220, 38, 38, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(220, 38, 38, 0.2);
}

.streak-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.streak-icon {
    color: #fbbf24;
    font-size: 1.2rem;
}

.streak-text {
    font-size: 0.95rem;
    color: #fff;
    font-weight: 500;
}

.streak-days {
    color: #fbbf24;
    font-weight: 600;
}

.streak-reward {
    font-size: 0.85rem;
    color: #cbd5e1;
    margin-top: 4px;
}

/* Missions */
.missions-container {
    margin-top: 20px;
}

.missions-title {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.missions-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mission-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(30, 41, 59, 0.5);
    border-radius: 6px;
    border-left: 3px solid #0ea5e9;
    transition: all 0.3s;
}

.mission-item.completed {
    border-left-color: #10b981;
    opacity: 0.7;
}

.mission-checkbox {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 2px solid #475569;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mission-item.completed .mission-checkbox {
    background: #10b981;
    border-color: #10b981;
}

.mission-checkbox i {
    font-size: 0.8rem;
    color: white;
    display: none;
}

.mission-item.completed .mission-checkbox i {
    display: block;
}

.mission-text {
    flex: 1;
    font-size: 0.85rem;
    color: #cbd5e1;
}

.mission-reward {
    font-size: 0.8rem;
    color: #fbbf24;
    font-weight: 600;
}

/* Achievements */
.achievements-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: rgba(30, 41, 59, 0.5);
    border-radius: 20px;
    margin: 4px;
    font-size: 0.8rem;
    color: #cbd5e1;
    border: 1px solid rgba(14, 165, 233, 0.2);
}

.achievements-badge.unlocked {
    background: rgba(14, 165, 233, 0.1);
    border-color: #0ea5e9;
}

/* Animations */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

@keyframes progressFill {
    from { width: 0; }
    to { width: var(--target-width); }
}

.level-up-animation {
    animation: levelUp 0.5s ease-out;
}

@keyframes levelUp {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

/* Responsive design */
@media (max-width: 768px) {
    .gamification-container {
        padding: 12px 16px;
        margin-top: 15px;
    }

    .score-value {
        font-size: 1.5rem;
    }

    .gamification-title {
        font-size: 1rem;
    }

    .level-system {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* Hosn-header integration */
.hosn-header .gamification-container {
    width: 100%;
    margin-top: 10px;
    border-radius: 0 0 8px 8px;
}

/* Heatmap integration */
.heatmap-container + .gamification-container {
    margin-top: 20px;
}