/**
 * Level Progression Styling
 * Modern glass-morphism effects for level displays
 */

/* Level Progress Bar */
.level-progress-container {
    position: relative;
    background: rgba(15, 23, 42, 0.4);
    border-radius: 12px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.level-progress-bar {
    height: 8px;
    background: rgba(30, 41, 59, 0.8);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.level-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #22c55e, #10b981, #34d399);
    border-radius: 4px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.5);
}

.level-progress-fill::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: progressShine 2s infinite;
}

@keyframes progressShine {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Level Display */
.level-display {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.level-label {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.level-number {
    font-size: 24px;
    font-weight: 900;
    color: #22c55e;
    text-shadow: 0 0 10px rgba(34, 197, 94, 0.5);
    min-width: 30px;
    text-align: center;
}

/* Level Up Effects */
.level-up-glow {
    animation: levelUpGlow 1s ease-out;
}

@keyframes levelUpGlow {
    0% { 
        box-shadow: 0 0 0 rgba(34, 197, 94, 0);
        transform: scale(1);
    }
    50% { 
        box-shadow: 0 0 30px rgba(34, 197, 94, 0.8);
        transform: scale(1.05);
    }
    100% { 
        box-shadow: 0 0 0 rgba(34, 197, 94, 0);
        transform: scale(1);
    }
}

/* Game Card Level Badge */
.game-card-level-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: linear-gradient(135deg, #22c55e, #10b981);
    color: white;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 900;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.2);
    animation: badgePulse 2s infinite;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Enhanced Level Progress Bar */
.level-progress-enhanced {
    position: relative;
    height: 12px;
    background: rgba(30, 41, 59, 0.6);
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.level-progress-enhanced-fill {
    height: 100%;
    background: linear-gradient(90deg, #22c55e, #10b981, #34d399, #6ee7b7);
    border-radius: 6px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: 
        0 0 15px rgba(34, 197, 94, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.level-progress-enhanced-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: enhancedProgressShine 3s infinite;
}

@keyframes enhancedProgressShine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Level Milestone Markers */
.level-milestones {
    display: flex;
    justify-content: space-between;
    margin-top: 4px;
    padding: 0 2px;
}

.level-milestone {
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.level-milestone.active {
    background: #22c55e;
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.8);
    transform: scale(1.5);
}

/* Responsive Level Display */
@media (max-width: 768px) {
    .level-progress-container {
        padding: 8px;
    }
    
    .level-number {
        font-size: 20px;
    }
    
    .level-label {
        font-size: 12px;
    }
    
    .game-card-level-badge {
        width: 28px;
        height: 28px;
        font-size: 10px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .level-progress-fill {
        background: linear-gradient(90deg, #16a34a, #15803d, #166534);
    }
    
    .level-number {
        color: #16a34a;
        text-shadow: 0 0 8px rgba(22, 163, 74, 0.6);
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .level-progress-fill {
        background: #22c55e;
        border: 1px solid #ffffff;
    }
    
    .level-number {
        color: #22c55e;
        text-shadow: none;
        font-weight: 900;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .level-progress-fill,
    .level-progress-enhanced-fill {
        transition: none;
    }
    
    .level-progress-fill::before,
    .level-progress-enhanced-fill::after {
        animation: none;
    }
    
    .game-card-level-badge {
        animation: none;
    }
}

/* Level Completion Celebration */
.level-completion-celebration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

.level-completion-particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: #22c55e;
    border-radius: 50%;
    animation: celebrationParticle 2s ease-out forwards;
}

@keyframes celebrationParticle {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateY(-200px) scale(0);
        opacity: 0;
    }
}

/* Level Achievement Badge */
.level-achievement-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(16, 185, 129, 0.2));
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    color: #22c55e;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.level-achievement-badge:hover {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.3), rgba(16, 185, 129, 0.3));
    border-color: rgba(34, 197, 94, 0.5);
    transform: translateY(-1px);
}

.level-achievement-icon {
    width: 16px;
    height: 16px;
    background: #22c55e;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: white;
    font-weight: 900;
}