/**
 * WebAgency Pro Animation Styles
 *
 * @package WebAgency_Pro
 * @version 1.0.0
 */

/* ============================================
   KEYFRAME ANIMATIONS
   ============================================ */

/* Fade In */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

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

/* Fade In Left */
@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Fade In Right */
@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Fade In Scale */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Slide In Up */
@keyframes slideInUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

/* Slide In Down */
@keyframes slideInDown {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

/* Slide In Left */
@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

/* Slide In Right */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

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

/* Scale Out */
@keyframes scaleOut {
    from {
        transform: scale(1);
        opacity: 1;
    }
    to {
        transform: scale(0);
        opacity: 0;
    }
}

/* Bounce In */
@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

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

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

/* Pulse Ring */
@keyframes pulseRing {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

/* Shake */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

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

/* Rotate In */
@keyframes rotateIn {
    from {
        transform: rotate(-180deg);
        opacity: 0;
    }
    to {
        transform: rotate(0);
        opacity: 1;
    }
}

/* Flip In X */
@keyframes flipInX {
    from {
        transform: perspective(400px) rotateX(90deg);
        opacity: 0;
    }
    40% {
        transform: perspective(400px) rotateX(-20deg);
    }
    60% {
        transform: perspective(400px) rotateX(10deg);
        opacity: 1;
    }
    80% {
        transform: perspective(400px) rotateX(-5deg);
    }
    to {
        transform: perspective(400px) rotateX(0);
    }
}

/* Flip In Y */
@keyframes flipInY {
    from {
        transform: perspective(400px) rotateY(90deg);
        opacity: 0;
    }
    40% {
        transform: perspective(400px) rotateY(-20deg);
    }
    60% {
        transform: perspective(400px) rotateY(10deg);
        opacity: 1;
    }
    80% {
        transform: perspective(400px) rotateY(-5deg);
    }
    to {
        transform: perspective(400px) rotateY(0);
    }
}

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

/* Float Horizontal */
@keyframes floatHorizontal {
    0%, 100% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(20px);
    }
}

/* Glow Pulse */
@keyframes glowPulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
    }
    50% {
        box-shadow: 0 0 40px rgba(99, 102, 241, 0.8);
    }
}

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

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

/* Border Glow */
@keyframes borderGlow {
    0%, 100% {
        border-color: rgba(99, 102, 241, 0.3);
    }
    50% {
        border-color: rgba(236, 72, 153, 0.3);
    }
}

/* Typing Cursor */
@keyframes typingCursor {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0;
    }
}

/* Wave */
@keyframes wave {
    0%, 100% {
        transform: translateY(0);
    }
    25% {
        transform: translateY(-5px);
    }
    75% {
        transform: translateY(5px);
    }
}

/* Heartbeat */
@keyframes heartbeat {
    0%, 100% {
        transform: scale(1);
    }
    14% {
        transform: scale(1.1);
    }
    28% {
        transform: scale(1);
    }
    42% {
        transform: scale(1.1);
    }
    70% {
        transform: scale(1);
    }
}

/* Spin Reverse */
@keyframes spinReverse {
    from {
        transform: rotate(360deg);
    }
    to {
        transform: rotate(0deg);
    }
}

/* Elastic */
@keyframes elastic {
    0% {
        transform: scale(0);
    }
    55% {
        transform: scale(1.1);
    }
    70% {
        transform: scale(0.95);
    }
    100% {
        transform: scale(1);
    }
}

/* ============================================
   ANIMATION UTILITY CLASSES
   ============================================ */

/* Duration */
.anim-fast {
    animation-duration: 0.3s !important;
}

.anim-normal {
    animation-duration: 0.5s !important;
}

.anim-slow {
    animation-duration: 0.8s !important;
}

.anim-slower {
    animation-duration: 1.2s !important;
}

/* Delay */
.anim-delay-1 {
    animation-delay: 0.1s !important;
}

.anim-delay-2 {
    animation-delay: 0.2s !important;
}

.anim-delay-3 {
    animation-delay: 0.3s !important;
}

.anim-delay-4 {
    animation-delay: 0.4s !important;
}

.anim-delay-5 {
    animation-delay: 0.5s !important;
}

/* Fill Mode */
.anim-forwards {
    animation-fill-mode: forwards !important;
}

.anim-backwards {
    animation-fill-mode: backwards !important;
}

.anim-both {
    animation-fill-mode: both !important;
}

/* Timing Functions */
.anim-linear {
    animation-timing-function: linear !important;
}

.anim-ease {
    animation-timing-function: ease !important;
}

.anim-ease-in {
    animation-timing-function: ease-in !important;
}

.anim-ease-out {
    animation-timing-function: ease-out !important;
}

.anim-ease-in-out {
    animation-timing-function: ease-in-out !important;
}

.anim-bounce {
    animation-timing-function: cubic-bezier(0.68, -0.55, 0.265, 1.55) !important;
}

/* Animation Classes */
.animate-fadeIn {
    animation: fadeIn 0.5s ease forwards;
}

.animate-fadeInUp {
    animation: fadeInUp 0.5s ease forwards;
}

.animate-fadeInDown {
    animation: fadeInDown 0.5s ease forwards;
}

.animate-fadeInLeft {
    animation: fadeInLeft 0.5s ease forwards;
}

.animate-fadeInRight {
    animation: fadeInRight 0.5s ease forwards;
}

.animate-fadeInScale {
    animation: fadeInScale 0.5s ease forwards;
}

.animate-slideInUp {
    animation: slideInUp 0.5s ease forwards;
}

.animate-slideInDown {
    animation: slideInDown 0.5s ease forwards;
}

.animate-slideInLeft {
    animation: slideInLeft 0.5s ease forwards;
}

.animate-slideInRight {
    animation: slideInRight 0.5s ease forwards;
}

.animate-scaleIn {
    animation: scaleIn 0.3s ease forwards;
}

.animate-scaleOut {
    animation: scaleOut 0.3s ease forwards;
}

.animate-bounceIn {
    animation: bounceIn 0.6s ease forwards;
}

.animate-bounce {
    animation: bounce 1s ease infinite;
}

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

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

.animate-rotate {
    animation: rotate 2s linear infinite;
}

.animate-rotateIn {
    animation: rotateIn 0.5s ease forwards;
}

.animate-flipInX {
    animation: flipInX 0.6s ease forwards;
}

.animate-flipInY {
    animation: flipInY 0.6s ease forwards;
}

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

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

.animate-glowPulse {
    animation: glowPulse 2s ease infinite;
}

.animate-shimmer {
    animation: shimmer 2s linear infinite;
    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: 200% 100%;
}

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

.animate-borderGlow {
    animation: borderGlow 2s ease infinite;
}

.animate-wave {
    animation: wave 1s ease-in-out infinite;
}

.animate-heartbeat {
    animation: heartbeat 1.5s ease infinite;
}

.animate-spinReverse {
    animation: spinReverse 2s linear infinite;
}

.animate-elastic {
    animation: elastic 0.6s ease forwards;
}

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

.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

.animate-on-scroll.fade-in {
    transform: none;
}

.animate-on-scroll.fade-in-up {
    transform: translateY(30px);
}

.animate-on-scroll.fade-in-down {
    transform: translateY(-30px);
}

.animate-on-scroll.fade-in-left {
    transform: translateX(-30px);
}

.animate-on-scroll.fade-in-right {
    transform: translateX(30px);
}

.animate-on-scroll.scale-in {
    transform: scale(0.9);
}

.animate-on-scroll.rotate-in {
    transform: rotate(-10deg) scale(0.9);
}

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

.stagger-2 > *:nth-child(1) { transition-delay: 0.2s; }
.stagger-2 > *:nth-child(2) { transition-delay: 0.4s; }
.stagger-2 > *:nth-child(3) { transition-delay: 0.6s; }
.stagger-2 > *:nth-child(4) { transition-delay: 0.8s; }
.stagger-2 > *:nth-child(5) { transition-delay: 1s; }
.stagger-2 > *:nth-child(6) { transition-delay: 1.2s; }

/* ============================================
   HOVER ANIMATIONS
   ============================================ */

.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.hover-scale {
    transition: transform 0.3s ease;
}

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

.hover-rotate {
    transition: transform 0.3s ease;
}

.hover-rotate:hover {
    transform: rotate(5deg);
}

.hover-glow {
    transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.5);
}

.hover-underline {
    position: relative;
}

.hover-underline::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #6366f1, #ec4899);
    transition: width 0.3s ease;
}

.hover-underline:hover::after {
    width: 100%;
}

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

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: rotate 1s linear infinite;
}

.loading-spinner-sm {
    width: 24px;
    height: 24px;
    border-width: 2px;
}

.loading-spinner-lg {
    width: 64px;
    height: 64px;
    border-width: 4px;
}

.loading-dots {
    display: flex;
    gap: 8px;
}

.loading-dots span {
    width: 10px;
    height: 10px;
    background: #6366f1;
    border-radius: 50%;
    animation: bounce 0.6s ease infinite;
}

.loading-dots span:nth-child(2) {
    animation-delay: 0.1s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0.2s;
}

/* ============================================
   PAGE TRANSITIONS
   ============================================ */

.page-transition-enter {
    opacity: 0;
    transform: translateY(20px);
}

.page-transition-enter-active {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.page-transition-exit {
    opacity: 1;
    transform: translateY(0);
}

.page-transition-exit-active {
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* ============================================
   SPECIAL EFFECTS
   ============================================ */

/* Text Gradient Animation */
.text-gradient-animated {
    background: linear-gradient(90deg, #6366f1, #ec4899, #6366f1);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s linear infinite;
}

/* Neon Glow */
.neon-glow {
    text-shadow: 
        0 0 5px #6366f1,
        0 0 10px #6366f1,
        0 0 20px #6366f1,
        0 0 40px #6366f1;
}

/* Glass Reflection */
.glass-reflection {
    position: relative;
    overflow: hidden;
}

.glass-reflection::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 70%
    );
    animation: shimmer 3s infinite;
}

/* Magnetic Button Effect Placeholder */
.magnetic-button {
    transition: transform 0.1s ease;
}

/* 3D Card Effect */
.card-3d {
    transform-style: preserve-3d;
    perspective: 1000px;
}

.card-3d-inner {
    transition: transform 0.6s ease;
    transform-style: preserve-3d;
}

.card-3d:hover .card-3d-inner {
    transform: rotateY(10deg) rotateX(5deg);
}

/* Particle Background Placeholder */
.particles-container {
    position: relative;
    overflow: hidden;
}

.particles-container canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* ============================================
   RESPONSIVE ANIMATIONS
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .animate-on-scroll {
        opacity: 1;
        transform: none;
    }
    
    .loading-spinner,
    .loading-dots span {
        animation: none;
    }
}

@media (max-width: 768px) {
    .animate-float,
    .animate-floatHorizontal {
        animation: none;
    }
    
    .hover-lift:hover,
    .hover-scale:hover {
        transform: none;
    }
}
