/* ============================================
   NYARARI SOLUTIONS - Animations
   Subtle & Professional animations
   ============================================ */

/* ---------- Intersection Observer Animation Classes ---------- */

/* Initial state for animated elements */
[data-animate] {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-animate].animated {
    opacity: 1;
    transform: translateY(0);
}

/* Fade In */
[data-animate="fade-in"] {
    opacity: 0;
    transform: none;
}

[data-animate="fade-in"].animated {
    opacity: 1;
}

/* Fade In Up */
[data-animate="fade-up"] {
    opacity: 0;
    transform: translateY(40px);
}

[data-animate="fade-up"].animated {
    opacity: 1;
    transform: translateY(0);
}

/* Fade In Down */
[data-animate="fade-down"] {
    opacity: 0;
    transform: translateY(-40px);
}

[data-animate="fade-down"].animated {
    opacity: 1;
    transform: translateY(0);
}

/* Fade In Left */
[data-animate="fade-left"] {
    opacity: 0;
    transform: translateX(-40px);
}

[data-animate="fade-left"].animated {
    opacity: 1;
    transform: translateX(0);
}

/* Fade In Right */
[data-animate="fade-right"] {
    opacity: 0;
    transform: translateX(40px);
}

[data-animate="fade-right"].animated {
    opacity: 1;
    transform: translateX(0);
}

/* Scale In */
[data-animate="scale-in"] {
    opacity: 0;
    transform: scale(0.9);
}

[data-animate="scale-in"].animated {
    opacity: 1;
    transform: scale(1);
}

/* Zoom In */
[data-animate="zoom-in"] {
    opacity: 0;
    transform: scale(0.5);
}

[data-animate="zoom-in"].animated {
    opacity: 1;
    transform: scale(1);
}

/* ---------- Animation Delays ---------- */
[data-delay="100"] { transition-delay: 0.1s; }
[data-delay="200"] { transition-delay: 0.2s; }
[data-delay="300"] { transition-delay: 0.3s; }
[data-delay="400"] { transition-delay: 0.4s; }
[data-delay="500"] { transition-delay: 0.5s; }
[data-delay="600"] { transition-delay: 0.6s; }
[data-delay="700"] { transition-delay: 0.7s; }
[data-delay="800"] { transition-delay: 0.8s; }

/* ---------- Animation Durations ---------- */
[data-duration="fast"] {
    transition-duration: 0.3s;
}

[data-duration="normal"] {
    transition-duration: 0.6s;
}

[data-duration="slow"] {
    transition-duration: 0.9s;
}

/* ---------- Hero Animations ---------- */
.hero-content h1 {
    animation: heroFadeUp 1s ease forwards;
    animation-delay: 0.2s;
    opacity: 0;
}

.hero-content .tagline {
    animation: heroFadeUp 1s ease forwards;
    animation-delay: 0.4s;
    opacity: 0;
}

.hero-buttons {
    animation: heroFadeUp 1s ease forwards;
    animation-delay: 0.6s;
    opacity: 0;
}

.scroll-indicator {
    animation: heroFadeUp 1s ease forwards;
    animation-delay: 1s;
    opacity: 0;
}

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

/* ---------- Counter Animation ---------- */
.stat-number {
    display: inline-block;
}

.stat-number.counting {
    animation: countPulse 0.3s ease;
}

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

/* ---------- Card Hover Animations ---------- */
.card,
.feature-box,
.value-card,
.contact-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover,
.feature-box:hover,
.value-card:hover {
    transform: translateY(-8px);
}

.contact-card:hover {
    transform: translateX(8px);
}

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

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

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

/* ---------- Link Underline Animation ---------- */
.animated-link {
    position: relative;
    display: inline-block;
}

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

.animated-link:hover::after {
    width: 100%;
}

/* ---------- Icon Animations ---------- */
.card-icon,
.feature-icon,
.contact-card-icon {
    transition: transform 0.3s ease, background 0.3s ease;
}

.card:hover .card-icon,
.feature-box:hover .feature-icon {
    transform: scale(1.1) rotate(5deg);
}

/* ---------- Table Row Animations ---------- */
.pricing-table tbody tr {
    transition: background-color 0.3s ease;
}

.pricing-table tbody tr:hover {
    background-color: rgba(230, 57, 70, 0.05);
}

/* ---------- Navigation Animation ---------- */
.navbar {
    transition: background 0.3s ease, padding 0.3s ease, box-shadow 0.3s ease;
}

.nav-link::after {
    transition: width 0.3s ease;
}

/* Mobile Menu Animation */
.nav-menu {
    transition: transform 0.4s ease, opacity 0.4s ease;
}

/* ---------- Page Transition ---------- */
.page-transition {
    animation: pageIn 0.5s ease forwards;
}

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

/* ---------- Loading Spinner ---------- */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--light-gray);
    border-top-color: var(--red);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ---------- Skeleton Loading ---------- */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--light-gray) 25%,
        #e9ecef 50%,
        var(--light-gray) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* ---------- Success/Error States ---------- */
.success-animation {
    animation: successPop 0.5s ease;
}

@keyframes successPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.shake-animation {
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-10px); }
    40% { transform: translateX(10px); }
    60% { transform: translateX(-10px); }
    80% { transform: translateX(10px); }
}

/* ---------- Floating Animation ---------- */
.float {
    animation: float 3s ease-in-out infinite;
}

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

/* ---------- Pulse Animation ---------- */
.pulse {
    animation: pulse 2s ease-in-out infinite;
}

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

/* ---------- Process Step Animation ---------- */
.process-step {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.process-step.animated {
    opacity: 1;
    transform: translateY(0);
}

.process-step:nth-child(1) { transition-delay: 0.1s; }
.process-step:nth-child(2) { transition-delay: 0.2s; }
.process-step:nth-child(3) { transition-delay: 0.3s; }
.process-step:nth-child(4) { transition-delay: 0.4s; }

/* ---------- Staggered Children Animation ---------- */
.stagger-children > * {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.stagger-children.animated > *:nth-child(1) { transition-delay: 0.1s; }
.stagger-children.animated > *:nth-child(2) { transition-delay: 0.2s; }
.stagger-children.animated > *:nth-child(3) { transition-delay: 0.3s; }
.stagger-children.animated > *:nth-child(4) { transition-delay: 0.4s; }
.stagger-children.animated > *:nth-child(5) { transition-delay: 0.5s; }
.stagger-children.animated > *:nth-child(6) { transition-delay: 0.6s; }

.stagger-children.animated > * {
    opacity: 1;
    transform: translateY(0);
}

/* ---------- 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;
    }

    [data-animate] {
        opacity: 1;
        transform: none;
    }

    .hero-content h1,
    .hero-content .tagline,
    .hero-buttons,
    .scroll-indicator {
        animation: none;
        opacity: 1;
    }
}
