/* Avatar-inspired cosmic animations */
@keyframes float-cabbage {
    0%, 100% { 
        transform: translateY(0px) rotate(0deg); 
        opacity: 0.6; 
    }
    25% { 
        transform: translateY(-30px) rotate(90deg); 
        opacity: 1; 
    }
    50% { 
        transform: translateY(-60px) rotate(180deg); 
        opacity: 0.8; 
    }
    75% { 
        transform: translateY(-30px) rotate(270deg); 
        opacity: 1; 
    }
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
}

@keyframes cart-drift {
    0% { transform: translateX(100vw) translateY(0px); }
    25% { transform: translateX(75vw) translateY(-20px); }
    50% { transform: translateX(25vw) translateY(-10px); }
    75% { transform: translateX(-25vw) translateY(-30px); }
    100% { transform: translateX(-150vw) translateY(-50px); }
}

@keyframes spirit-glow {
    0%, 100% { 
        box-shadow: 0 0 10px rgba(100, 255, 218, 0.4),
                    0 0 20px rgba(100, 255, 218, 0.2),
                    0 0 30px rgba(100, 255, 218, 0.1); 
    }
    50% { 
        box-shadow: 0 0 20px rgba(100, 255, 218, 0.8),
                    0 0 40px rgba(100, 255, 218, 0.4),
                    0 0 60px rgba(100, 255, 218, 0.2); 
    }
}

@keyframes avatar-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.animate-float-cabbage {
    animation: float-cabbage 12s ease-in-out infinite;
}

.animate-twinkle {
    animation: twinkle 4s ease-in-out infinite;
}

.animate-cart-drift {
    animation: cart-drift 15s linear infinite;
}

.avatar-glow {
    animation: spirit-glow 3s ease-in-out infinite;
}

.avatar-glow:hover {
    animation: avatar-pulse 0.5s ease-in-out;
    box-shadow: 0 0 30px rgba(106, 176, 76, 0.6),
                0 0 50px rgba(106, 176, 76, 0.3);
}

/* Custom Avatar-inspired slider */
.avatar-slider {
    -webkit-appearance: none;
    appearance: none;
    height: 8px;
    background: linear-gradient(to right, #2d3d2a, #4a90e2, #6ab04c);
    outline: none;
    border-radius: 4px;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.avatar-slider:hover {
    opacity: 1;
}

.avatar-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    background: radial-gradient(circle, #64ffda, #4a90e2);
    cursor: pointer;
    border-radius: 50%;
    box-shadow: 0 0 15px rgba(100, 255, 218, 0.6);
    border: 2px solid #fff;
}

.avatar-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background: radial-gradient(circle, #64ffda, #4a90e2);
    cursor: pointer;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 15px rgba(100, 255, 218, 0.6);
}

/* Custom scrollbar for Avatar theme */
.custom-scrollbar::-webkit-scrollbar {
    width: 10px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: rgba(45, 61, 42, 0.3);
    border-radius: 5px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #64ffda, #6ab04c);
    border-radius: 5px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, #39ff14, #64ffda);
    box-shadow: 0 0 10px rgba(100, 255, 218, 0.4);
}

/* Enhanced form elements with Avatar styling */
input:focus, select:focus, textarea:focus {
    box-shadow: 0 0 0 3px rgba(100, 255, 218, 0.3),
                inset 0 0 20px rgba(100, 255, 218, 0.1);
    transform: translateY(-1px);
}

/* Button hover effects with bending-inspired animations */
button:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

button:not(:disabled):active {
    transform: translateY(0px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* Mystical loading animations */
@keyframes mystic-spin {
    from { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.1); }
    to { transform: rotate(360deg) scale(1); }
}

.animate-mystic-spin {
    animation: mystic-spin 2s ease-in-out infinite;
}

/* Card hover effects with spirit world vibes */
.hover-spirit:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 40px rgba(156, 136, 255, 0.2);
    border-color: rgba(100, 255, 218, 0.6);
}

/* Gradient text animations */
.gradient-text-flow {
    background: linear-gradient(45deg, #64ffda, #6ab04c, #9c88ff, #4a90e2);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradient-flow 4s ease-in-out infinite;
}

@keyframes gradient-flow {
    0%, 100% { background-position: 0% 50%; }
    33% { background-position: 50% 0%; }
    66% { background-position: 100% 50%; }
}

/* Responsive design improvements */
@media (max-width: 1024px) {
    .font-avatar {
        font-size: 0.85em;
    }
    
    .animate-cart-drift {
        display: none; /* Hide on smaller screens for performance */
    }
}

@media (max-width: 768px) {
    .font-earth {
        font-size: 0.9em;
    }
    
    .animate-float-cabbage {
        animation-duration: 8s; /* Faster on mobile */
    }
    
    /* Reduce particle count on mobile */
    .animate-float-cabbage:nth-child(n+8) {
        display: none;
    }
    
    .animate-twinkle:nth-child(n+15) {
        display: none;
    }
}

/* Special effects for tab transitions */
.tab-transition {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Cabbage counter pulse effect */
@keyframes cabbage-pulse {
    0%, 100% { color: #6ab04c; }
    50% { color: #39ff14; transform: scale(1.1); }
}

.cabbage-counter {
    animation: cabbage-pulse 2s ease-in-out infinite;
}

/* Border animations for panels */
@keyframes border-flow {
    0%, 100% { 
        border-image: linear-gradient(45deg, #2d3d2a, #4a90e2) 1;
    }
    50% { 
        border-image: linear-gradient(45deg, #4a90e2, #6ab04c, #9c88ff) 1;
    }
}

.mystical-border {
    animation: border-flow 6s ease-in-out infinite;
}