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

/* Float Animation for Background Shapes */
@keyframes float {
    0%, 100% { 
        transform: translateY(0px) rotate(0deg); 
    }
    50% { 
        transform: translateY(-20px) rotate(180deg); 
    }
}

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

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

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

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

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

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

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

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

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

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

/* Typewriter Effect */
@keyframes typewriter {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink {
    0%, 50% {
        border-color: transparent;
    }
    51%, 100% {
        border-color: white;
    }
}

/* Warm Glow Effect - Modern and Welcoming */
.warm-glow {
    position: relative;
    animation: warmBreath 5s ease-in-out infinite;
}

@keyframes warmBreath {
    0%, 100% {
        transform: scale(1);
        filter: brightness(1);
    }
    50% {
        transform: scale(1.02);
        filter: brightness(1.1);
    }
}

.warm-glow::before {
    content: "";
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: radial-gradient(
        circle,
        rgba(255, 204, 102, 0.1) 0%,
        rgba(255, 179, 102, 0.05) 30%,
        transparent 70%
    );
    border-radius: 20px;
    z-index: -1;
    animation: warmAura 8s ease-in-out infinite;
}

@keyframes warmAura {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.1);
    }
}

/* Typewriter Effect */
.typewriter {
    overflow: hidden;
    border-right: 3px solid white;
    white-space: nowrap;
    animation: typewriter 4s steps(40, end), blink 0.75s step-end infinite;
    max-width: fit-content;
    margin: 0 auto;
}

/* 3D Tilt Effect */
.tilt-effect {
    transform-style: preserve-3d;
    transition: var(--transition-smooth);
}

.tilt-effect:hover {
    transform: perspective(1000px) rotateX(0deg) rotateY(0deg) translateY(-10px);
}

/* Parallax Effect */
.parallax-bg {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* Portfolio Item Animations */
.portfolio-item {
    animation: fadeInUp 0.6s ease both;
}

.portfolio-item:nth-child(1) { animation-delay: 0.1s; }
.portfolio-item:nth-child(2) { animation-delay: 0.2s; }
.portfolio-item:nth-child(3) { animation-delay: 0.3s; }
.portfolio-item:nth-child(4) { animation-delay: 0.4s; }
.portfolio-item:nth-child(5) { animation-delay: 0.5s; }
.portfolio-item:nth-child(6) { animation-delay: 0.6s; }

/* Service Card Animations */
.service-card {
    animation: fadeInUp 0.6s ease both;
}

.service-card:nth-child(1) { animation-delay: 0.2s; }
.service-card:nth-child(2) { animation-delay: 0.4s; }
.service-card:nth-child(3) { animation-delay: 0.6s; }
.service-card:nth-child(4) { animation-delay: 0.8s; }
.service-card:nth-child(5) { animation-delay: 1.0s; }
.service-card:nth-child(6) { animation-delay: 1.2s; }

/* Stats Animation */
.stat-item {
    animation: fadeInUp 0.6s ease both;
}

.stat-item:nth-child(1) { animation-delay: 0.2s; }
.stat-item:nth-child(2) { animation-delay: 0.4s; }
.stat-item:nth-child(3) { animation-delay: 0.6s; }
.stat-item:nth-child(4) { animation-delay: 0.8s; }

/* Hover Animations */
.hover-lift:hover {
    transform: translateY(-5px);
    transition: var(--transition-fast);
}

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

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

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.5);
    transition: var(--transition-fast);
}

/* Section Entrance Animations */
.section {
    animation: fadeIn 0.8s ease-in-out;
}

.section.active {
    animation: fadeInUp 0.8s ease-in-out;
}

/* Loading Animations */
.loading-pulse {
    animation: pulse 2s infinite;
}

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

.loading-bounce {
    animation: bounce 1.4s infinite ease-in-out;
}

/* Gradient Background Animation */
.animated-gradient {
    background: linear-gradient(-45deg, 
        var(--primary-color), 
        var(--secondary-color), 
        var(--accent-color), 
        var(--accent-secondary));
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

/* Text Reveal Animation */
.text-reveal {
    overflow: hidden;
}

.text-reveal span {
    display: inline-block;
    animation: fadeInUp 0.6s ease both;
}

.text-reveal span:nth-child(1) { animation-delay: 0.1s; }
.text-reveal span:nth-child(2) { animation-delay: 0.2s; }
.text-reveal span:nth-child(3) { animation-delay: 0.3s; }
.text-reveal span:nth-child(4) { animation-delay: 0.4s; }
.text-reveal span:nth-child(5) { animation-delay: 0.5s; }

/* Smooth Transitions */
.smooth-transition {
    transition: all var(--transition-smooth);
}

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

/* 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-bg {
        background-attachment: scroll;
    }
    
    .warm-glow {
        animation: none;
    }
    
    .typewriter {
        animation: none;
        border-right: none;
    }
}
