/* WhatsApp Floating Button Styles */
#wfb-container {
    position: fixed;
    z-index: 9999;
    transition: all 0.3s ease;
}

/* Desktop Positioning */
@media (min-width: 769px) {
    #wfb-container.wfb-desktop-bottom-right {
        bottom: var(--wfb-desktop-margin-bottom, 20px);
        right: var(--wfb-desktop-margin-side, 20px);
    }
    
    #wfb-container.wfb-desktop-bottom-left {
        bottom: var(--wfb-desktop-margin-bottom, 20px);
        left: var(--wfb-desktop-margin-side, 20px);
    }
    
    #wfb-container.wfb-desktop-top-right {
        top: var(--wfb-desktop-margin-bottom, 20px);
        right: var(--wfb-desktop-margin-side, 20px);
    }
    
    #wfb-container.wfb-desktop-top-left {
        top: var(--wfb-desktop-margin-bottom, 20px);
        left: var(--wfb-desktop-margin-side, 20px);
    }
    
    .wfb-button {
        width: var(--wfb-desktop-size, 60px);
        height: var(--wfb-desktop-size, 60px);
    }
    
    .wfb-icon {
        width: calc(var(--wfb-desktop-size, 60px) * 0.5);
        height: calc(var(--wfb-desktop-size, 60px) * 0.5);
    }
    
    #wfb-container.wfb-hide-desktop {
        display: none !important;
    }
}

/* Mobile Positioning */
@media (max-width: 768px) {
    #wfb-container.wfb-mobile-bottom-right {
        bottom: var(--wfb-mobile-margin-bottom, 15px);
        right: var(--wfb-mobile-margin-side, 15px);
    }
    
    #wfb-container.wfb-mobile-bottom-left {
        bottom: var(--wfb-mobile-margin-bottom, 15px);
        left: var(--wfb-mobile-margin-side, 15px);
    }
    
    #wfb-container.wfb-mobile-top-right {
        top: var(--wfb-mobile-margin-bottom, 15px);
        right: var(--wfb-mobile-margin-side, 15px);
    }
    
    #wfb-container.wfb-mobile-top-left {
        top: var(--wfb-mobile-margin-bottom, 15px);
        left: var(--wfb-mobile-margin-side, 15px);
    }
    
    .wfb-button {
        width: var(--wfb-mobile-size, 50px);
        height: var(--wfb-mobile-size, 50px);
    }
    
    .wfb-icon {
        width: calc(var(--wfb-mobile-size, 50px) * 0.5);
        height: calc(var(--wfb-mobile-size, 50px) * 0.5);
    }
    
    #wfb-container.wfb-hide-mobile {
        display: none !important;
    }
}

.wfb-button {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--wfb-bg-color, #25D366);
    border-radius: 50%;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    position: relative;
    border: none;
    outline: none;
}

/* Glow effect */
.wfb-button.wfb-glow-enabled {
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.3),
        0 0 20px rgba(37, 211, 102, 0.4),
        0 0 40px rgba(37, 211, 102, 0.2);
}

.wfb-button.wfb-glow-enabled:before {
    content: "";
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, 
        rgba(37, 211, 102, 0.6), 
        rgba(18, 140, 126, 0.6), 
        rgba(37, 211, 102, 0.6));
    border-radius: 50%;
    z-index: -1;
    animation: wfb-glow-rotate 3s linear infinite;
    opacity: 0.7;
}

@keyframes wfb-glow-rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.wfb-button:hover {
    background: var(--wfb-hover-color, #128C7E);
    transform: scale(1.1);
    text-decoration: none;
}

.wfb-button.wfb-glow-enabled:hover {
    box-shadow: 
        0 6px 20px rgba(0, 0, 0, 0.4),
        0 0 30px rgba(37, 211, 102, 0.6),
        0 0 60px rgba(37, 211, 102, 0.3);
    transform: scale(1.15);
}

.wfb-icon {
    color: #ffffff;
    transition: color 0.3s ease;
}

.wfb-custom-icon {
    width: calc(var(--wfb-size, 60px) * 0.6);
    height: calc(var(--wfb-size, 60px) * 0.6);
    object-fit: contain;
}

.wfb-tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    white-space: nowrap;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    font-weight: 500;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    z-index: 10000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    letter-spacing: 0.3px;
    max-width: 200px;
    text-align: center;
    line-height: 1.4;
}

/* Right positioned buttons - tooltip on left */
#wfb-container.wfb-desktop-bottom-right .wfb-tooltip,
#wfb-container.wfb-desktop-top-right .wfb-tooltip,
#wfb-container.wfb-mobile-bottom-right .wfb-tooltip,
#wfb-container.wfb-mobile-top-right .wfb-tooltip {
    right: calc(100% + 15px);
    top: 50%;
    transform: translateY(-50%);
}

#wfb-container.wfb-desktop-bottom-right .wfb-tooltip:after,
#wfb-container.wfb-desktop-top-right .wfb-tooltip:after,
#wfb-container.wfb-mobile-bottom-right .wfb-tooltip:after,
#wfb-container.wfb-mobile-top-right .wfb-tooltip:after {
    content: "";
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-left-color: rgba(0, 0, 0, 0.9);
}

#wfb-container.wfb-desktop-bottom-right .wfb-button:hover + .wfb-tooltip,
#wfb-container.wfb-desktop-top-right .wfb-button:hover + .wfb-tooltip,
#wfb-container.wfb-mobile-bottom-right .wfb-button:hover + .wfb-tooltip,
#wfb-container.wfb-mobile-top-right .wfb-button:hover + .wfb-tooltip {
    opacity: 1;
    transform: translateY(-50%) translateX(-8px);
}

/* Left positioned buttons - tooltip on right */
#wfb-container.wfb-desktop-bottom-left .wfb-tooltip,
#wfb-container.wfb-desktop-top-left .wfb-tooltip,
#wfb-container.wfb-mobile-bottom-left .wfb-tooltip,
#wfb-container.wfb-mobile-top-left .wfb-tooltip {
    left: calc(100% + 15px);
    top: 50%;
    transform: translateY(-50%);
}

#wfb-container.wfb-desktop-bottom-left .wfb-tooltip:after,
#wfb-container.wfb-desktop-top-left .wfb-tooltip:after,
#wfb-container.wfb-mobile-bottom-left .wfb-tooltip:after,
#wfb-container.wfb-mobile-top-left .wfb-tooltip:after {
    content: "";
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-right-color: rgba(0, 0, 0, 0.9);
}

#wfb-container.wfb-desktop-bottom-left .wfb-button:hover + .wfb-tooltip,
#wfb-container.wfb-desktop-top-left .wfb-button:hover + .wfb-tooltip,
#wfb-container.wfb-mobile-bottom-left .wfb-button:hover + .wfb-tooltip,
#wfb-container.wfb-mobile-top-left .wfb-button:hover + .wfb-tooltip {
    opacity: 1;
    transform: translateY(-50%) translateX(8px);
}

/* Responsive tooltip adjustments */
@media (max-width: 768px) {
    .wfb-tooltip {
        font-size: 11px;
        padding: 6px 10px;
        max-width: 100px;
        border-radius: 6px;
    }
    
    /* Mobile - smaller arrows */
    #wfb-container .wfb-tooltip:after {
        border-width: 5px !important;
    }
    
    /* Mobile specific positioning to prevent tooltip from appearing above button */
    #wfb-container.wfb-mobile-bottom-right .wfb-tooltip,
    #wfb-container.wfb-mobile-bottom-left .wfb-tooltip {
        top: 50% !important;
        bottom: auto !important;
        transform: translateY(-50%) !important;
    }
    
    #wfb-container.wfb-mobile-top-right .wfb-tooltip,
    #wfb-container.wfb-mobile-top-left .wfb-tooltip {
        top: 50% !important;
        bottom: auto !important;
        transform: translateY(-50%) !important;
    }
    
    /* Ensure arrows are properly positioned on mobile */
    #wfb-container.wfb-mobile-bottom-right .wfb-tooltip:after,
    #wfb-container.wfb-mobile-top-right .wfb-tooltip:after {
        top: 50% !important;
        bottom: auto !important;
        transform: translateY(-50%) !important;
    }
    
    #wfb-container.wfb-mobile-bottom-left .wfb-tooltip:after,
    #wfb-container.wfb-mobile-top-left .wfb-tooltip:after {
        top: 50% !important;
        bottom: auto !important;
        transform: translateY(-50%) !important;
    }
    
    /* Mobile hover states with proper positioning */
    #wfb-container.wfb-mobile-bottom-right .wfb-button:hover + .wfb-tooltip,
    #wfb-container.wfb-mobile-top-right .wfb-button:hover + .wfb-tooltip {
        opacity: 1;
        transform: translateY(-50%) translateX(-8px) !important;
    }
    
    #wfb-container.wfb-mobile-bottom-left .wfb-button:hover + .wfb-tooltip,
    #wfb-container.wfb-mobile-top-left .wfb-button:hover + .wfb-tooltip {
        opacity: 1;
        transform: translateY(-50%) translateX(8px) !important;
    }
}

/* Animations */
.wfb-animation-pulse .wfb-button {
    animation: wfb-pulse 2s infinite;
}

.wfb-animation-bounce .wfb-button {
    animation: wfb-bounce 2s infinite;
}

.wfb-animation-shake .wfb-button {
    animation: wfb-shake 0.5s infinite;
}

.wfb-animation-glow .wfb-button {
    animation: wfb-glow 2s infinite alternate;
}

@keyframes wfb-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes wfb-bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

@keyframes wfb-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-2px); }
    75% { transform: translateX(2px); }
}

@keyframes wfb-glow {
    0% { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); }
    100% { box-shadow: 0 4px 20px rgba(37, 211, 102, 0.6); }
}

/* Responsive */
@media (max-width: 768px) {
    #wfb-container {
        --wfb-size: 50px;
    }
    
    #wfb-container.wfb-bottom-right,
    #wfb-container.wfb-bottom-left {
        bottom: 15px;
    }
    
    #wfb-container.wfb-bottom-right,
    #wfb-container.wfb-top-right {
        right: 15px;
    }
    
    #wfb-container.wfb-bottom-left,
    #wfb-container.wfb-top-left {
        left: 15px;
    }
    
    #wfb-container.wfb-top-right,
    #wfb-container.wfb-top-left {
        top: 15px;
    }
    
    .wfb-tooltip {
        font-size: 11px;
        padding: 6px 10px;
    }
}
