/* Stili per il widget WhatsApp nel frontend */

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

/* Posizioni del widget */
.whatsapp-bottom-right {
    bottom: 20px;
    right: 20px;
}

.whatsapp-bottom-left {
    bottom: 20px;
    left: 20px;
}

.whatsapp-top-right {
    top: 20px;
    right: 20px;
}

.whatsapp-top-left {
    top: 20px;
    left: 20px;
}

/* Link del widget */
.whatsapp-link {
    display: block;
    text-decoration: none;
    transition: all 0.3s ease;
}

.whatsapp-link:hover {
    transform: scale(1.1);
}

.whatsapp-link:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.3);
    border-radius: 50%;
}

/* Icona del widget */
.whatsapp-icon {
    width: var(--widget-size, 60px);
    height: var(--widget-size, 60px);
    background: #25d366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.whatsapp-icon:hover {
    background: #128c7e;
    box-shadow: 0 6px 16px rgba(37, 211, 102, 0.6);
}

/* SVG icon */
.whatsapp-icon svg {
    width: calc(var(--widget-size, 60px) * 0.5);
    height: calc(var(--widget-size, 60px) * 0.5);
    fill: currentColor;
}

/* Logo personalizzato */
.whatsapp-icon img {
    width: calc(var(--widget-size, 60px) * 0.8);
    height: calc(var(--widget-size, 60px) * 0.8);
    border-radius: 50%;
    object-fit: cover;
}

/* Animazione di pulsazione */
.whatsapp-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    background: rgba(37, 211, 102, 0.3);
    animation: whatsapp-pulse 2s infinite;
    z-index: -1;
}

@keyframes whatsapp-pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }
    100% {
        transform: scale(1.4);
        opacity: 0;
    }
}

/* Tooltip */
.whatsapp-link::after {
    content: attr(title);
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 10000;
}

.whatsapp-link::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    border: 3px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.8);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 10000;
}

.whatsapp-link:hover::after,
.whatsapp-link:hover::before {
    opacity: 1;
    visibility: visible;
}

/* Responsive */
@media (max-width: 768px) {
    #whatsapp-widget {
        --widget-size: 50px;
    }
    
    .whatsapp-bottom-right,
    .whatsapp-bottom-left {
        bottom: 15px;
    }
    
    .whatsapp-bottom-right {
        right: 15px;
    }
    
    .whatsapp-bottom-left {
        left: 15px;
    }
    
    .whatsapp-top-right,
    .whatsapp-top-left {
        top: 15px;
    }
    
    .whatsapp-top-right {
        right: 15px;
    }
    
    .whatsapp-top-left {
        left: 15px;
    }
}

@media (max-width: 480px) {
    #whatsapp-widget {
        --widget-size: 45px;
    }
    
    .whatsapp-bottom-right,
    .whatsapp-bottom-left {
        bottom: 10px;
    }
    
    .whatsapp-bottom-right {
        right: 10px;
    }
    
    .whatsapp-bottom-left {
        left: 10px;
    }
}

/* Accessibilità */
@media (prefers-reduced-motion: reduce) {
    .whatsapp-icon::before {
        animation: none;
    }
    
    .whatsapp-link:hover {
        transform: none;
    }
    
    * {
        transition: none !important;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .whatsapp-link::after {
        background: rgba(255, 255, 255, 0.9);
        color: #000;
    }
    
    .whatsapp-link::before {
        border-top-color: rgba(255, 255, 255, 0.9);
    }
}