/* Animation styles for M3D-Print website */

/* Base animation properties */
.animate-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

.animate-in.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* Hero section animations */
.hero {
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(1, 175, 254, 0);
    transition: background 1s ease;
    z-index: 1;
}

.hero.animate-bg::before {
    background: rgba(1, 175, 254, 0.15);
}

.hero-text-wrapper {
    position: relative;
    z-index: 2;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1s ease, transform 1s ease;
}

.hero-text-wrapper.animate-in {
    opacity: 1;
    transform: translateY(0);
}

.hero h1 {
    transition: transform 0.5s ease 0.2s;
}

.hero p {
    transition: transform 0.5s ease 0.4s;
}

.hero button {
    transition: all 0.3s ease;
}

.hero button:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

/* Service cards animations */
.service {
    transition: transform 0.5s ease, box-shadow 0.5s ease, opacity 0.7s ease;
    opacity: 0;
    transform: translateY(30px);
}

.service.animate-in {
    opacity: 1;
    transform: translateY(0);
}

.service:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

/* Steps animation */
.step {
    transition: transform 0.6s ease, opacity 0.6s ease;
    opacity: 0;
    transform: translateY(20px);
}

.step.animate-in {
    opacity: 1;
    transform: translateY(0);
}

.step:hover img {
    transform: scale(1.05);
}

.step img {
    transition: transform 0.4s ease;
}

/* Form elements animations */
input, textarea, select, button {
    transition: box-shadow 0.3s ease, transform 0.3s ease, border-color 0.3s ease;
}

input:focus, textarea:focus, select:focus {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(1, 175, 254, 0.2);
}

/* Enhanced Button Animations */
button {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    z-index: 1;
}

button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
    z-index: -1;
}

button::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.7s ease;
    z-index: -1;
}

button:hover {
    transform: translateY(-3px);
    box-shadow: 0 7px 14px rgba(0, 0, 0, 0.1);
}

button:hover::before {
    left: 100%;
}

button:active::after {
    animation: ripple 0.6s ease-out;
}

.animated-button {
    position: relative;
    overflow: hidden;
}

.animated-button .button-text {
    transition: opacity 0.3s ease;
}

/* About and contact animations */
#about h2, #about p, #contact h2, #contact form, #contact .order-form-container {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

#about h2.animate-in, #about p.animate-in, #contact h2.animate-in, #contact form.animate-in, #contact .order-form-container.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* Navigation menu item animations */
.nav-links li {
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.nav-links li.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* Pulse animation for feedback */
.animate-pulse {
    animation: pulse 1s ease;
}

/* Ripple effect for buttons */
@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    20% {
        transform: scale(25, 25);
        opacity: 0.5;
    }
    100% {
        opacity: 0;
        transform: scale(40, 40);
    }
}

/* Pulse animation */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Loading animation */
.loading-spinner {
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Slide-in animation from right */
.slide-in-right {
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.slide-in-right.animate-in {
    opacity: 1;
    transform: translateX(0);
}

/* Fade in animation for images */
img.fade-in {
    opacity: 0;
    transition: opacity 1s ease;
}

img.fade-in.animate-in {
    opacity: 1;
}
