.whatsapp-wrapper {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 999;
    opacity: 0;
    -webkit-transform: translateY(20px);
    transform: translateY(20px);
    -webkit-animation: slideIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation: slideIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    -webkit-transition: all 0.3s ease-in-out;
    transition: all 0.3s ease-in-out;
}

.whatsapp-wrapper .whatsapp-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(145deg, #128c7e, #25d366);
    -webkit-box-shadow:
        0 4px 15px rgba(37, 211, 102, 0.4),
        inset -2px -2px 6px rgba(0, 0, 0, 0.1),
        inset 2px 2px 6px rgba(255, 255, 255, 0.1);
    box-shadow:
        0 4px 15px rgba(37, 211, 102, 0.4),
        inset -2px -2px 6px rgba(0, 0, 0, 0.1),
        inset 2px 2px 6px rgba(255, 255, 255, 0.1);
    position: relative;
    color: white !important;
    -webkit-transition: all 0.3s ease-in-out;
    transition: all 0.3s ease-in-out;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.whatsapp-wrapper .whatsapp-btn:hover {
    -webkit-transform: translateY(-6px) scale(1.05);
    transform: translateY(-6px) scale(1.05);
    background: linear-gradient(145deg, #dcf8c6, #25d366);
    -webkit-box-shadow:
        0 8px 20px rgba(37, 211, 102, 0.5),
        inset -2px -2px 6px rgba(0, 0, 0, 0.1),
        inset 2px 2px 6px rgba(255, 255, 255, 0.1);
    box-shadow:
        0 8px 20px rgba(37, 211, 102, 0.5),
        inset -2px -2px 6px rgba(0, 0, 0, 0.1),
        inset 2px 2px 6px rgba(255, 255, 255, 0.1);
}

.whatsapp-wrapper .whatsapp-btn:active {
    -webkit-transform: translateY(-2px) scale(0.95);
    transform: translateY(-2px) scale(0.95);
    -webkit-box-shadow:
        0 4px 10px rgba(37, 211, 102, 0.4),
        inset -1px -1px 3px rgba(0, 0, 0, 0.1),
        inset 1px 1px 3px rgba(255, 255, 255, 0.1);
    box-shadow:
        0 4px 10px rgba(37, 211, 102, 0.4),
        inset -1px -1px 3px rgba(0, 0, 0, 0.1),
        inset 1px 1px 3px rgba(255, 255, 255, 0.1);
}

.whatsapp-wrapper .whatsapp-btn span {
    -webkit-filter: brightness(100) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    filter: brightness(100) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    -webkit-transform-origin: center;
    transform-origin: center;
    -webkit-transition: -webkit-transform 0.3s ease;
    transition: -webkit-transform 0.3s ease;
    transition: transform 0.3s ease;
    transition:
        transform 0.3s ease,
        -webkit-transform 0.3s ease;
}

.whatsapp-wrapper .whatsapp-btn span:hover {
    -webkit-transform: scale(1.1);
    transform: scale(1.1);
}

.whatsapp-wrapper .whatsapp-ripple {
    position: absolute;
    width: 160px;
    height: 160px;
    z-index: -1;
    left: 50%;
    top: 50%;
    -webkit-transform: translate(-50%, -50%);
    transform: translate(-50%, -50%);
    border-radius: 50%;
}

@media (max-width: 960px) {
    .whatsapp-wrapper .whatsapp-ripple {
        display: none;
    }
}

.whatsapp-wrapper .whatsapp-ripple::before,
.whatsapp-wrapper .whatsapp-ripple::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    -webkit-transform: translate(-50%, -50%);
    transform: translate(-50%, -50%);
    border-radius: 50%;
    -webkit-animation: ripple 3s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    animation: ripple 3s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    border: 2px solid rgba(37, 211, 102, 0.3);
}

.whatsapp-wrapper .whatsapp-ripple::after {
    -webkit-animation-delay: 1.5s;
    animation-delay: 1.5s;
}

.whatsapp-wrapper .whatsapp-ripple-click {
    /* Add styles for enhanced ripple effect on click */
    animation: ripple 0.6s ease-out;
}

@-webkit-keyframes ripple {
    0% {
        width: 0;
        height: 0;
        opacity: 0.5;
    }

    100% {
        width: 90%;
        height: 100%;
        opacity: 0;
    }
}

@keyframes ripple {
    0% {
        width: 0;
        height: 0;
        opacity: 0.5;
    }

    100% {
        width: 90%;
        height: 100%;
        opacity: 0;
    }
}

@-webkit-keyframes slideIn {
    0% {
        opacity: 0;
        -webkit-transform: translateY(20px);
        transform: translateY(20px);
    }

    100% {
        opacity: 1;
        -webkit-transform: translateY(0);
        transform: translateY(0);
    }
}

@keyframes slideIn {
    0% {
        opacity: 0;
        -webkit-transform: translateY(20px);
        transform: translateY(20px);
    }

    100% {
        opacity: 1;
        -webkit-transform: translateY(0);
        transform: translateY(0);
    }
}

/* Adjust WhatsApp wrapper position when mobile nav is visible */
.mobile-nav-container.nav-visible ~ .whatsapp-wrapper,
body:has(.mobile-nav-container.nav-visible) .whatsapp-wrapper {
    bottom: 100px !important;
    transition: bottom 0.3s ease;
}

/* Alternative approach if the above doesn't work due to DOM structure */
.nav-visible .whatsapp-wrapper {
    bottom: 100px !important;
    transition: bottom 0.3s ease;
}

/* For better browser compatibility, you can also use this approach */
body .whatsapp-wrapper {
    bottom: 20px; /* Default position */
    transition: bottom 0.3s ease;
}

body .mobile-nav-container.nav-visible ~ .whatsapp-wrapper,
body .mobile-nav-container.nav-visible .whatsapp-wrapper {
    bottom: 100px !important;
}
