/* WhatsApp Floating Button - Frontend Styles */

/* Button Container */
.wafb-container {
    position: fixed;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.wafb-container.position-right {
    right: 30px;
}

.wafb-container.position-left {
    left: 30px;
}

/* Main Button */
.wafb-button {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: #25D366;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.wafb-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.wafb-button:active {
    transform: scale(0.95);
}

/* Button Styles */
.wafb-button.style-circle {
    border-radius: 50%;
}

.wafb-button.style-rounded {
    border-radius: 16px;
}

.wafb-button.style-square {
    border-radius: 4px;
}

/* WhatsApp Icon */
.wafb-icon {
    width: 32px;
    height: 32px;
    fill: currentColor;
    color: #ffffff;
}

/* Tooltip */
.wafb-tooltip {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    padding: 10px 16px;
    background: #333333;
    color: #ffffff;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    border-radius: 8px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.wafb-tooltip::after {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
}

/* Tooltip Position - Right */
.wafb-container.position-right .wafb-tooltip {
    right: calc(100% + 12px);
}

.wafb-container.position-right .wafb-tooltip::after {
    left: 100%;
    border-left-color: #333333;
}

/* Tooltip Position - Left */
.wafb-container.position-left .wafb-tooltip {
    left: calc(100% + 12px);
}

.wafb-container.position-left .wafb-tooltip::after {
    right: 100%;
    border-right-color: #333333;
}

/* Tooltip Show on Hover */
.wafb-button:hover .wafb-tooltip {
    opacity: 1;
    visibility: visible;
}

/* Badge */
.wafb-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: #ff0000;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Animations */
@keyframes wafb-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    }
}

@keyframes wafb-bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-12px);
    }
    60% {
        transform: translateY(-6px);
    }
}

@keyframes wafb-shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-4px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(4px);
    }
}

@keyframes wafb-swing {
    0%, 100% {
        transform: rotate(0deg);
    }
    20% {
        transform: rotate(12deg);
    }
    40% {
        transform: rotate(-8deg);
    }
    60% {
        transform: rotate(4deg);
    }
    80% {
        transform: rotate(-4deg);
    }
}

@keyframes wafb-tada {
    0%, 100% {
        transform: scale(1) rotate(0deg);
    }
    10%, 20% {
        transform: scale(0.9) rotate(-3deg);
    }
    30%, 50%, 70%, 90% {
        transform: scale(1.1) rotate(3deg);
    }
    40%, 60%, 80% {
        transform: scale(1.1) rotate(-3deg);
    }
}

@keyframes wafb-heartbeat {
    0%, 100% {
        transform: scale(1);
    }
    14% {
        transform: scale(1.15);
    }
    28% {
        transform: scale(1);
    }
    42% {
        transform: scale(1.15);
    }
    70% {
        transform: scale(1);
    }
}

@keyframes wafb-flash {
    0%, 50%, 100% {
        opacity: 1;
    }
    25%, 75% {
        opacity: 0.4;
    }
}

/* Animation Classes */
.wafb-button.anim-pulse {
    animation: wafb-pulse 2s ease-in-out infinite;
}

.wafb-button.anim-bounce {
    animation: wafb-bounce 2s ease infinite;
}

.wafb-button.anim-shake {
    animation: wafb-shake 3s ease infinite;
}

.wafb-button.anim-swing {
    animation: wafb-swing 2s ease infinite;
}

.wafb-button.anim-tada {
    animation: wafb-tada 2s ease infinite;
}

.wafb-button.anim-heartbeat {
    animation: wafb-heartbeat 2s ease infinite;
}

.wafb-button.anim-flash {
    animation: wafb-flash 2s linear infinite;
}

/* Pause animation on hover */
.wafb-button:hover {
    animation-play-state: paused;
}

/* Fade In Animation */
@keyframes wafb-fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wafb-container.wafb-visible {
    animation: wafb-fadeIn 0.5s ease forwards;
}

.wafb-container.wafb-hidden {
    opacity: 0;
    pointer-events: none;
}

/* Offline State */
.wafb-button.wafb-offline {
    filter: grayscale(50%);
    opacity: 0.7;
}

.wafb-button.wafb-offline:hover {
    transform: scale(1);
}

/* Ripple Effect */
.wafb-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.3);
    border-radius: inherit;
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    transition: transform 0.5s, opacity 0.5s;
}

.wafb-button:active::before {
    transform: translate(-50%, -50%) scale(2);
    opacity: 0;
    transition: transform 0s, opacity 0s;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .wafb-container.position-right {
        right: 20px;
    }
    
    .wafb-container.position-left {
        left: 20px;
    }
    
    .wafb-button {
        width: 55px;
        height: 55px;
    }
    
    .wafb-icon {
        width: 28px;
        height: 28px;
    }
    
    .wafb-tooltip {
        font-size: 12px;
        padding: 8px 12px;
    }
}

/* Print - Hide button */
@media print {
    .wafb-container {
        display: none !important;
    }
}

/* Accessibility */
.wafb-button:focus {
    outline: 3px solid rgba(37, 211, 102, 0.5);
    outline-offset: 3px;
}

.wafb-button:focus:not(:focus-visible) {
    outline: none;
}

/* Screen Reader Text */
.wafb-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
