/* Animations CSS for Protein Goblin.com */

/* Keyframe Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

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

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(0, 255, 136, 0.2);
    }
    50% {
        box-shadow: 0 0 20px rgba(0, 255, 136, 0.6);
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.6s ease-out;
}

.fade-in-up {
    animation: fadeInUp 0.8s ease-out;
}

.fade-in-left {
    animation: fadeInLeft 0.8s ease-out;
}

.fade-in-right {
    animation: fadeInRight 0.8s ease-out;
}

.slide-in-up {
    animation: slideInUp 0.8s ease-out;
}

.slide-in-down {
    animation: slideInDown 0.8s ease-out;
}

.scale-in {
    animation: scaleIn 0.6s ease-out;
}

.bounce-in {
    animation: bounceIn 0.8s ease-out;
}

.pulse {
    animation: pulse 2s infinite;
}

.float {
    animation: float 3s ease-in-out infinite;
}

.rotate {
    animation: rotate 2s linear infinite;
}

/* Hover Animations */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 255, 136, 0.2);
}

.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

.hover-glow {
    transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.4);
}

.hover-rotate {
    transition: transform 0.3s ease;
}

.hover-rotate:hover {
    transform: rotate(5deg);
}

/* Loading Animations */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--accent-color);
    border-radius: 50%;
    animation: rotate 1s linear infinite;
}

.loading-dots {
    display: inline-block;
}

.loading-dots::after {
    content: '';
    animation: loadingDots 1.5s infinite;
}

@keyframes loadingDots {
    0%, 20% {
        content: '';
    }
    40% {
        content: '.';
    }
    60% {
        content: '..';
    }
    80%, 100% {
        content: '...';
    }
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, var(--accent-bg) 25%, var(--border-color) 50%, var(--accent-bg) 75%);
    background-size: 200px 100%;
    animation: shimmer 1.5s infinite;
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
    border-radius: 0.25rem;
}

.skeleton-text:last-child {
    width: 60%;
}

.skeleton-image {
    height: 200px;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

/* Staggered Animations */
.stagger-1 {
    animation-delay: 0.1s;
}

.stagger-2 {
    animation-delay: 0.2s;
}

.stagger-3 {
    animation-delay: 0.3s;
}

.stagger-4 {
    animation-delay: 0.4s;
}

.stagger-5 {
    animation-delay: 0.5s;
}

.stagger-6 {
    animation-delay: 0.6s;
}

/* Scroll Animations */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Button Animations */
.btn-animated {
    position: relative;
    overflow: hidden;
}

.btn-animated::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-animated:hover::before {
    left: 100%;
}

/* Card Animations */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 255, 136, 0.15);
}

/* Text Animations */
.text-glow {
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

.text-shimmer {
    background: linear-gradient(45deg, var(--accent-color), var(--accent-light), var(--accent-color));
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 2s ease-in-out infinite;
}

/* Particle Animations */
.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--accent-color);
    border-radius: 50%;
    animation: particleFloat 6s infinite linear;
}

@keyframes particleFloat {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

/* Mobile Menu Animations */
.mobile-menu-enter {
    animation: slideInDown 0.3s ease-out;
}

.mobile-menu-exit {
    animation: slideInUp 0.3s ease-out reverse;
}

/* Form Animations */
.form-group {
    transition: all 0.3s ease;
}

.form-group:focus-within {
    transform: scale(1.02);
}

.input-focus {
    animation: glow 2s infinite;
}

/* Recipe Card Animations */
.recipe-card {
    transition: all 0.3s ease;
}

.recipe-card:hover {
    transform: translateY(-8px) rotate(1deg);
    box-shadow: 0 15px 30px rgba(0, 255, 136, 0.2);
}

.recipe-card:hover .recipe-image {
    transform: scale(1.05);
}

.recipe-image {
    transition: transform 0.3s ease;
}

/* Navigation Animations */
.nav-link {
    position: relative;
    transition: all 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* Dropdown Animations */
.dropdown-menu {
    transform-origin: top;
    transition: all 0.3s ease;
}

.dropdown:hover .dropdown-menu {
    animation: slideInDown 0.3s ease-out;
}

/* Search Animations */
.search-container {
    transition: all 0.3s ease;
}

.search-container:focus-within {
    transform: scale(1.05);
}

/* Hero Animations */
.hero-title {
    animation: fadeInUp 1s ease-out;
}

.hero-description {
    animation: fadeInUp 1s ease-out 0.2s both;
}

.hero-stats {
    animation: fadeInUp 1s ease-out 0.4s both;
}

.hero-actions {
    animation: fadeInUp 1s ease-out 0.6s both;
}

.hero-image {
    animation: fadeInRight 1s ease-out 0.8s both;
}

/* Section Animations */
.section-title {
    animation: fadeInUp 0.8s ease-out;
}

.section-subtitle {
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

/* Grid Item Animations */
.recipe-card:nth-child(1) { animation: fadeInUp 0.6s ease-out 0.1s both; }
.recipe-card:nth-child(2) { animation: fadeInUp 0.6s ease-out 0.2s both; }
.recipe-card:nth-child(3) { animation: fadeInUp 0.6s ease-out 0.3s both; }
.recipe-card:nth-child(4) { animation: fadeInUp 0.6s ease-out 0.4s both; }
.recipe-card:nth-child(5) { animation: fadeInUp 0.6s ease-out 0.5s both; }
.recipe-card:nth-child(6) { animation: fadeInUp 0.6s ease-out 0.6s both; }

/* Button Hover Effects */
.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--border-color);
    border-top: 2px solid var(--accent-color);
    border-radius: 50%;
    animation: rotate 1s linear infinite;
}

/* Success/Error Animations */
.alert-success {
    animation: slideInRight 0.5s ease-out;
}

.alert-error {
    animation: shake 0.5s ease-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Responsive Animations */
@media (max-width: 768px) {
    .hero-image {
        animation: fadeInUp 1s ease-out 0.8s both;
    }
    
    .recipe-card {
        animation: fadeInUp 0.6s ease-out;
    }
    
    .recipe-card:nth-child(n) {
        animation-delay: 0s;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
