/**
 * Gamification Styles
 */

/* Navbar XP/Level Display */
.navbar-xp-display {
    display: flex;
    align-items: center;
    gap: 10px;
}

.navbar-level-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
}

.navbar-xp-bar {
    width: 150px;
    height: 20px;
    background-color: #e9ecef;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
}

.navbar-xp-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50 0%, #8BC34A 100%);
    transition: width 0.3s ease;
    border-radius: 10px;
}

.navbar-xp-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.75rem;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}

/* Navbar Streak Display */
.navbar-streak-display {
    display: flex;
    align-items: center;
}

.navbar-streak-badge {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    background-color: #f8f9fa;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    color: #6c757d;
    transition: all 0.3s ease;
}

.navbar-streak-badge.active {
    background-color: #fff3cd;
    color: #ff6b6b;
}

.navbar-streak-badge.active i {
    animation: flicker 2s infinite;
}

@keyframes flicker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Achievement Notifications */
.achievement-notification {
    position: fixed;
    top: 20px;
    right: -400px;
    width: 350px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    padding: 20px;
    z-index: 9999;
    transition: right 0.3s ease;
}

.achievement-notification.show {
    right: 20px;
}

.achievement-content {
    display: flex;
    gap: 15px;
    align-items: center;
}

.achievement-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}

.achievement-details h5 {
    margin: 0 0 5px 0;
    color: #333;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.achievement-name {
    margin: 0 0 3px 0;
    font-weight: 600;
    color: #333;
    font-size: 1.1rem;
}

.achievement-desc {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

.achievement-reward {
    display: inline-block;
    margin-top: 8px;
    padding: 3px 10px;
    background-color: #ffd700;
    color: #333;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Level Up Notification */
.level-up-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 60px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    z-index: 9999;
    text-align: center;
    transition: transform 0.3s ease;
}

.level-up-notification.show {
    transform: translate(-50%, -50%) scale(1);
}

.level-up-content h4 {
    margin: 0 0 20px 0;
    font-size: 2rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.level-change {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 600;
}

.old-level {
    opacity: 0.7;
}

.new-level {
    font-size: 2rem;
    color: #ffd700;
}

/* Sparkle effects */
.level-up-effects {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.sparkle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: white;
    border-radius: 50%;
    animation: sparkle 1s ease-out infinite;
}

.sparkle-1 { top: 20%; left: 20%; animation-delay: 0s; }
.sparkle-2 { top: 80%; left: 80%; animation-delay: 0.3s; }
.sparkle-3 { top: 20%; left: 80%; animation-delay: 0.6s; }

@keyframes sparkle {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: scale(20) rotate(180deg);
        opacity: 0;
    }
}

/* XP Earned Animation */
.xp-earned-display {
    position: fixed;
    z-index: 9998;
    pointer-events: none;
    opacity: 0;
    transform: translateY(0);
    transition: all 0.5s ease;
}

.xp-earned-display.show {
    opacity: 1;
    transform: translateY(-30px);
}

.xp-earned-display span {
    display: inline-block;
    padding: 8px 16px;
    background: #4CAF50;
    color: white;
    border-radius: 20px;
    font-weight: 600;
    font-size: 1.1rem;
}

/* Streak Widget */
.streak-widget {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.streak-widget-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.current-streak {
    display: flex;
    align-items: center;
    gap: 15px;
}

.streak-info {
    text-align: left;
}

.streak-number {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.streak-label {
    color: #666;
    font-size: 0.9rem;
}

/* Daily Challenge Widget */
.daily-challenge-widget {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.daily-challenge-content {
    position: relative;
}

.daily-challenge-content.completed {
    opacity: 0.7;
}

.daily-challenge-content h6 {
    color: #333;
    font-weight: 600;
}

.challenge-reward {
    display: inline-block;
    margin-top: 10px;
    padding: 4px 12px;
    background: rgba(255, 215, 0, 0.2);
    color: #856404;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Achievement Showcase Modal */
.achievement-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.achievement-card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    transition: transform 0.2s ease;
    position: relative;
    overflow: hidden;
}

.achievement-card.earned {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.achievement-card:hover {
    transform: translateY(-5px);
}

.achievement-card-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 15px;
    background: #e9ecef;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #6c757d;
}

.achievement-card.earned .achievement-card-icon {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.achievement-card h6 {
    margin: 0 0 5px 0;
    font-weight: 600;
}

.achievement-card p {
    margin: 0 0 10px 0;
    font-size: 0.85rem;
    color: #666;
}

.achievement-progress {
    width: 100%;
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 10px;
}

.achievement-progress-fill {
    height: 100%;
    background: #4CAF50;
    transition: width 0.3s ease;
}

.achievement-rarity {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.rarity-common { background: #e9ecef; color: #6c757d; }
.rarity-rare { background: #cfe2ff; color: #084298; }
.rarity-epic { background: #e0cffc; color: #59359a; }
.rarity-legendary { background: #fff3cd; color: #997404; }

/* Responsive adjustments */
@media (max-width: 768px) {
    .navbar-xp-display {
        display: none; /* Hide on mobile to save space */
    }
    
    .achievement-notification {
        width: 90%;
        right: -100%;
    }
    
    .achievement-notification.show {
        right: 5%;
    }
}