/*
 * Arabic Reading Accelerator - Gamification Styles
 */

/* Badge Animations */
@keyframes badgeUnlock {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.3) rotate(10deg);
    }
    75% {
        transform: scale(0.9) rotate(-5deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.badge-unlock-animation {
    animation: badgeUnlock 0.6s ease-out;
}

/* Points Animation */
@keyframes pointsFloat {
    0% {
        transform: translateY(0);
        opacity: 1;
    }
    100% {
        transform: translateY(-50px);
        opacity: 0;
    }
}

.points-float {
    position: absolute;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--perfect-color);
    animation: pointsFloat 1s ease-out forwards;
    pointer-events: none;
}

.points-bonus {
    color: #FFD700;
    font-size: 1.75rem;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* Streak Fire Animation */
@keyframes fireGlow {
    0%, 100% {
        text-shadow: 0 0 5px #ff6b35, 0 0 10px #ff6b35;
    }
    50% {
        text-shadow: 0 0 10px #ff6b35, 0 0 20px #ff6b35, 0 0 30px #ff6b35;
    }
}

.streak-fire {
    animation: fireGlow 1.5s ease-in-out infinite;
}

/* Level Up Animation */
@keyframes levelUp {
    0% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.2);
    }
    50% {
        transform: scale(1.1);
    }
    75% {
        transform: scale(1.15);
    }
    100% {
        transform: scale(1);
    }
}

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

/* Confetti Effect Container */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--primary-color);
    animation: confettiFall 3s ease-in-out forwards;
}

@keyframes confettiFall {
    0% {
        transform: translateY(-100%) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Star Rating Styles */
.star-rating {
    display: flex;
    gap: 0.25rem;
}

.star {
    font-size: 1.5rem;
    color: var(--text-light);
    transition: color 0.2s;
}

.star.filled {
    color: var(--perfect-color);
}

/* Progress Ring */
.progress-ring {
    position: relative;
    width: 100px;
    height: 100px;
}

.progress-ring-circle {
    fill: none;
    stroke-width: 8;
    stroke-linecap: round;
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
}

.progress-ring-bg {
    stroke: var(--bg-light);
}

.progress-ring-fill {
    stroke: var(--primary-color);
    stroke-dasharray: 283;
    stroke-dashoffset: 283;
    transition: stroke-dashoffset 0.5s ease;
}

.progress-ring-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.5rem;
    font-weight: 800;
}

/* Achievement Toast */
.achievement-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 1rem 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 1000;
    animation: toastSlideUp 0.5s ease-out;
}

@keyframes toastSlideUp {
    from {
        transform: translateX(-50%) translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

.achievement-toast .toast-icon {
    font-size: 2.5rem;
}

.achievement-toast .toast-content {
    text-align: right;
}

.achievement-toast .toast-title {
    font-weight: 700;
    color: var(--text-primary);
}

.achievement-toast .toast-message {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Leaderboard Styles */
.leaderboard {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.leaderboard-header {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    padding: 1rem;
    text-align: center;
    color: #333;
}

.leaderboard-list {
    list-style: none;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--bg-light);
    gap: 1rem;
}

.leaderboard-item:last-child {
    border-bottom: none;
}

.leaderboard-rank {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 800;
}

.leaderboard-rank.gold {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #333;
}

.leaderboard-rank.silver {
    background: linear-gradient(135deg, #C0C0C0, #A0A0A0);
    color: #333;
}

.leaderboard-rank.bronze {
    background: linear-gradient(135deg, #CD7F32, #8B4513);
    color: white;
}

.leaderboard-user {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.leaderboard-score {
    font-weight: 700;
    color: var(--accent-purple);
}

/* Minecraft/Roblox Style Elements */
.blocky-btn {
    background: linear-gradient(180deg, #7BC96F 0%, #5A8B4C 100%);
    border: 4px solid #3D5C30;
    border-radius: 4px;
    color: white;
    font-weight: 800;
    text-transform: uppercase;
    padding: 0.75rem 1.5rem;
    box-shadow: 
        0 4px 0 #3D5C30,
        0 6px 6px rgba(0, 0, 0, 0.3);
    transition: all 0.1s;
}

.blocky-btn:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 6px 0 #3D5C30,
        0 8px 8px rgba(0, 0, 0, 0.3);
}

.blocky-btn:active {
    transform: translateY(2px);
    box-shadow: 
        0 2px 0 #3D5C30,
        0 4px 4px rgba(0, 0, 0, 0.3);
}

/* Pixel Art Border */
.pixel-border {
    border: 4px solid transparent;
    border-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='6' height='6'%3E%3Crect width='2' height='2' fill='%23333'/%3E%3Crect x='4' y='4' width='2' height='2' fill='%23333'/%3E%3C/svg%3E") 2;
}
