/* ===================================
   WHATSAPP FLOATING BUTTON
   =================================== */

:root {
    --whatsapp-green: #25D366;
    --whatsapp-dark: #128C7E;
    --whatsapp-light: #DCF8C6;
    --button-size: 65px;
    --button-size-mobile: 55px;
}

.whatsapp-button {
    position: fixed;
    bottom: 2rem;
    right: 6.5rem;
    width: var(--button-size);
    height: var(--button-size);
    background: linear-gradient(135deg, var(--whatsapp-green) 0%, var(--whatsapp-dark) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 30px rgba(37, 211, 102, 0.5);
    cursor: pointer;
    z-index: 999;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    overflow: visible;
    animation: bounce 2s ease-in-out infinite;
}

/* Ripple effect background */
.whatsapp-button::before {
    content: '';
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(37, 211, 102, 0.3) 0%, transparent 70%);
    animation: pulse 2s ease-in-out infinite;
    z-index: -1;
}

/* Glow effect */
.whatsapp-button::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.whatsapp-button:hover {
    transform: scale(1.15) rotate(5deg);
    box-shadow: 0 12px 45px rgba(37, 211, 102, 0.7);
    animation: none;
}

.whatsapp-button:hover::after {
    opacity: 1;
}

.whatsapp-button:active {
    transform: scale(1.05);
}

/* WhatsApp Icon */
.whatsapp-icon {
    width: 36px;
    height: 36px;
    color: white;
    transition: transform 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.whatsapp-button:hover .whatsapp-icon {
    transform: scale(1.1) rotate(-5deg);
}

/* Tooltip */
.whatsapp-tooltip {
    position: absolute;
    right: calc(100% + 1rem);
    background: white;
    color: var(--whatsapp-dark);
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    font-size: 0.9375rem;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateX(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    font-family: 'Outfit', -apple-system, sans-serif;
}

.whatsapp-tooltip::after {
    content: '';
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid white;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
}

.whatsapp-button:hover .whatsapp-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

/* Tooltip periodic animation */
.whatsapp-button.show-tooltip .whatsapp-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    animation: tooltipBounce 0.5s ease;
}

/* Animations */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-12px);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.3);
    }
}

@keyframes tooltipBounce {
    0%, 100% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(-5px);
    }
}

/* ===================================
   MOBILE RESPONSIVE
   =================================== */

@media (max-width: 768px) {
    .whatsapp-button {
        bottom: 1.5rem;
        right: 4.5rem;
        width: var(--button-size-mobile);
        height: var(--button-size-mobile);
    }
    
    .whatsapp-icon {
        width: 30px;
        height: 30px;
    }
    
    .whatsapp-tooltip {
        font-size: 0.875rem;
        padding: 0.625rem 1rem;
        right: calc(100% + 0.75rem);
    }
    
    @keyframes bounce {
        0%, 100% {
            transform: translateY(0);
        }
        50% {
            transform: translateY(-8px);
        }
    }
}

/* Tablet adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
    .whatsapp-button {
        bottom: 2rem;
        right: 5.5rem;
        width: 60px;
        height: 60px;
    }
    
    .whatsapp-icon {
        width: 34px;
        height: 34px;
    }
}

/* High DPI screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .whatsapp-button {
        box-shadow: 0 8px 30px rgba(37, 211, 102, 0.6);
    }
}
