/* WhatsApp Floating Button Styles */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0 8px 24px rgba(37, 211, 102, 0.25));
}

/* Scroll Message */
.whatsapp-scroll-message {
    position: absolute;
    bottom: 80px;
    right: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.8);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.3);
    z-index: 1;
    max-width: 200px;
    word-wrap: break-word;
}

.whatsapp-scroll-message.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.scroll-message-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.scroll-message-icon {
    width: 16px;
    height: 16px;
    animation: message-bounce 2s infinite;
}

@keyframes message-bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-3px);
    }
    60% {
        transform: translateY(-1px);
    }
}

.scroll-message-arrow {
    position: absolute;
    bottom: -8px;
    right: 20px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #667eea;
}

.whatsapp-button {
    position: relative;
    width: 65px;
    height: 65px;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 50%, #075E54 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 
        0 8px 32px rgba(37, 211, 102, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset,
        0 0 0 4px rgba(37, 211, 102, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.whatsapp-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #128C7E 0%, #25D366 100%);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.whatsapp-button::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #25D366, #128C7E, #075E54, #25D366);
    border-radius: 50%;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.4s ease;
    background-size: 400% 400%;
    animation: gradient-shift 3s ease infinite;
}

@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.whatsapp-button:hover::before {
    opacity: 1;
}

.whatsapp-button:hover::after {
    opacity: 1;
}

.whatsapp-button:hover {
    transform: translateY(-5px) scale(1.08);
    box-shadow: 
        0 15px 50px rgba(37, 211, 102, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.2) inset,
        0 0 0 6px rgba(37, 211, 102, 0.2);
}

.whatsapp-button:active {
    transform: translateY(-2px) scale(1.04);
    box-shadow: 
        0 8px 25px rgba(37, 211, 102, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset,
        0 0 0 4px rgba(37, 211, 102, 0.1);
}

.whatsapp-icon {
    position: relative;
    z-index: 2;
    color: white;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.whatsapp-button:hover .whatsapp-icon {
    transform: scale(1.15) rotate(5deg);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

/* Tooltip */
.whatsapp-tooltip {
    position: absolute;
    right: 75px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.whatsapp-tooltip .tooltip-arrow {
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid rgba(0, 0, 0, 0.9);
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
}

.whatsapp-button:hover .whatsapp-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(-5px);
}

/* Pulse Animation */
.whatsapp-pulse {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    background: rgba(37, 211, 102, 0.3);
    animation: pulse 2s infinite;
    pointer-events: none;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* Notification Badge */
.whatsapp-notification {
    position: absolute;
    top: -5px;
    right: -5px;
    background: linear-gradient(135deg, #ff4757 0%, #ff3742 100%);
    color: white;
    border-radius: 12px;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 600;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(255, 71, 87, 0.3);
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: notification-bounce 2s infinite;
}

.whatsapp-notification.show {
    opacity: 1;
    transform: scale(1);
}

@keyframes notification-bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: scale(1);
    }
    40% {
        transform: scale(1.1);
    }
    60% {
        transform: scale(1.05);
    }
}

.whatsapp-notification .notification-text {
    font-size: 9px;
    line-height: 1;
    white-space: nowrap;
}

/* Scroll-based animations */
.whatsapp-float.scroll-hidden {
    transform: translateY(100px);
    opacity: 0;
}

.whatsapp-float.scroll-visible {
    transform: translateY(0);
    opacity: 1;
}

/* Desktop and larger screens */
@media (min-width: 1200px) {
    .whatsapp-scroll-message {
        max-width: 220px;
    }
    
    [dir="rtl"] .whatsapp-scroll-message {
        max-width: 200px;
        left: -140px;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .whatsapp-float {
        bottom: 20px;
        right: 20px;
    }
    
    .whatsapp-button {
        width: 60px;
        height: 60px;
    }
    
    .whatsapp-tooltip {
        right: 70px;
        font-size: 13px;
        padding: 6px 10px;
    }
    
    .whatsapp-scroll-message {
        bottom: 75px;
        padding: 10px 14px;
        font-size: 13px;
        max-width: 160px;
    }
    
    .scroll-message-icon {
        width: 14px;
        height: 14px;
    }
}

@media (max-width: 480px) {
    .whatsapp-float {
        bottom: 15px;
        right: 15px;
    }
    
    .whatsapp-button {
        width: 55px;
        height: 55px;
    }
    
    .whatsapp-icon svg {
        width: 22px;
        height: 22px;
    }
    
    .whatsapp-tooltip {
        display: none;
    }
    
    .whatsapp-scroll-message {
        bottom: 70px;
        padding: 8px 12px;
        font-size: 12px;
        border-radius: 16px;
        max-width: 140px;
    }
    
    .scroll-message-icon {
        width: 12px;
        height: 12px;
    }
    
    .whatsapp-notification {
        top: -3px;
        right: -3px;
        min-width: 18px;
        height: 18px;
        font-size: 8px;
    }
    
    [dir="rtl"] .whatsapp-notification {
        right: auto;
        left: -3px;
    }
    
    [dir="rtl"] .whatsapp-scroll-message {
        max-width: 130px;
        left: -100px;
    }
}

/* RTL Support */
[dir="rtl"] .whatsapp-tooltip {
    right: auto;
    left: 75px;
}

[dir="rtl"] .whatsapp-tooltip .tooltip-arrow {
    right: auto;
    left: -6px;
    border-left: none;
    border-right: 6px solid rgba(0, 0, 0, 0.9);
}

[dir="rtl"] .whatsapp-button:hover .whatsapp-tooltip {
    transform: translateY(-50%) translateX(5px);
}

[dir="rtl"] .whatsapp-notification {
    right: auto;
    left: -5px;
}

[dir="rtl"] .whatsapp-scroll-message {
    right: auto;
    left: -120px;
    max-width: 180px;
    text-align: right;
    white-space: nowrap;
    line-height: 1.3;
}

[dir="rtl"] .scroll-message-arrow {
    right: auto;
    left: 20px;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .whatsapp-tooltip {
        background: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.2);
    }
    
    .whatsapp-tooltip .tooltip-arrow {
        border-left-color: rgba(255, 255, 255, 0.1);
    }
    
    [dir="rtl"] .whatsapp-tooltip .tooltip-arrow {
        border-right-color: rgba(255, 255, 255, 0.1);
    }
}

/* Accessibility */
.whatsapp-button:focus {
    outline: 2px solid #25D366;
    outline-offset: 2px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .whatsapp-button,
    .whatsapp-tooltip,
    .whatsapp-float {
        transition: none;
    }
    
    .whatsapp-pulse {
        animation: none;
    }
    
    .whatsapp-button:hover {
        transform: none;
    }
    
    .whatsapp-button:hover .whatsapp-icon {
        transform: none;
    }
}
