/* ===================================
   ANIMATIONS CSS - HI GROUP
   =================================== */

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

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

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

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

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

/* Pulse Animation */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

/* Glow Animation */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(37, 99, 235, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(37, 99, 235, 0.6);
    }
}

/* Float Animation */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Rotate Animation */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Gradient Animation */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Slide Animations */
@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateY(-100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInFromBottom {
    from {
        opacity: 0;
        transform: translateY(100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Bounce Animation */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* Apply Animations to Elements */
.animate-on-scroll {
    opacity: 0;
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.animated {
    opacity: 1;
}

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

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

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

.service-icons {
    animation: fadeInUp 1s ease-out 0.6s both;
}

.service-icon:nth-child(1) {
    animation: fadeIn 0.8s ease-out 0.8s both;
}

.service-icon:nth-child(2) {
    animation: fadeIn 0.8s ease-out 1s both;
}

.service-icon:nth-child(3) {
    animation: fadeIn 0.8s ease-out 1.2s both;
}

.service-icon:nth-child(4) {
    animation: fadeIn 0.8s ease-out 1.4s both;
}

/* Icon Hover Animations */
.icon-circle {
    animation: pulse 3s ease-in-out infinite;
}

.icon-circle:hover {
    animation: none;
}

/* Card Hover Effects */
.service-card,
.product-card {
    position: relative;
    overflow: hidden;
}

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

.service-card:hover::before,
.product-card:hover::before {
    left: 100%;
}

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

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

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

.btn-primary {
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
}

/* Logo Client Animation */
.client-logo {
    animation: fadeIn 0.6s ease-out both;
}

.client-logo:nth-child(1) { animation-delay: 0.1s; }
.client-logo:nth-child(2) { animation-delay: 0.2s; }
.client-logo:nth-child(3) { animation-delay: 0.3s; }
.client-logo:nth-child(4) { animation-delay: 0.4s; }
.client-logo:nth-child(5) { animation-delay: 0.5s; }
.client-logo:nth-child(6) { animation-delay: 0.6s; }
.client-logo:nth-child(7) { animation-delay: 0.7s; }

/* Why Cards Float Effect */
.why-card {
    animation: float 6s ease-in-out infinite;
}

.why-card:nth-child(1) { animation-delay: 0s; }
.why-card:nth-child(2) { animation-delay: 1.5s; }
.why-card:nth-child(3) { animation-delay: 3s; }
.why-card:nth-child(4) { animation-delay: 4.5s; }

/* Scroll Animations */
.fade-in-up {
    animation: fadeInUp 0.8s ease-out both;
}

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

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

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

/* Loading Animation */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading {
    animation: spin 1s linear infinite;
}

/* Ripple Effect */
@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: transform 0.5s, opacity 1s;
}

.ripple:active::after {
    animation: ripple 0.6s ease-out;
}

/* Navbar Scroll Animation */
.header {
    animation: slideInFromTop 0.5s ease-out;
}

/* Section Entrance Animations (Applied via JS) */
.section-animate {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.section-animate.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger Animation for Grid Items */
.stagger-item {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.stagger-item.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Typing Effect */
@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink {
    50% {
        border-color: transparent;
    }
}

.typing-effect {
    overflow: hidden;
    border-right: 2px solid var(--secondary-color);
    white-space: nowrap;
    animation: typing 3.5s steps(40) 1s 1 normal both, blink 0.75s step-end infinite;
}

/* Smooth Hover Transitions */
a, button, .card, .icon {
    transition: all var(--transition-base);
}

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