/* FitCraft Gamification Styles */

/* Game Progress System */
.game-progress-container {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 16px;
    margin: 20px 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.level-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.level-badge {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #1a1a1a;
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: 0 2px 10px rgba(255, 215, 0, 0.4);
    animation: subtle-glow 2s ease-in-out infinite;
}

.xp-counter {
    color: white;
    font-weight: 600;
    font-size: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.xp-bar {
    position: relative;
    height: 24px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.xp-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, #4ade80, #22c55e);
    border-radius: 10px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 20px rgba(74, 222, 128, 0.5);
}

.xp-glow {
    position: absolute;
    top: 0;
    right: 0;
    width: 50px;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4));
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-50px); }
    100% { transform: translateX(50px); }
}

@keyframes subtle-glow {
    0%, 100% { transform: scale(1); box-shadow: 0 2px 10px rgba(255, 215, 0, 0.4); }
    50% { transform: scale(1.05); box-shadow: 0 4px 20px rgba(255, 215, 0, 0.6); }
}

.quest-progress {
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.85rem;
    margin-top: 8px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Level Up Animation */
.level-up-animation {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    text-align: center;
    animation: level-up-burst 2s ease-out;
}

.level-up-text {
    font-size: 3rem;
    font-weight: 800;
    color: #FFD700;
    text-shadow: 0 4px 20px rgba(255, 215, 0, 0.8);
    display: block;
    animation: bounce-in 0.6s ease-out;
}

.level-up-subtitle {
    font-size: 1.2rem;
    color: white;
    margin-top: 10px;
    display: block;
}

@keyframes level-up-burst {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
    50% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}

@keyframes bounce-in {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Badge Unlock Animation */
.badge-unlock-animation {
    position: fixed;
    top: 20%;
    right: 20px;
    background: linear-gradient(135deg, #667EEA, #764BA2);
    color: white;
    padding: 16px 24px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slide-in-badge 0.6s ease-out;
    z-index: 1000;
}

.badge-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 8px;
    animation: rotate-badge 1s ease-in-out;
}

.badge-text {
    font-weight: 700;
    font-size: 1.1rem;
}

@keyframes slide-in-badge {
    0% { transform: translateX(120%); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}

@keyframes rotate-badge {
    0% { transform: rotate(0deg); }
    50% { transform: rotate(360deg) scale(1.2); }
    100% { transform: rotate(360deg) scale(1); }
}

/* Pulse Glow for Buttons */
.pulse-glow {
    animation: pulse-glow-effect 2s ease-in-out infinite;
}

@keyframes pulse-glow-effect {
    0%, 100% { 
        box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
        transform: scale(1);
    }
    50% { 
        box-shadow: 0 8px 40px rgba(102, 126, 234, 0.6);
        transform: scale(1.05);
    }
}

/* Quest Screen Styles */
.quest-screen {
    position: relative;
    overflow: hidden;
}

.quest-screen::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.05) 0%, transparent 70%);
    animation: rotate-slow 30s linear infinite;
    pointer-events: none;
}

@keyframes rotate-slow {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.quest-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
}

.quest-icon {
    font-size: 2rem;
    animation: bounce 2s infinite;
}

/* Game Card Styles */
.game-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(248, 250, 252, 0.9));
    border: 3px solid transparent;
    background-clip: padding-box;
    position: relative;
}

.game-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 13px;
    padding: 3px;
    background: linear-gradient(135deg, #667EEA, #764BA2);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.game-card:hover::before {
    opacity: 1;
}

.level-indicator {
    position: absolute;
    top: 8px;
    right: 8px;
    background: linear-gradient(135deg, #4ade80, #22c55e);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
}

/* Game Button Styles */
.game-button {
    position: relative;
    overflow: visible;
    margin-top: 12px; /* Add space for XP badge */
}

.game-button .button-text {
    display: inline-block;
    position: relative;
    z-index: 1;
}

.game-button .xp-reward {
    position: absolute;
    top: -12px;
    right: 10px;
    background: #FFD700;
    color: #1a1a1a;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    animation: float-up 2s ease-in-out infinite;
    z-index: 10;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

@keyframes float-up {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

/* Loot Chest Animation */
.loot-chest-container {
    text-align: center;
    margin: 16px 32px;
    padding: 16px 0;
    width: auto;
}

.loot-chest {
    display: inline-block;
    position: relative;
    z-index: 10;
}

.chest-icon {
    font-size: 4rem;
    display: block;
    animation: bounce 2s infinite;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.chest-opening {
    animation: chest-open 1.5s ease-out;
}

@keyframes chest-open {
    0% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.3) rotate(10deg); }
    100% { transform: scale(1) rotate(0deg); }
}

.sparkles {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2rem;
    animation: sparkle-float 2s ease-out infinite;
}

@keyframes sparkle-float {
    0% { transform: translateX(-50%) translateY(0) scale(0); opacity: 1; }
    50% { transform: translateX(-50%) translateY(-20px) scale(1.2); opacity: 1; }
    100% { transform: translateX(-50%) translateY(-40px) scale(0); opacity: 0; }
}

/* Character Class Pricing Plans */
.recruit-class {
    border: 3px solid #4ade80;
    position: relative;
}

.warrior-class {
    border: 3px solid #3b82f6;
    position: relative;
}

.champion-class {
    border: 3px solid #FFD700;
    position: relative;
    animation: champion-glow 3s ease-in-out infinite;
}

@keyframes champion-glow {
    0%, 100% { box-shadow: 0 0 20px rgba(255, 215, 0, 0.3); }
    50% { box-shadow: 0 0 40px rgba(255, 215, 0, 0.6); }
}

.class-icon {
    font-size: 3rem;
    margin-bottom: 12px;
    display: block;
    animation: float-icon 3s ease-in-out infinite;
}

@keyframes float-icon {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Hybrid Progress System (Variant C) */
.hybrid-progress-container {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(5px);
    border-radius: 12px;
    padding: 16px;
    margin: 20px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.progress-achievements {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.achievement-count {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    font-size: 0.9rem;
}

.progress-percentage {
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    font-size: 0.9rem;
}

.enhanced-progress-bar {
    position: relative;
    height: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    overflow: hidden;
}

.gradient-fill {
    background: linear-gradient(90deg, #667EEA, #764BA2);
    transition: width 0.5s ease-in-out;
}

.progress-milestones {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.milestone {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.6);
    transition: all 0.3s ease;
}

.milestone.achieved {
    background: #FFD700;
    border-color: #FFD700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    animation: milestone-achieved 0.6s ease-out;
}

@keyframes milestone-achieved {
    0% { transform: translateY(-50%) scale(0.5); }
    50% { transform: translateY(-50%) scale(1.3); }
    100% { transform: translateY(-50%) scale(1); }
}

/* Confetti Animation */
@keyframes confetti-fall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

@keyframes confetti-burst {
    0% {
        transform: translateY(-100vh) rotate(0deg) scale(0);
        opacity: 0;
    }
    10% {
        transform: translateY(-80vh) rotate(90deg) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg) scale(0.8);
        opacity: 0;
    }
}

.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.confetti-piece {
    position: absolute;
    width: 12px;
    height: 12px;
    animation: confetti-burst 4s ease-out forwards;
    border-radius: 2px;
}

/* Celebration Text */
.celebration-text {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10000;
    animation: celebration-pop 0.6s ease-out;
    background: rgba(255, 255, 255, 0.8);
    padding: 40px 60px;
    border-radius: 30px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

@keyframes celebration-pop {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

.celebration-emoji {
    font-size: 5rem;
    animation: bounce 1s ease-in-out infinite;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
    margin-bottom: 10px;
}

.celebration-message {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, #667EEA, #764BA2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 16px 0;
    letter-spacing: 2px;
    animation: shimmer-text 2s ease-in-out infinite;
}

@keyframes shimmer-text {
    0%, 100% {
        filter: brightness(1);
    }
    50% {
        filter: brightness(1.2);
    }
}

.celebration-submessage {
    font-size: 1.3rem;
    color: rgba(51, 51, 51, 0.8);
    font-weight: 600;
    margin-top: 10px;
}