/* Animation Classes */

/* Fade in animation */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 1s ease forwards;
}

/* Fade out animation */
@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

.fade-out {
    animation: fadeOut 1s ease forwards;
}

/* Slide out animation for intro screen */
@keyframes slideOutUp {
    from { transform: translateY(0); }
    to { transform: translateY(-100%); }
}

.slide-out-up {
    animation: slideOutUp 1s ease-in-out forwards;
}

/* Sparkle animation for correct placement */
@keyframes sparkle {
    0% {
        box-shadow: 0 0 0px rgba(255, 215, 0, 0);
        transform: scale(1);
    }
    25% {
        box-shadow: 0 0 40px rgba(255, 215, 0, 0.9);
        transform: scale(1.15);
    }
    50% {
        box-shadow: 0 0 25px rgba(76, 175, 80, 0.8);
        transform: scale(1.1);
    }
    75% {
        box-shadow: 0 0 40px rgba(255, 215, 0, 0.9);
        transform: scale(1.15);
    }
    100% {
        box-shadow: 0 0 0px rgba(255, 215, 0, 0);
        transform: scale(1);
    }
}

.sparkle {
    animation: sparkle 2s ease-in-out;
    z-index: 50;
}

/* Shake animation for incorrect placement */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-8px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(8px);
    }
}

.shake {
    animation: shake 0.8s ease-in-out;
    box-shadow: 0 0 15px rgba(255, 50, 50, 0.5);
}

/* Gentle shake animation - more appropriate for autistic learners */
@keyframes gentle-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    50% { transform: translateX(4px); }
    75% { transform: translateX(-2px); }
}

.plant.gentle-shake {
    animation: gentle-shake 1.2s ease-in-out;
    box-shadow: 0 0 8px rgba(255, 160, 160, 0.4);
}

/* Highlight effect for incorrect placement */
.plant.highlight-incorrect {
    box-shadow: 0 0 15px rgba(255, 160, 160, 0.5);
    transition: all 0.8s ease;
}

/* Supportive visual feedback animation */
@keyframes supportive-pulse {
    0% { box-shadow: 0 0 5px rgba(255, 193, 7, 0.3); }
    50% { box-shadow: 0 0 12px rgba(255, 193, 7, 0.6); }
    100% { box-shadow: 0 0 5px rgba(255, 193, 7, 0.3); }
}

.supportive-hint {
    animation: supportive-pulse 2s infinite ease-in-out;
}

/* Pop in animation for feedback message */
@keyframes popIn {
    0% {
        transform: translate(-50%, -50%) scale(0.7);
        opacity: 0;
    }
    70% {
        transform: translate(-50%, -50%) scale(1.05);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

.pop-in {
    animation: popIn 0.8s ease-out forwards;
}

/* Pop out animation for feedback message */
@keyframes popOut {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0;
    }
}

.pop-out {
    animation: popOut 0.5s ease-in forwards;
}

/* Bounce animation for celebration */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0) scale(0.7);
    }
    40% {
        transform: translateY(-15px) scale(0.75);
    }
    60% {
        transform: translateY(-10px) scale(0.73);
    }
}

.plant.bounce {
    animation: bounce 1s ease-in-out;
}

/* Breathing animation for drop zones */
@keyframes breathe {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.03);
    }
}

.drop-zone {
    animation: breathe 3s infinite ease-in-out;
}

/* Pulse animation for drop zone highlighting */
@keyframes pulse-highlight {
    0% {
        box-shadow: 0 0 20px rgba(76, 175, 80, 0.4);
    }
    100% {
        box-shadow: 0 0 30px rgba(76, 175, 80, 0.8);
    }
}

/* Animation for drag and drop transition */
.smooth-transition {
    transition: all 0.8s ease;
}

/* Slow return animation for educational feedback */
.slow-return {
    transition: all 2s ease-in-out;
    animation: attention-pulse 2s ease-in-out;
}

/* Animation for success icon appearance */
@keyframes popInSuccess {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    70% {
        transform: scale(1.2);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.success-icon {
    animation: popInSuccess 0.5s ease-out forwards;
}

/* Attention pulse animation for wrong placement */
@keyframes attention-pulse {
    0% {
        box-shadow: 0 0 0 rgba(255, 0, 0, 0);
    }
    50% {
        box-shadow: 0 0 20px rgba(255, 0, 0, 0.5);
    }
    100% {
        box-shadow: 0 0 0 rgba(255, 0, 0, 0);
    }
}

/* Pulse animation for success icon - helpful for autistic learners */
@keyframes pulse-success {
    0% {
        transform: scale(1);
        box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
    }
}

/* Gently animate plants as they're placed in the correct zone */
@keyframes settle-in-zone {
    0% {
        transform: scale(1) translateY(0);
    }
    40% {
        transform: scale(0.75) translateY(-5px);
    }
    70% {
        transform: scale(0.68) translateY(3px);
    }
    100% {
        transform: scale(0.7) translateY(0);
    }
}

.plant.placed-in-zone {
    animation: placed-success 1.5s ease-out forwards;
}

/* Celebration animations */
@keyframes celebrate {
    0% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.3);
    }
    50% {
        box-shadow: 0 0 20px 10px rgba(76, 175, 80, 0.5);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.3);
    }
}

.drop-zone.celebrate {
    animation: celebrate 2s ease-in-out infinite;
}

@keyframes completion-message-appear {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    60% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.completion-message {
    font-size: 1.8rem;
    font-weight: bold;
    text-align: center;
    color: #2E7D32;
    background-color: rgba(220, 255, 220, 0.95);
    padding: 15px 30px;
    border-radius: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    animation: completion-message-appear 1s ease-out forwards;
}

/* Gentle pulsing animation for plant labels to draw attention */
@keyframes label-pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }
    50% {
        transform: scale(1.03);
        box-shadow: 0 3px 7px rgba(0, 0, 0, 0.15);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }
}

/* Apply animation to plant labels on hover */
.plant:hover .plant-label {
    animation: label-pulse 1.5s infinite ease-in-out;
}

@keyframes placed-success {
    0% { 
        box-shadow: 0 0 0 rgba(76, 175, 80, 0); 
        border-color: #4CAF50;
    }
    50% { 
        box-shadow: 0 0 30px rgba(76, 175, 80, 0.8); 
        border-color: #2E7D32; 
    }
    100% { 
        box-shadow: 0 0 5px rgba(76, 175, 80, 0.5); 
        border-color: #4CAF50; 
    }
}

/* Apply this animation when a plant is correctly placed but should stay in position */
.plant.placed-in-zone {
    animation: placed-success 1.5s ease-out forwards;
}
