/* Animations */

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(10deg); }
}

@keyframes scrollLine {
    0%, 100% { height: 40px; opacity: 1; }
    50% { height: 60px; opacity: 0.5; }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 5px var(--lavender); }
    50% { box-shadow: 0 0 20px var(--lavender); }
}

/* Page load animations */
.hero-content {
    animation: fadeIn 1s ease-out;
}

.craft-card, .collection-card, .project-item {
    animation: fadeIn 0.6s ease-out;
}

.craft-card:nth-child(1) { animation-delay: 0.1s; }
.craft-card:nth-child(2) { animation-delay: 0.2s; }
.craft-card:nth-child(3) { animation-delay: 0.3s; }
.craft-card:nth-child(4) { animation-delay: 0.4s; }

/* Hover animations */
.btn-primary:hover, .btn-secondary:hover {
    animation: pulse 0.3s ease;
}

.craft-card:hover .craft-icon-container {
    animation: pulse 0.5s ease;
}

/* Interactive elements */
.color-option:hover .color-sample {
    animation: pulse 0.3s ease;
}

.element-option:hover i {
    animation: pulse 0.5s ease;
}

/* Loading animation */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--light-lavender);
    border-top: 3px solid var(--lavender);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Progress bar animation */
.progress-bar {
    height: 4px;
    background: linear-gradient(to right, var(--lavender), var(--soft-purple));
    width: 0%;
    animation: progress 2s ease-in-out infinite;
}

@keyframes progress {
    0% { width: 0%; }
    50% { width: 100%; }
    100% { width: 0%; }
}

/* Shimmer effect for cards */
.shimmer {
    position: relative;
    overflow: hidden;
}

.shimmer::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    100% { left: 100%; }
}

/* Staggered animation for lists */
.stagger-item {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeIn 0.5s ease forwards;
}

.stagger-item:nth-child(1) { animation-delay: 0.1s; }
.stagger-item:nth-child(2) { animation-delay: 0.2s; }
.stagger-item:nth-child(3) { animation-delay: 0.3s; }
.stagger-item:nth-child(4) { animation-delay: 0.4s; }
.stagger-item:nth-child(5) { animation-delay: 0.5s; }

/* Bounce animation for call-to-action */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

.bounce {
    animation: bounce 2s infinite;
}

/* Text reveal animation */
.reveal-text {
    position: relative;
    overflow: hidden;
}

.reveal-text::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--deep-plum);
    animation: textReveal 1.5s ease forwards;
}

@keyframes textReveal {
    0% { left: 0; }
    100% { left: 100%; }
}

/* Gradient background animation */
.animated-gradient {
    background: linear-gradient(-45deg, #B497D6, #7B5BA1, #5A3D7A, #9D7BC7);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Confetti animation */
.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--lavender);
    opacity: 0;
}

@keyframes confettiFall {
    0% {
        opacity: 1;
        transform: translateY(-100px) rotate(0deg);
    }
    100% {
        opacity: 0;
        transform: translateY(100vh) rotate(720deg);
    }
}