/* ══════════════════════════════════════════
   WhatsApp Float Widget Pro — Frontend CSS
   ══════════════════════════════════════════ */

/* ── Root & Reset ── */
#wfw-widget {
    --wfw-btn-color: #25D366;
    --wfw-pulse-color: #25D366;
    --wfw-size: 60px;
    --wfw-shadow: 0 6px 28px rgba(37, 211, 102, 0.45);
    --wfw-radius: 50%;
    position: fixed;
    bottom: 28px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

#wfw-widget.wfw-right { right: 28px; }
#wfw-widget.wfw-left  { left: 28px; align-items: flex-start; }

/* ── Mobile Only ── */
#wfw-widget.wfw-mobile-only { display: none; }
@media (max-width: 768px) {
    #wfw-widget.wfw-mobile-only { display: flex; }
}

/* ── Hidden state ── */
#wfw-widget.wfw-hidden {
    transform: scale(0) translateY(40px);
    opacity: 0;
    pointer-events: none;
}

/* ── The Button ── */
.wfw-btn {
    position: relative;
    width: var(--wfw-size);
    height: var(--wfw-size);
    border-radius: var(--wfw-radius);
    background: var(--wfw-btn-color);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: var(--wfw-shadow);
    transition: transform 0.25s cubic-bezier(.34,1.56,.64,1), box-shadow 0.25s ease;
    cursor: pointer;
    outline: none;
}

.wfw-btn:hover {
    transform: scale(1.14) rotate(-4deg);
    box-shadow: 0 10px 36px rgba(37, 211, 102, 0.55);
}

.wfw-btn:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 3px;
}

.wfw-btn:active {
    transform: scale(0.94);
}

/* ── WhatsApp Icon ── */
.wfw-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 58%;
    height: 58%;
    position: relative;
    z-index: 2;
    transition: transform 0.3s cubic-bezier(.34,1.56,.64,1);
}

.wfw-btn:hover .wfw-icon {
    transform: scale(1.1) rotate(8deg);
}

.wfw-icon svg {
    width: 100%;
    height: 100%;
    fill: #ffffff;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

/* ── Pulse Rings ── */
.wfw-pulse,
.wfw-pulse-2 {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: var(--wfw-pulse-color);
    opacity: 0;
    animation: wfw-pulse-ring 2.8s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
    pointer-events: none;
}

.wfw-pulse-2 {
    animation-delay: 0.9s;
}

@keyframes wfw-pulse-ring {
    0%   { transform: scale(1);   opacity: 0.6; }
    80%  { transform: scale(2.2); opacity: 0; }
    100% { transform: scale(2.2); opacity: 0; }
}

/* ── Badge ── */
.wfw-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 22px;
    height: 22px;
    background: #ff3b30;
    color: #fff;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    border: 2.5px solid #fff;
    z-index: 3;
    animation: wfw-badge-pop 0.5s cubic-bezier(.34,1.56,.64,1) both;
    box-shadow: 0 2px 8px rgba(255,59,48,0.5);
}

@keyframes wfw-badge-pop {
    from { transform: scale(0) rotate(-30deg); }
    to   { transform: scale(1) rotate(0); }
}

/* ── Tooltip ── */
.wfw-tooltip {
    background: #1a1a1a;
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 13px;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: 20px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transform: translateX(8px) scale(0.9);
    transform-origin: right center;
    transition: opacity 0.2s ease, transform 0.25s cubic-bezier(.34,1.56,.64,1);
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    position: absolute;
    right: calc(var(--wfw-size) + 14px);
    bottom: 50%;
    transform: translateY(50%) translateX(8px) scale(0.9);
}

.wfw-tooltip::after {
    content: '';
    position: absolute;
    right: -7px;
    top: 50%;
    transform: translateY(-50%);
    border: 7px solid transparent;
    border-left-color: #1a1a1a;
    border-right: 0;
}

.wfw-left .wfw-tooltip {
    right: auto;
    left: calc(var(--wfw-size) + 14px);
    transform: translateY(50%) translateX(-8px) scale(0.9);
    transform-origin: left center;
}

.wfw-left .wfw-tooltip::after {
    right: auto;
    left: -7px;
    border-left-color: transparent;
    border-right-color: #1a1a1a;
    border-right-width: 7px;
    border-left-width: 0;
}

#wfw-widget:hover .wfw-tooltip {
    opacity: 1;
    transform: translateY(50%) translateX(0) scale(1);
}

.wfw-left:hover .wfw-tooltip {
    transform: translateY(50%) translateX(0) scale(1);
}

/* ════════════════════════════
   ENTRY ANIMATIONS
════════════════════════════ */

/* Bounce */
.wfw-anim-bounce .wfw-btn {
    animation: wfw-entry-bounce 0.8s cubic-bezier(.34,1.56,.64,1) 0.4s both;
}
@keyframes wfw-entry-bounce {
    0%   { transform: scale(0) translateY(60px); opacity: 0; }
    60%  { transform: scale(1.12) translateY(-10px); opacity: 1; }
    80%  { transform: scale(0.95) translateY(4px); }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

/* Slide */
.wfw-anim-slide.wfw-right .wfw-btn {
    animation: wfw-entry-slide-right 0.6s cubic-bezier(.25,.46,.45,.94) 0.4s both;
}
.wfw-anim-slide.wfw-left .wfw-btn {
    animation: wfw-entry-slide-left 0.6s cubic-bezier(.25,.46,.45,.94) 0.4s both;
}
@keyframes wfw-entry-slide-right {
    from { transform: translateX(120px); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}
@keyframes wfw-entry-slide-left {
    from { transform: translateX(-120px); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}

/* Zoom */
.wfw-anim-zoom .wfw-btn {
    animation: wfw-entry-zoom 0.5s cubic-bezier(.34,1.56,.64,1) 0.4s both;
}
@keyframes wfw-entry-zoom {
    from { transform: scale(0); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

/* Flip */
.wfw-anim-flip .wfw-btn {
    animation: wfw-entry-flip 0.7s cubic-bezier(.25,.46,.45,.94) 0.4s both;
}
@keyframes wfw-entry-flip {
    0%   { transform: perspective(400px) rotateY(90deg) scale(0.5); opacity: 0; }
    50%  { transform: perspective(400px) rotateY(-20deg) scale(1.05); }
    100% { transform: perspective(400px) rotateY(0) scale(1); opacity: 1; }
}

/* Rubber Band */
.wfw-anim-rubberband .wfw-btn {
    animation: wfw-entry-rubber 0.9s ease 0.4s both;
}
@keyframes wfw-entry-rubber {
    0%   { transform: scale(0); opacity: 0; }
    30%  { transform: scaleX(1.25) scaleY(0.75); opacity: 1; }
    40%  { transform: scaleX(0.75) scaleY(1.25); }
    50%  { transform: scaleX(1.15) scaleY(0.85); }
    65%  { transform: scaleX(0.95) scaleY(1.05); }
    75%  { transform: scaleX(1.05) scaleY(0.95); }
    100% { transform: scale(1); }
}

/* ── Smooth transition for hide-on-scroll ── */
#wfw-widget {
    transition: transform 0.35s cubic-bezier(.34,1.56,.64,1), opacity 0.35s ease;
}

#wfw-widget.wfw-scrolling {
    transform: scale(0.7) translateY(20px);
    opacity: 0;
    pointer-events: none;
}

/* ── Shortcode Button ── */
.wfw-shortcode-btn {
    display: inline-flex;
    align-items: center;
    padding: 12px 24px;
    border-radius: 50px;
    color: #fff !important;
    text-decoration: none !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 15px;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(37, 211, 102, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.wfw-shortcode-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.5);
    color: #fff !important;
}

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
    .wfw-btn, .wfw-pulse, .wfw-pulse-2,
    .wfw-badge, .wfw-tooltip, #wfw-widget {
        animation: none !important;
        transition: none !important;
    }
}
