/* ===============================
   MODERN ANIMATIONS & EFFECTS
   =============================== */

/* Enhanced Button Hover Effects */
.btn {
    transform-style: preserve-3d;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn:hover {
    transform: translateY(-2px) scale(1.02);
}

.btn:active {
    transform: translateY(0) scale(0.98);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    box-shadow: 0 10px 20px rgba(59, 130, 246, 0.3);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, var(--secondary-dark) 0%, var(--secondary) 100%);
    box-shadow: 0 10px 20px rgba(245, 158, 11, 0.3);
}

/* Card Hover Animations */
.card,
.about-item,
.pricing-block {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

.card:hover,
.about-item:hover,
.pricing-block:hover {
    transform: translateY(-8px) rotateX(5deg);
    box-shadow: 
        0 20px 25px -5px rgba(0, 0, 0, 0.1),
        0 10px 10px -5px rgba(0, 0, 0, 0.04),
        0 0 0 1px rgba(59, 130, 246, 0.05);
}

/* Service Image Hover Effects */
.service-img {
    overflow: hidden;
    border-radius: var(--border-radius-lg);
    position: relative;
}

.service-img::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(245, 158, 11, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 2;
}

.service-img:hover::before {
    opacity: 1;
}

.service-img img {
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-img:hover img {
    transform: scale(1.1) rotate(1deg);
}

/* Portfolio Item Effects */
.portflio-item {
    position: relative;
    overflow: hidden;
    border-radius: var(--border-radius-lg);
}

.portflio-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, rgba(59, 130, 246, 0.8) 0%, rgba(245, 158, 11, 0.8) 100%);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2;
}

.portflio-item:hover::after {
    opacity: 1;
}

.portflio-item img {
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.portflio-item:hover img {
    transform: scale(1.15);
}

/* Icon Animations */
.about-item .icon,
.process .icon-block i {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.about-item:hover .icon {
    transform: scale(1.1) rotateY(180deg);
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
}

.process .icon-block:hover i {
    transform: scale(1.2) rotateY(360deg);
    color: var(--secondary);
}

/* Text Glow Effect */
.text-glow {
    text-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
    animation: text-glow-pulse 2s ease-in-out infinite alternate;
}

@keyframes text-glow-pulse {
    from {
        text-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
    }
    to {
        text-shadow: 0 0 30px rgba(59, 130, 246, 0.8);
    }
}

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

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    33% {
        transform: translateY(-10px) rotate(1deg);
    }
    66% {
        transform: translateY(5px) rotate(-1deg);
    }
}

/* Pulse Animation */
.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

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

/* Slide In Animations */
.slide-in-left {
    animation: slideInLeft 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    opacity: 0;
    transform: translateX(-50px);
}

.slide-in-right {
    animation: slideInRight 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    opacity: 0;
    transform: translateX(50px);
}

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

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

/* Stagger Animation */
.stagger-item {
    opacity: 0;
    transform: translateY(30px);
    animation: staggerFadeIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) 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; }

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

/* Banner Text Animation */
.banner .block span {
    animation: slideInFromTop 1s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    opacity: 0;
    transform: translateY(-30px);
    animation-delay: 0.3s;
}

.banner .block h1 {
    animation: slideInFromBottom 1s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    opacity: 0;
    transform: translateY(30px);
    animation-delay: 0.6s;
}

.banner .block .btn {
    animation: scaleIn 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    opacity: 0;
    transform: scale(0.8);
    animation-delay: 0.9s;
}

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

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

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

/* Loading Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--gray-200);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Gradient Text */
.gradient-text {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 3s ease-in-out infinite;
}

@keyframes gradient-shift {
    0%, 100% {
        background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
        -webkit-background-clip: text;
        background-clip: text;
    }
    50% {
        background: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 100%);
        -webkit-background-clip: text;
        background-clip: text;
    }
}

/* Parallax Effect */
.parallax {
    transform-style: preserve-3d;
    transition: transform 0.1s ease-out;
}

/* Morphing Background */
.morphing-bg {
    background: linear-gradient(-45deg, var(--primary), var(--secondary), var(--accent), var(--primary-dark));
    background-size: 400% 400%;
    animation: morphing 15s ease infinite;
}

@keyframes morphing {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Typewriter Effect */
.typewriter {
    overflow: hidden;
    border-right: 2px solid var(--primary);
    white-space: nowrap;
    animation: typing 3.5s steps(40, end), blink 0.75s step-end infinite;
}

@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink {
    from, to {
        border-color: transparent;
    }
    50% {
        border-color: var(--primary);
    }
}

/* Shake Animation */
.shake {
    animation: shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes shake {
    10%, 90% {
        transform: translate3d(-1px, 0, 0);
    }
    20%, 80% {
        transform: translate3d(2px, 0, 0);
    }
    30%, 50%, 70% {
        transform: translate3d(-4px, 0, 0);
    }
    40%, 60% {
        transform: translate3d(4px, 0, 0);
    }
}

/* Bounce Animation */
.bounce {
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
        transform: translate3d(0, 0, 0);
    }
    40%, 43% {
        transition-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
        transform: translate3d(0, -30px, 0);
    }
    70% {
        transition-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
        transform: translate3d(0, -15px, 0);
    }
    90% {
        transform: translate3d(0, -4px, 0);
    }
}

/* Progress Bar Animation */
.progress-bar-animated {
    animation: progress-bar-stripes 1s linear infinite;
}

@keyframes progress-bar-stripes {
    0% {
        background-position: 1rem 0;
    }
    100% {
        background-position: 0 0;
    }
}

/* Mobile Specific Animations */
@media (max-width: 768px) {
    .mobile-fade-in {
        animation: mobileFadeIn 0.6s ease-out forwards;
        opacity: 0;
        transform: translateY(20px);
    }
    
    @keyframes mobileFadeIn {
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    /* Reduce motion for users who prefer it */
    @media (prefers-reduced-motion: reduce) {
        *,
        *::before,
        *::after {
            animation-duration: 0.01ms !important;
            animation-iteration-count: 1 !important;
            transition-duration: 0.01ms !important;
        }
    }
}