/**
 * WhatsApp Floating Button
 * Animated, responsive, and professional design
 */

.whatsapp-float {
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 30px;
    right: 50px;
    background-color: #25d366;
    color: #FFF;
    border-radius: 50px;
    text-align: center;
    font-size: 30px;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
}

.whatsapp-float:hover {
    background-color: #128c7e;
    transform: scale(1.1);
    box-shadow: 2px 2px 20px rgba(37, 211, 102, 0.6);
}

.whatsapp-float i {
    margin: 0;
    line-height: 1;
}

/* Pulse animation */
.whatsapp-float::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: rgba(37, 211, 102, 0.5);
    animation: whatsapp-pulse 2s infinite;
    z-index: -1;
}

@keyframes whatsapp-pulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.3);
        opacity: 0.5;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0;
    }
}

/* Tooltip on hover */
.whatsapp-float .whatsapp-tooltip {
    position: absolute;
    right: 70px;
    top: 50%;
    transform: translateY(-50%);
    background-color: #128c7e;
    color: #fff;
    padding: 10px 15px;
    border-radius: 8px;
    white-space: nowrap;
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.whatsapp-float .whatsapp-tooltip::after {
    content: '';
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 8px 0 8px 8px;
    border-color: transparent transparent transparent #128c7e;
}

.whatsapp-float:hover .whatsapp-tooltip {
    opacity: 1;
    visibility: visible;
    right: 75px;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .whatsapp-float {
        width: 50px;
        height: 50px;
        font-size: 24px;
        bottom: 20px;
        right: 20px;
    }

    .whatsapp-float .whatsapp-tooltip {
        display: none;
    }
}

@media (max-width: 480px) {
    .whatsapp-float {
        width: 45px;
        height: 45px;
        font-size: 22px;
        bottom: 15px;
        right: 15px;
    }
}

/* Fade in animation on page load */
@keyframes whatsapp-fadein {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.whatsapp-float {
    animation: whatsapp-fadein 0.5s ease-out 0.5s both;
}

/* Shake animation (attention grabber) */
@keyframes whatsapp-shake {
    0%, 100% {
        transform: rotate(0deg);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: rotate(-10deg);
    }
    20%, 40%, 60%, 80% {
        transform: rotate(10deg);
    }
}

.whatsapp-float.shake {
    animation: whatsapp-shake 0.5s ease-in-out;
}

/* Auto shake every 10 seconds */
@keyframes whatsapp-auto-shake {
    0%, 10%, 100% {
        transform: rotate(0deg);
    }
    2%, 6% {
        transform: rotate(-10deg);
    }
    4%, 8% {
        transform: rotate(10deg);
    }
}

.whatsapp-float {
    animation:
        whatsapp-fadein 0.5s ease-out 0.5s both,
        whatsapp-auto-shake 10s ease-in-out 3s infinite;
}
