/* 
 * CSS animations for domain.com
 * Contains all animation effects used throughout the site
 */

/* ------------------------------
   Fade in animations
------------------------------ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.8s ease-out forwards;
}

.delay-100 {
    animation-delay: 0.1s;
}

.delay-200 {
    animation-delay: 0.2s;
}

.delay-300 {
    animation-delay: 0.3s;
}

.delay-400 {
    animation-delay: 0.4s;
}

.delay-500 {
    animation-delay: 0.5s;
}

/* ------------------------------
   Service card animations
------------------------------ */
.service-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* ------------------------------
   Highlight animation
------------------------------ */
@keyframes highlightPulse {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.highlight {
    background: linear-gradient(90deg, transparent 0%, var(--sunlit-coral) 50%, transparent 100%);
    background-size: 200% 100%;
    animation: highlightPulse 4s ease-in-out infinite;
    padding: 0 0.5rem;
    border-radius: 3px;
}

/* ------------------------------
   Button hover effects
------------------------------ */
.btn {
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.1);
    transition: width 0.3s ease;
    z-index: -1;
}

.btn:hover::before {
    width: 100%;
}

/* ------------------------------
   Form input animations
------------------------------ */
.floating-label input,
.floating-label select {
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.floating-label input:focus,
.floating-label select:focus {
    border-color: var(--arctic-mint);
    box-shadow: 0 0 0 3px rgba(168, 230, 207, 0.3);
}

/* Animated border bottom */
.input-animated {
    position: relative;
}

.input-animated::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background-color: var(--arctic-mint);
    transition: width 0.3s ease, left 0.3s ease;
}

.input-animated:focus-within::after {
    width: 100%;
    left: 0;
}

/* ------------------------------
   Testimonial cards animation
------------------------------ */
@keyframes cardPulse {
    0% {
        transform: translateY(0);
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    }
    50% {
        transform: translateY(-5px);
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    }
    100% {
        transform: translateY(0);
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    }
}

.testimonial {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.testimonial:hover {
    animation: cardPulse 2s ease-in-out infinite;
}

/* ------------------------------
   Benefits list animations
------------------------------ */
.benefits-list li {
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.benefits-list.animate li:nth-child(1) {
    transition-delay: 0.1s;
}

.benefits-list.animate li:nth-child(2) {
    transition-delay: 0.2s;
}

.benefits-list.animate li:nth-child(3) {
    transition-delay: 0.3s;
}

.benefits-list.animate li:nth-child(4) {
    transition-delay: 0.4s;
}

.benefits-list.animate li:nth-child(5) {
    transition-delay: 0.5s;
}

.benefits-list.animate li {
    opacity: 1;
    transform: translateX(0);
}

/* Add animation class when element is in viewport */
.in-viewport {
    animation: fadeIn 0.8s ease-out forwards;
}

/* ------------------------------
   Scroll animations 
   (Applied via JavaScript intersection observer)
------------------------------ */
.slide-up {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.slide-up.in-viewport {
    opacity: 1;
    transform: translateY(0);
}

.slide-right {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.slide-right.in-viewport {
    opacity: 1;
    transform: translateX(0);
}

.slide-left {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.slide-left.in-viewport {
    opacity: 1;
    transform: translateX(0);
}

/* Staggered animations for grid items */
.stagger-animation > * {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.stagger-animation > *:nth-child(1) {
    transition-delay: 0.1s;
}

.stagger-animation > *:nth-child(2) {
    transition-delay: 0.2s;
}

.stagger-animation > *:nth-child(3) {
    transition-delay: 0.3s;
}

.stagger-animation > *:nth-child(4) {
    transition-delay: 0.4s;
}

.stagger-animation.in-viewport > * {
    opacity: 1;
    transform: translateY(0);
}

/* ------------------------------
   Logo animation
------------------------------ */
@keyframes logoZoom {
    0% {
        transform: scale(0.9);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.logo a {
    display: inline-block;
    animation: logoZoom 1s ease-out;
}

/* ------------------------------
   CTA section text animation
------------------------------ */
@keyframes textFadeIn {
    0% {
        opacity: 0;
        letter-spacing: 10px;
    }
    100% {
        opacity: 1;
        letter-spacing: normal;
    }
}

.cta h2 {
    animation: textFadeIn 1.5s ease-out;
}

/* Animate CTA button */
@keyframes pulseButton {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7);
    }
    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 15px rgba(255, 255, 255, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
    }
}

.cta .btn {
    animation: pulseButton 2s infinite;
}
