/**
 * WhatsApp Contact - Frontend Styles
 *
 * @author    Omar - Devsviluppo.com
 * @copyright 2024 Devsviluppo.com
 */

#whatsapp-contact-button {
    position: fixed;
    z-index: 9999;
    transition: all 0.3s ease;
}

#whatsapp-contact-button.mobile-only {
    display: none;
}

@media (max-width: 768px) {
    #whatsapp-contact-button.mobile-only {
        display: block;
    }
}

.whatsapp-link {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #25D366;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    transition: all 0.3s ease;
    text-decoration: none;
    position: relative;
    overflow: visible;
}

.whatsapp-link:hover {
    background: #128C7E;
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.6);
    transform: scale(1.1);
    text-decoration: none;
}

.whatsapp-link:active {
    transform: scale(0.95);
}

.whatsapp-icon {
    width: 60%;
    height: 60%;
    color: #fff;
    transition: transform 0.3s ease;
}

.whatsapp-link:hover .whatsapp-icon {
    transform: rotate(10deg);
}

/* Animazione pulse */
.whatsapp-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(37, 211, 102, 0.4);
    animation: whatsapp-pulse 2s infinite;
    pointer-events: none;
}

@keyframes whatsapp-pulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0;
    }
}

/* Animazione entrata */
@keyframes slideIn {
    from {
        transform: translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

#whatsapp-contact-button {
    animation: slideIn 0.5s ease-out;
}

/* Responsive */
@media (max-width: 768px) {
    .whatsapp-link {
        box-shadow: 0 3px 10px rgba(37, 211, 102, 0.3);
    }
}

/* Accessibilità - migliore visibilità focus */
.whatsapp-link:focus {
    outline: 3px solid #128C7E;
    outline-offset: 3px;
}

.whatsapp-link:focus:not(:focus-visible) {
    outline: none;
}

/* Tooltip personalizzato (opzionale) */
.whatsapp-link::after {
    content: attr(title);
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) scale(0);
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    pointer-events: none;
    transition: transform 0.2s ease, opacity 0.2s ease;
    opacity: 0;
}

.whatsapp-link:hover::after {
    transform: translateX(-50%) scale(1);
    opacity: 1;
}

/* Nascondi tooltip nativo su mobile */
@media (max-width: 768px) {
    .whatsapp-link::after {
        display: none;
    }
}
