/* Animation Utilities */
.animate-fade-in {
    animation: fadeIn 1s ease forwards;
}

.animate-fade-up {
    animation: fadeUp 1s ease forwards;
}

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

.animate-slide-left {
    animation: slideLeft 1s ease forwards;
}

.animate-slide-right {
    animation: slideRight 1s ease forwards;
}

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

/* Keyframes Animations */
@keyframes fadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

@keyframes fadeUp {
    0% { opacity: 0; transform: translateY(30px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
    0% { opacity: 0; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes slideLeft {
    0% { opacity: 0; transform: translateX(50px); }
    100% { opacity: 1; transform: translateX(0); }
}

@keyframes slideRight {
    0% { opacity: 0; transform: translateX(-50px); }
    100% { opacity: 1; transform: translateX(0); }
}

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

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

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

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

/* Particles Animation */
.particles-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
}

.particle {
    position: absolute;
    width: 30px;
    height: 30px;
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.5;
    pointer-events: none;
    z-index: 1;
}

.particle.leaf-1 {
    background-image: url('https://cdn-icons-png.flaticon.com/512/188/188333.png');
}

.particle.leaf-2 {
    background-image: url('https://cdn-icons-png.flaticon.com/512/188/188333.png');
    transform: rotate(45deg);
}

.particle.leaf-3 {
    background-image: url('https://cdn-icons-png.flaticon.com/512/188/188333.png');
    transform: rotate(-45deg);
}

/* Button Hover Effects */
.btn-primary span {
    position: relative;
    z-index: 1;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0%;
    height: 100%;
    background-color: var(--primary-dark);
    transition: width 0.4s ease;
    border-radius: var(--border-radius-rounded);
    z-index: 0;
}

.btn-primary:hover::before {
    width: 100%;
}

/* Service Card Animation */
@keyframes ripple {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* Hero Title Animation */
.hero-title {
    overflow: hidden;
}

.hero-title span {
    display: inline-block;
    animation: colorChange 3s infinite alternate;
}

@keyframes colorChange {
    0% { color: var(--secondary-light); }
    50% { color: #ffffff; }
    100% { color: var(--secondary-light); }
}

/* Image Hover Effects */
.hover-zoom {
    overflow: hidden;
}

.hover-zoom img {
    transition: transform 0.5s ease;
}

.hover-zoom:hover img {
    transform: scale(1.1);
}

/* Custom Cursor Animation */
@keyframes cursorPulse {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 0.7; }
    50% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.5; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 0.7; }
}

.custom-cursor.active {
    animation: cursorPulse 1.5s infinite;
}

.custom-cursor.hovering {
    width: 50px;
    height: 50px;
    border-width: 3px;
    background-color: rgba(46, 139, 87, 0.1);
}

/* Page Transition Animation */
.page-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary);
    z-index: 9999;
    transform: translateY(100%);
    transition: transform 0.7s cubic-bezier(0.7, 0, 0.3, 1);
}

.page-transition.active {
    transform: translateY(0%);
}

.page-transition.exit {
    transform: translateY(-100%);
}

/* Leaf Float Animation */
.floating-leaf {
    position: absolute;
    width: 40px;
    height: 40px;
    background-size: contain;
    background-repeat: no-repeat;
    z-index: 0;
    opacity: 0.5;
    animation: float 15s infinite ease-in-out;
}

/* Counter Animation */
.counter-number {
    position: relative;
    display: inline-block;
}

.counter-number::after {
    content: " +";
    position: absolute;
    right: -30px;
    top: 0;
}

/* Testimonial Slider Animation */
.testimonial-slider {
    position: relative;
}

.testimonial-item {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.5s ease;
    position: absolute;
    width: 100%;
    top: 0;
    left: 0;
}

.testimonial-item.active {
    opacity: 1;
    transform: translateX(0);
    position: relative;
}

.testimonial-item.prev {
    transform: translateX(-50px);
}

.testimonial-item.next {
    transform: translateX(50px);
}

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

.form-control.error {
    border-color: #dc3545 !important;
    animation: shake 0.6s;
}

/* Loading Button Animation */
.btn.loading {
    position: relative;
    pointer-events: none;
}

.btn.loading span {
    visibility: hidden;
}

.btn.loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-top: -10px;
    margin-left: -10px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

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

/* Shimmer Effect */
.shimmer {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0),
        rgba(255, 255, 255, 0.2),
        rgba(255, 255, 255, 0)
    );
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

/* Projects Filter Animation */
.project-item {
    transition: all 0.5s ease;
}

.project-item.hidden {
    opacity: 0;
    transform: scale(0.8);
    height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
}