/* KindTaken - Confetti & Celebration Animations */

/* Confetti canvas */
.confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 3000;
}

/* Star burst effect on task complete */
.star-burst {
    position: absolute;
    pointer-events: none;
    z-index: 500;
}

.star-burst-particle {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    -webkit-animation: starBurst 0.6s ease-out forwards;
    animation: starBurst 0.6s ease-out forwards;
}

.star-burst-particle:nth-child(1) { background: #ff6b6b; }
.star-burst-particle:nth-child(2) { background: #ffd93d; }
.star-burst-particle:nth-child(3) { background: #6bcb77; }
.star-burst-particle:nth-child(4) { background: #4d96ff; }
.star-burst-particle:nth-child(5) { background: #e040fb; }
.star-burst-particle:nth-child(6) { background: #ff9800; }

.star-burst-particle:nth-child(1) { --angle: 0deg; }
.star-burst-particle:nth-child(2) { --angle: 60deg; }
.star-burst-particle:nth-child(3) { --angle: 120deg; }
.star-burst-particle:nth-child(4) { --angle: 180deg; }
.star-burst-particle:nth-child(5) { --angle: 240deg; }
.star-burst-particle:nth-child(6) { --angle: 300deg; }

/* Task complete shine */
.task-complete-shine {
    position: relative;
    overflow: hidden;
}

.task-complete-shine::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.4) 50%,
        transparent 70%
    );
    -webkit-animation: shine 0.6s ease forwards;
    animation: shine 0.6s ease forwards;
}

/* Plus one float */
.plus-text {
    position: absolute;
    font-size: 24px;
    font-weight: 700;
    color: #7c4dff;
    pointer-events: none;
    -webkit-animation: plusFloat 1s ease-out forwards;
    animation: plusFloat 1s ease-out forwards;
    z-index: 600;
}

/* Screen transition */
.screen-enter {
    -webkit-animation: slideInRight 0.3s ease forwards;
    animation: slideInRight 0.3s ease forwards;
}

.screen-exit {
    -webkit-animation: slideOutLeft 0.3s ease forwards;
    animation: slideOutLeft 0.3s ease forwards;
}

/* Keyframes */
@-webkit-keyframes starBurst {
    0% {
        -webkit-transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    100% {
        -webkit-transform: translate(
            calc(cos(var(--angle, 0deg)) * 40px),
            calc(sin(var(--angle, 0deg)) * 40px)
        ) scale(0);
        opacity: 0;
    }
}
@keyframes starBurst {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(
            calc(cos(var(--angle, 0deg)) * 40px),
            calc(sin(var(--angle, 0deg)) * 40px)
        ) scale(0);
        opacity: 0;
    }
}

@-webkit-keyframes shine {
    from { -webkit-transform: translateX(-100%) rotate(45deg); }
    to { -webkit-transform: translateX(100%) rotate(45deg); }
}
@keyframes shine {
    from { transform: translateX(-100%) rotate(45deg); }
    to { transform: translateX(100%) rotate(45deg); }
}

@-webkit-keyframes plusFloat {
    0% {
        -webkit-transform: translateY(0) scale(1);
        opacity: 1;
    }
    100% {
        -webkit-transform: translateY(-40px) scale(1.5);
        opacity: 0;
    }
}
@keyframes plusFloat {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateY(-40px) scale(1.5);
        opacity: 0;
    }
}

@-webkit-keyframes slideInRight {
    from {
        -webkit-transform: translateX(30px);
        opacity: 0;
    }
    to {
        -webkit-transform: translateX(0);
        opacity: 1;
    }
}
@keyframes slideInRight {
    from {
        transform: translateX(30px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@-webkit-keyframes slideOutLeft {
    from {
        -webkit-transform: translateX(0);
        opacity: 1;
    }
    to {
        -webkit-transform: translateX(-30px);
        opacity: 0;
    }
}
@keyframes slideOutLeft {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(-30px);
        opacity: 0;
    }
}

@-webkit-keyframes wobble {
    0%, 100% { -webkit-transform: rotate(0deg); }
    25% { -webkit-transform: rotate(-5deg); }
    75% { -webkit-transform: rotate(5deg); }
}
@keyframes wobble {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-5deg); }
    75% { transform: rotate(5deg); }
}
