/* WhatsApp Floating Button Styles */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 2147483000;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 1;
    visibility: visible;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

@supports (bottom: calc(30px + env(safe-area-inset-bottom))) {
    .whatsapp-float {
        bottom: calc(30px + env(safe-area-inset-bottom));
    }
}

.whatsapp-float-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.28);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    border: none;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    pointer-events: auto;
}

.whatsapp-float-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.32);
    background: linear-gradient(135deg, #128c7e 0%, #25d366 100%);
}

.whatsapp-float-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.whatsapp-float-btn:hover::before {
    width: 100%;
    height: 100%;
}

.whatsapp-float-btn i {
    font-size: 30px;
    z-index: 1;
    position: relative;
}

.whatsapp-float-btn::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.95);
    opacity: 0;
    transform: scale(0.94);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

/* Pulse animation */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    60% {
        transform: scale(1.06);
    }
    100% {
        transform: scale(1);
    }
}

.whatsapp-float-btn.pulse {
    animation: pulse 2s infinite;
}

/* Tooltip */
.whatsapp-tooltip {
    position: absolute;
    right: 70px;
    top: 50%;
    transform: translateY(-50%);
    background: white;
    color: #128c7e;
    padding: 10px 15px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 14px;
}

.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-float-btn:hover + .whatsapp-tooltip,
.whatsapp-float-btn:focus + .whatsapp-tooltip {
    opacity: 1;
    visibility: visible;
    right: 80px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .whatsapp-float {
        bottom: 20px;
        right: 20px;
    }

    .whatsapp-float-btn {
        width: 50px;
        height: 50px;
    }

    .whatsapp-float-btn i {
        font-size: 24px;
    }

    .whatsapp-tooltip {
        display: none; /* Hide tooltip on mobile */
    }
}

/* Focus states */
.whatsapp-float-btn:focus,
.whatsapp-float-btn:focus-visible,
.whatsapp-float-btn:focus-within,
.whatsapp-float-btn:active,
.whatsapp-float-btn:target {
    outline: none !important;
    border: none !important;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.28) !important;
}

.whatsapp-float-btn.is-keyboard-focus::after {
    opacity: 1;
    transform: scale(1);
}

/* Remove WebKit/Chrome specific tap highlight */
.whatsapp-float-btn,
.whatsapp-float-btn * {
    -webkit-tap-highlight-color: transparent !important;
    -webkit-touch-callout: none !important;
    -webkit-user-select: none !important;
    user-select: none !important;
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    .whatsapp-tooltip {
        background: #1f2937;
        color: #25d366;
    }

    .whatsapp-tooltip::after {
        border-left-color: #1f2937;
    }
}

@media (max-width: 576px) {
    .whatsapp-float {
        bottom: 80px;
        right: 15px;
    }

    .whatsapp-float-btn {
        width: 52px;
        height: 52px;
        box-shadow: 0 10px 22px rgba(0, 0, 0, 0.26);
    }
}

@media (max-width: 576px) {
    @supports (bottom: calc(80px + env(safe-area-inset-bottom))) {
        .whatsapp-float {
            bottom: calc(80px + env(safe-area-inset-bottom));
        }
    }
}
