/* ============================================
   ANIMATIONS.CSS – Scroll & Micro Animations
   ============================================ */

/* ============================================
   SCROLL ANIMATIONS
   ============================================ */

/* Fade in from bottom */
.animate-up {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Fade in from left */
.animate-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-left.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Fade in from right */
.animate-right {
    opacity: 0;
    transform: translateX(40px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-right.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Fade only */
.animate-fade {
    opacity: 0;
    transition: opacity 1s ease;
}

.animate-fade.visible {
    opacity: 1;
}

/* Scale in */
.animate-scale {
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-scale.visible {
    opacity: 1;
    transform: scale(1);
}

/* ============================================
   STAGGERED DELAYS
   ============================================ */

.stagger-item:nth-child(1)  { transition-delay: 0.05s; }
.stagger-item:nth-child(2)  { transition-delay: 0.15s; }
.stagger-item:nth-child(3)  { transition-delay: 0.25s; }
.stagger-item:nth-child(4)  { transition-delay: 0.35s; }
.stagger-item:nth-child(5)  { transition-delay: 0.45s; }
.stagger-item:nth-child(6)  { transition-delay: 0.55s; }
.stagger-item:nth-child(7)  { transition-delay: 0.65s; }
.stagger-item:nth-child(8)  { transition-delay: 0.75s; }

/* ============================================
   GRADIENT TEXT
   ============================================ */

.gradient-text {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================
   KEYFRAMES
   ============================================ */

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(5deg);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

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

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

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

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

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

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

@keyframes wiggle {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(-5deg);
    }
    75% {
        transform: rotate(5deg);
    }
}

/* ============================================
   MOBILE NAV ANIMATION
   ============================================ */

.mobile-nav {
    animation: none;
}

.mobile-nav.open {
    animation: slideInDown 0.3s ease forwards;
}

/* ============================================
   HERO SHAPES FLOATING
   ============================================ */

.shape-1 {
    animation: float 8s ease-in-out infinite;
}

.shape-2 {
    animation: float 10s ease-in-out infinite reverse;
}

.shape-3 {
    animation: float 6s ease-in-out infinite 2s;
}

/* ============================================
   BUTTON MICRO-INTERACTIONS
   ============================================ */

.btn-primary:active,
.btn-secondary:active {
    transform: scale(0.97);
}

/* ============================================
   ICON HOVER EFFECTS
   ============================================ */

.solution-icon,
.pain-icon,
.stat-icon {
    transition: transform 0.3s ease;
}

.solution-card:hover .solution-icon,
.pain-card:hover .pain-icon {
    transform: scale(1.15);
}

/* Pulse for notification / badge elements */
.pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* Bounce for scroll indicator */
.bounce {
    animation: bounce 1.5s ease-in-out infinite;
}

/* ============================================
   SKELETON LOADING
   ============================================ */

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius);
}

.skeleton-text {
    height: 1em;
    margin-bottom: 0.5rem;
    border-radius: var(--radius);
}

.skeleton-title {
    height: 1.5em;
    width: 70%;
    margin-bottom: 1rem;
    border-radius: var(--radius);
}

.skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

/* ============================================
   LOADING SPINNER
   ============================================ */

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(27, 42, 74, 0.15);
    border-top-color: var(--secondary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: inline-block;
}

/* ============================================
   COUNTER ANIMATION (JS hooks)
   ============================================ */

.count-up {
    display: inline-block;
    transition: all 0.3s ease;
}

/* ============================================
   CARD HOVER SHIMMER
   ============================================ */

.card-shimmer {
    position: relative;
    overflow: hidden;
}

.card-shimmer::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        105deg,
        transparent 40%,
        rgba(255, 255, 255, 0.15) 50%,
        transparent 60%
    );
    transform: translateX(-100%);
    transition: transform 0s;
}

.card-shimmer:hover::after {
    transform: translateX(100%);
    transition: transform 0.6s ease;
}

/* ============================================
   PREFERS-REDUCED-MOTION
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    .animate-up,
    .animate-left,
    .animate-right,
    .animate-fade,
    .animate-scale {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .shape-1,
    .shape-2,
    .shape-3 {
        animation: none;
    }

    .mobile-nav.open {
        animation: none;
    }

    .skeleton {
        animation: none;
        background: #f0f0f0;
    }

    .spinner {
        animation: none;
    }

    .pulse,
    .bounce {
        animation: none;
    }

    * {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
