/* WhatsApp Floating Button Styles */
.whatsapp-float {
    position: sticky;
    bottom: 20px;
    /* This will push the button to the right edge of its container */
    margin-left: auto; 
    right: 20px;
    background-color: #25d366;
    color: white;
    border-radius: 50px;
    text-align: center;
    font-size: 24px;
    box-shadow: 0 4px 16px rgba(37, 211, 102, 0.3);
    z-index: 1000;
    transition: all 0.4s ease-in-out;
    text-decoration: none;
    display: flex;
    align-items: center;
    padding: 12px;
    width: 56px;
    height: 56px;
    overflow: hidden;
    white-space: nowrap;
    animation: whatsapp-bounce-in 0.6s ease-out;
}

.whatsapp-float:hover {
    text-decoration: none;
    color: white;
    background-color: #128c7e;
    box-shadow: 0 6px 25px rgba(37, 211, 102, 0.5);
    animation: whatsapp-glow 1.5s infinite alternate;
    width: 270px; /* Expanded width on hover */
    padding-right: 20px;
    border-radius: 30px;
}

.whatsapp-float .whatsapp-icon {
    font-size: 28px;
    margin-right: 0;
    transition: margin-right 0.4s ease-in-out;
    flex-shrink: 0;
}

.whatsapp-float:hover .whatsapp-icon {
    margin-right: 10px;
}

.whatsapp-float .whatsapp-text {
    opacity: 0;
    font-size: 14px;
    font-weight: 500;
    transition: opacity 0.3s 0.1s ease-in-out; /* Added delay for smoother appearance */
    white-space: nowrap;
}

.whatsapp-float:hover .whatsapp-text {
    opacity: 1;
}

@keyframes whatsapp-glow {
    0% {
        box-shadow: 0 6px 25px rgba(37, 211, 102, 0.5);
    }
    100% {
        box-shadow: 0 8px 35px rgba(37, 211, 102, 0.8);
    }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .whatsapp-float {
        bottom: 15px;
        right: 15px;
        width: 50px;
        height: 50px;
    }
    
    .whatsapp-float:hover {
        width: 250px;
    }

    .whatsapp-float .whatsapp-icon {
        font-size: 24px;
    }
    
    .whatsapp-float .whatsapp-text {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .whatsapp-float {
        bottom: 10px;
        right: 10px;
        width: 45px;
        height: 45px;
    }
    
    .whatsapp-float:hover {
        width: 230px;
    }

    .whatsapp-float .whatsapp-icon {
        font-size: 22px;
    }
}

/* Ensure the button doesn't interfere with other elements */
.whatsapp-float:focus {
    outline: none;
    box-shadow: 0 6px 25px rgba(37, 211, 102, 0.6);
}

/* Animation for initial load */
@keyframes whatsapp-bounce-in {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}
