/**
 * Gamification CSS - Achievements and Streak System
 */

/* =============================================================================
   STREAK BADGE (Header)
   ============================================================================= */

#streakBadge {
    display: inline-block;
    padding: 4px 12px;
    background: linear-gradient(135deg, #ff6b6b, #ff8e53);
    color: white;
    border-radius: 20px;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    transition: transform 0.3s ease;
    margin-left: 16px;
}

#streakBadge:hover {
    transform: scale(1.1);
}

.streak-pulse {
    animation: pulse 0.6s ease;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* =============================================================================
   ACHIEVEMENT MODAL
   ============================================================================= */

.achievement-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.achievement-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.achievement-modal-content {
    position: relative;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px;
    border-radius: 20px;
    max-width: 500px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.5s ease;
}

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

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.fade-out {
    animation: fadeOut 0.3s ease forwards;
}

@keyframes fadeOut {
    to { opacity: 0; }
}

.achievement-icon {
    font-size: 80px;
    margin-bottom: 20px;
    animation: bounceIn 0.8s ease;
}

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

.achievement-title {
    font-size: 32px;
    margin: 0 0 20px 0;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.achievement-name {
    font-size: 28px;
    font-weight: bold;
    margin: 10px 0;
    padding: 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.2);
}

.achievement-name.rare {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.achievement-name.epic {
    background: linear-gradient(135deg, #b06ab3, #4568dc);
}

.achievement-name.legendary {
    background: linear-gradient(135deg, #f093fb, #f5576c);
}

.achievement-name.mythic {
    background: linear-gradient(135deg, #fa709a, #fee140);
    animation: glow 2s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 20px rgba(255, 255, 255, 0.5); }
    50% { box-shadow: 0 0 40px rgba(255, 255, 255, 0.8); }
}

.achievement-description {
    font-size: 18px;
    margin: 20px 0;
    opacity: 0.95;
}

.achievement-rarity {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    margin: 10px 0 20px 0;
    background: rgba(255, 255, 255, 0.3);
}

.achievement-close-btn {
    background: white;
    color: #667eea;
    border: none;
    padding: 12px 40px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.achievement-close-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* Confetti Animation */
.achievement-confetti {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    pointer-events: none;
    border-radius: 20px;
}

.confetti-piece {
    position: absolute;
    width: 10px;
    height: 10px;
    top: -10px;
    animation: confettiFall linear infinite;
}

@keyframes confettiFall {
    to {
        transform: translateY(600px) rotate(360deg);
        opacity: 0;
    }
}

/* =============================================================================
   ACHIEVEMENTS SECTION
   ============================================================================= */

.achievements-section {
    margin-top: 30px;
}

.achievements-section h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 24px;
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.achievement-card {
    background: white;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.achievement-card.unlocked {
    border: 3px solid #4CAF50;
}

.achievement-card.unlocked:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(76, 175, 80, 0.3);
}

.achievement-card.locked {
    opacity: 0.6;
    border: 2px dashed #ccc;
}

.achievement-card-icon {
    font-size: 36px;
    margin-bottom: 6px;
}

.achievement-card-icon.grayscale {
    filter: grayscale(100%);
    opacity: 0.5;
}

.achievement-card-name {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 5px;
    color: #333;
}

.achievement-card-desc {
    font-size: 11px;
    color: #666;
    margin-bottom: 6px;
    line-height: 1.3;
}

.achievement-card-rarity {
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 10px;
    display: inline-block;
    background: #f0f0f0;
    color: #666;
}

.achievement-card.unlocked.rare .achievement-card-rarity {
    background: #667eea;
    color: white;
}

.achievement-card.unlocked.epic .achievement-card-rarity {
    background: #b06ab3;
    color: white;
}

.achievement-card.unlocked.legendary .achievement-card-rarity {
    background: #f5576c;
    color: white;
}

.achievement-card.unlocked.mythic .achievement-card-rarity {
    background: linear-gradient(135deg, #fa709a, #fee140);
    color: white;
    font-weight: bold;
}

.no-achievements {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 40px 20px;
}

/* Locked Achievements Banner */
.achievements-locked-banner {
    margin-top: 30px;
    margin-bottom: 40px;
    background: #f5f5f5;
    border: 1px dashed #d0d0d0;
    border-radius: 8px;
    padding: 12px 20px;
    transition: background-color 0.2s ease;
}

.achievements-locked-banner:hover {
    background: #ebebeb;
}

.locked-banner-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.locked-banner-icon {
    font-size: 20px;
    opacity: 0.6;
}

.locked-banner-text {
    font-size: 14px;
    font-weight: 500;
    color: #666;
}

.locked-banner-cta {
    font-size: 13px;
    color: #888;
    font-weight: 400;
    font-style: italic;
}

/* =============================================================================
   RESPONSIVE
   ============================================================================= */

@media (max-width: 768px) {
    .achievement-modal-content {
        margin: 20px;
        padding: 30px 20px;
    }

    .achievement-title {
        font-size: 24px;
    }

    .achievement-name {
        font-size: 22px;
    }

    .achievement-icon {
        font-size: 60px;
    }

    .achievements-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }

    #streakBadge {
        font-size: 12px;
        padding: 3px 10px;
        margin-left: 8px;
    }

    .achievements-locked-banner {
        padding: 10px 15px;
        margin-bottom: 30px;
    }

    .locked-banner-text {
        font-size: 13px;
    }

    .locked-banner-icon {
        font-size: 18px;
    }

    .locked-banner-cta {
        font-size: 12px;
    }
}
