/**
 * HIPAA Auditors - Animations & Interactions
 * Smooth animations, scroll effects, and micro-interactions
 */

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

/* Fade in from bottom */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
}

/* Fade in from left */
@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-fade-in-left {
    animation: fadeInLeft 0.6s ease-out forwards;
}

/* Fade in from right */
@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-fade-in-right {
    animation: fadeInRight 0.6s ease-out forwards;
}

/* Scale in */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-scale-in {
    animation: scaleIn 0.5s ease-out forwards;
}

/* Animation delays */
.delay-100 {
    animation-delay: 100ms;
}

.delay-200 {
    animation-delay: 200ms;
}

.delay-300 {
    animation-delay: 300ms;
}

.delay-400 {
    animation-delay: 400ms;
}

.delay-500 {
    animation-delay: 500ms;
}

/* Initial state for scroll animations */
.scroll-animate {
    opacity: 0;
}

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

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

/* Lift on hover */
.hover-lift {
    transition: transform var(--duration-300) var(--ease-out),
        box-shadow var(--duration-300) var(--ease-out);
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* Lift with glow */
.hover-lift-glow {
    transition: transform var(--duration-300) var(--ease-out),
        box-shadow var(--duration-300) var(--ease-out);
}

.hover-lift-glow:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-xl), var(--glow-accent);
}

/* Tilt effect (3D) */
.hover-tilt {
    transition: transform var(--duration-300) var(--ease-out);
    transform-style: preserve-3d;
}

.hover-tilt:hover {
    transform: perspective(1000px) rotateX(2deg) rotateY(-2deg);
}

/* Scale on hover */
.hover-scale {
    transition: transform var(--duration-300) var(--ease-out);
}

.hover-scale:hover {
    transform: scale(1.05);
}

/* Glow on hover */
.hover-glow {
    transition: box-shadow var(--duration-300) var(--ease-out);
}

.hover-glow:hover {
    box-shadow: var(--glow-accent);
}

/* Gradient shift on hover */
.hover-gradient-shift {
    background-size: 200% 100%;
    transition: background-position var(--duration-500) var(--ease-in-out);
}

.hover-gradient-shift:hover {
    background-position: 100% 0;
}

/* ========================================
   GRADIENT ANIMATIONS
   ======================================== */

/* Animated gradient background */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.gradient-animate {
    background-size: 200% 200%;
    animation: gradientShift 15s ease infinite;
}

/* Mesh gradient animation */
@keyframes meshFloat {

    0%,
    100% {
        transform: translate(0, 0);
    }

    33% {
        transform: translate(30px, -30px);
    }

    66% {
        transform: translate(-20px, 20px);
    }
}

.mesh-animate {
    animation: meshFloat 20s ease-in-out infinite;
}

/* ========================================
   FLOATING ANIMATIONS
   ======================================== */

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

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

.float-slow {
    animation: float 6s ease-in-out infinite;
}

/* Floating with rotation */
@keyframes floatRotate {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-20px) rotate(5deg);
    }
}

.float-rotate {
    animation: floatRotate 4s ease-in-out infinite;
}

/* ========================================
   PULSE ANIMATIONS
   ======================================== */

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

.pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* Pulse glow */
@keyframes pulseGlow {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(6, 182, 212, 0.7);
    }

    50% {
        box-shadow: 0 0 20px 10px rgba(6, 182, 212, 0);
    }
}

.pulse-glow {
    animation: pulseGlow 2s ease-in-out infinite;
}

/* ========================================
   COUNTER ANIMATIONS
   ======================================== */

@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.counter-animate {
    animation: countUp 0.8s ease-out forwards;
}

/* ========================================
   SHIMMER EFFECT
   ======================================== */

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }

    100% {
        background-position: 1000px 0;
    }
}

.shimmer {
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 255, 255, 0.3) 50%,
            transparent 100%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* ========================================
   SLIDE ANIMATIONS
   ======================================== */

@keyframes slideInFromLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.slide-in-left {
    animation: slideInFromLeft 0.6s ease-out forwards;
}

@keyframes slideInFromRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.slide-in-right {
    animation: slideInFromRight 0.6s ease-out forwards;
}

/* ========================================
   REVEAL ANIMATIONS
   ======================================== */

@keyframes revealFromTop {
    from {
        clip-path: inset(0 0 100% 0);
    }

    to {
        clip-path: inset(0 0 0 0);
    }
}

.reveal-top {
    animation: revealFromTop 0.8s ease-out forwards;
}

@keyframes revealFromBottom {
    from {
        clip-path: inset(100% 0 0 0);
    }

    to {
        clip-path: inset(0 0 0 0);
    }
}

.reveal-bottom {
    animation: revealFromBottom 0.8s ease-out forwards;
}

/* ========================================
   PARALLAX EFFECT
   ======================================== */

.parallax {
    transition: transform 0.3s ease-out;
}

/* Applied via JavaScript based on scroll position */
.parallax-slow {
    will-change: transform;
}

.parallax-medium {
    will-change: transform;
}

.parallax-fast {
    will-change: transform;
}

/* ========================================
   LOADING ANIMATIONS
   ======================================== */

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

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

.spin-slow {
    animation: spin 2s linear infinite;
}

/* Dots loading */
@keyframes dotPulse {

    0%,
    80%,
    100% {
        opacity: 0.3;
        transform: scale(0.8);
    }

    40% {
        opacity: 1;
        transform: scale(1);
    }
}

.dot-pulse {
    animation: dotPulse 1.4s ease-in-out infinite;
}

.dot-pulse-2 {
    animation: dotPulse 1.4s ease-in-out 0.2s infinite;
}

.dot-pulse-3 {
    animation: dotPulse 1.4s ease-in-out 0.4s infinite;
}

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

/* Button press effect */
.btn-press:active {
    transform: scale(0.98);
}

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

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

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

.ripple-effect:active::after {
    width: 300px;
    height: 300px;
}

/* Icon bounce on hover */
@keyframes iconBounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

.icon-bounce:hover {
    animation: iconBounce 0.5s ease;
}

/* ========================================
   STAGGER ANIMATIONS
   ======================================== */

.stagger-item {
    opacity: 0;
    animation: fadeInUp 0.6s ease-out forwards;
}

.stagger-item:nth-child(1) {
    animation-delay: 0.1s;
}

.stagger-item:nth-child(2) {
    animation-delay: 0.2s;
}

.stagger-item:nth-child(3) {
    animation-delay: 0.3s;
}

.stagger-item:nth-child(4) {
    animation-delay: 0.4s;
}

.stagger-item:nth-child(5) {
    animation-delay: 0.5s;
}

.stagger-item:nth-child(6) {
    animation-delay: 0.6s;
}

/* ========================================
   PERFORMANCE OPTIMIZATIONS
   ======================================== */

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

    .parallax,
    .float,
    .float-slow,
    .float-rotate {
        animation: none !important;
        transform: none !important;
    }
}

/* GPU acceleration for smooth animations */
.gpu-accelerate {
    transform: translateZ(0);
    will-change: transform;
}

/* ========================================
   TRANSITION UTILITIES
   ======================================== */

.transition-none {
    transition: none !important;
}

.transition-all {
    transition: var(--transition-all);
}

.transition-colors {
    transition: var(--transition-colors);
}

.transition-transform {
    transition: var(--transition-transform);
}

.transition-opacity {
    transition: var(--transition-opacity);
}

.transition-shadow {
    transition: var(--transition-shadow);
}

/* Duration utilities */
.duration-75 {
    transition-duration: var(--duration-75);
}

.duration-100 {
    transition-duration: var(--duration-100);
}

.duration-150 {
    transition-duration: var(--duration-150);
}

.duration-200 {
    transition-duration: var(--duration-200);
}

.duration-300 {
    transition-duration: var(--duration-300);
}

.duration-500 {
    transition-duration: var(--duration-500);
}

.duration-700 {
    transition-duration: var(--duration-700);
}

.duration-1000 {
    transition-duration: var(--duration-1000);
}

/* Easing utilities */
.ease-linear {
    transition-timing-function: var(--ease-linear);
}

.ease-in {
    transition-timing-function: var(--ease-in);
}

.ease-out {
    transition-timing-function: var(--ease-out);
}

.ease-in-out {
    transition-timing-function: var(--ease-in-out);
}

.ease-bounce {
    transition-timing-function: var(--ease-bounce);
}