/**
 * InnoSource Technology - Animation Styles
 * Scroll animations, transitions, and effects
 */

/* ============================================
   SCROLL ANIMATIONS
   ============================================ */

.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

/* Faster animation for text elements */
.hero h1.animate-on-scroll,
.hero p.animate-on-scroll {
    transition-duration: 1s;
}

.hero h1.animate-on-scroll {
    transform: translateY(40px);
}

/* ============================================
   CARD HOVER EFFECTS
   ============================================ */

.card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    will-change: transform;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 213, 111, 0.15);
}

/* Prevent animation on first load */
.card.animate-on-scroll:not(.animated):hover {
    transform: translateY(30px); /* Keep original position until animated */
}

/* ============================================
   BUTTON ANIMATIONS
   ============================================ */

.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn:active {
    transform: scale(0.96);
}

/* ============================================
   HERO SECTION PARALLAX
   ============================================ */

.hero {
    transition: transform 0.1s ease-out, opacity 0.3s ease-out;
    will-change: transform, opacity;
}

/* ============================================
   LINK HOVER EFFECTS
   ============================================ */

.link-arrow {
    position: relative;
    transition: color 0.3s ease;
}

.link-arrow::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-accent);
    transition: width 0.3s ease;
}

.link-arrow:hover::after {
    width: 100%;
}

.link-arrow:hover {
    color: var(--color-accent);
}

/* Arrow animation */
.link-arrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.link-arrow:hover {
    gap: 12px;
}

/* ============================================
   GRID STAGGER ANIMATION
   ============================================ */

.grid > * {
    animation-fill-mode: both;
}

/* ============================================
   FADE IN KEYFRAMES
   ============================================ */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ============================================
   PULSE ANIMATION FOR CTA BUTTONS
   ============================================ */

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 213, 111, 0.7);
    }
    70% {
        box-shadow: 0 0 0 20px rgba(0, 213, 111, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 213, 111, 0);
    }
}

.hero-cta .btn-large {
    animation: pulse 2s infinite;
}

.hero-cta .btn-large:hover {
    animation: none;
}

/* ============================================
   NUMBER COUNTER ANIMATION
   ============================================ */

.stat-number {
    font-variant-numeric: tabular-nums;
    transition: all 0.05s ease;
}

/* ============================================
   LOADING ANIMATION
   ============================================ */

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.loading-shimmer {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* ============================================
   SMOOTH SCROLLING
   ============================================ */

html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .animate-on-scroll {
        opacity: 1;
        transform: none;
    }
}

/* ============================================
   HOVER EFFECTS ON IMAGES
   ============================================ */

img {
    transition: transform 0.3s ease, filter 0.3s ease;
}

.card:hover img {
    transform: scale(1.05);
}

/* ============================================
   FORM FIELD ANIMATIONS
   ============================================ */

.form-group input,
.form-group textarea,
.form-group select {
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(0, 213, 111, 0.1);
}

/* ============================================
   SECTION TRANSITION
   ============================================ */

section {
    opacity: 1;
    transition: opacity 0.5s ease;
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

@media (max-width: 768px) {
    /* Reduce animation intensity on mobile for better performance */
    .animate-on-scroll {
        transform: translateY(20px);
    }

    .card:hover {
        transform: translateY(-4px);
    }

    /* Disable parallax on mobile */
    .hero {
        transform: none !important;
        opacity: 1 !important;
    }
}

/* ============================================
   ACCESSIBILITY - PREFERS REDUCED MOTION
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    .animate-on-scroll,
    .card,
    .btn,
    img,
    .hero {
        transition: none !important;
        animation: none !important;
        transform: none !important;
    }

    .hero-cta .btn-large {
        animation: none !important;
    }
}
