/* WhatsApp Button — Frontend Styles */

#wab-btn-wrap {
    position: fixed;
    z-index: 9999;
    transition: opacity .3s, transform .3s;
}

/* Position variants */
#wab-btn-wrap.pos-bottom-right { bottom: 24px; right: 24px; }
#wab-btn-wrap.pos-bottom-left  { bottom: 24px; left:  24px; }
#wab-btn-wrap.pos-top-right    { top:    80px; right: 24px; }
#wab-btn-wrap.pos-top-left     { top:    80px; left:  24px; }

/* The circle button */
#wab-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #25D366;
    cursor: pointer;
    text-decoration: none;
    position: relative;
    box-shadow: 0 4px 20px rgba(37, 211, 102, .45);
    transition: transform .2s ease, box-shadow .2s ease;
    outline: none;
}

#wab-btn:hover,
#wab-btn:focus {
    transform: scale(1.1);
    box-shadow: 0 6px 28px rgba(37, 211, 102, .6);
}

#wab-btn:active {
    transform: scale(0.95);
}

#wab-btn svg {
    fill: #ffffff;
    display: block;
    /* size injected via JS */
}

/* Pulse ring */
#wab-btn.wab-pulse::before {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 3px solid rgba(37, 211, 102, 0.4);
    animation: wabRing 2s ease-out infinite;
    pointer-events: none;
}

@keyframes wabRing {
    0%   { transform: scale(1);    opacity: .8; }
    70%  { transform: scale(1.25); opacity: 0; }
    100% { transform: scale(1.25); opacity: 0; }
}

/* Tooltip */
#wab-tooltip {
    position: absolute;
    background: #fff;
    color: #1a1a2e;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    padding: 8px 14px;
    border-radius: 10px;
    white-space: nowrap;
    box-shadow: 0 4px 20px rgba(0,0,0,.15);
    pointer-events: none;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity .2s ease, transform .2s ease;

    /* Arrow placeholder — set per position via JS class */
}
#wab-tooltip::after {
    content: '';
    position: absolute;
    border: 7px solid transparent;
}

/* Arrow for bottom positions (tooltip above button) */
#wab-btn-wrap.pos-bottom-right #wab-tooltip,
#wab-btn-wrap.pos-bottom-left  #wab-tooltip {
    bottom: calc(100% + 12px);
}
#wab-btn-wrap.pos-bottom-right #wab-tooltip {
    right: 0;
}
#wab-btn-wrap.pos-bottom-left  #wab-tooltip {
    left: 0;
}
#wab-btn-wrap.pos-bottom-right #wab-tooltip::after,
#wab-btn-wrap.pos-bottom-left  #wab-tooltip::after {
    top: 100%;
    border-top-color: #fff;
    border-bottom-width: 0;
}
#wab-btn-wrap.pos-bottom-right #wab-tooltip::after { right: 18px; }
#wab-btn-wrap.pos-bottom-left  #wab-tooltip::after { left:  18px; }

/* Arrow for top positions (tooltip below button) */
#wab-btn-wrap.pos-top-right #wab-tooltip,
#wab-btn-wrap.pos-top-left  #wab-tooltip {
    top: calc(100% + 12px);
}
#wab-btn-wrap.pos-top-right #wab-tooltip { right: 0; }
#wab-btn-wrap.pos-top-left  #wab-tooltip { left:  0; }
#wab-btn-wrap.pos-top-right #wab-tooltip::after,
#wab-btn-wrap.pos-top-left  #wab-tooltip::after {
    bottom: 100%;
    border-bottom-color: #fff;
    border-top-width: 0;
}
#wab-btn-wrap.pos-top-right #wab-tooltip::after { right: 18px; }
#wab-btn-wrap.pos-top-left  #wab-tooltip::after { left:  18px; }

/* Show tooltip on hover */
#wab-btn:hover ~ #wab-tooltip,
#wab-btn:focus ~ #wab-tooltip,
#wab-btn-wrap:hover #wab-tooltip {
    opacity: 1;
    transform: translateY(0);
}

/* Entrance animation */
#wab-btn-wrap {
    animation: wabEntrance .5s cubic-bezier(.34,1.56,.64,1) both;
    animation-delay: .8s;
    opacity: 0;
}
@keyframes wabEntrance {
    from { opacity: 0; transform: scale(0.5); }
    to   { opacity: 1; transform: scale(1); }
}

/* Mobile adjustments */
@media (max-width: 600px) {
    #wab-btn-wrap.pos-bottom-right { bottom: 16px; right: 16px; }
    #wab-btn-wrap.pos-bottom-left  { bottom: 16px; left:  16px; }
    #wab-btn-wrap.pos-top-right    { top:    70px; right: 16px; }
    #wab-btn-wrap.pos-top-left     { top:    70px; left:  16px; }
}

/* Respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
    #wab-btn.wab-pulse::before { animation: none; }
    #wab-btn-wrap { animation: none; opacity: 1; }
}

/* ── Notification badge (red dot) ── */
#wab-badge {
    position: absolute;
    top:   3px;
    right: 3px;
    width:  12px;
    height: 12px;
    background: #e53935;
    border-radius: 50%;
    border: 2.5px solid #ffffff;
    box-shadow: 0 1px 5px rgba(229, 57, 53, .55);
    pointer-events: none;
    animation: wabBadgeIn .4s cubic-bezier(.34,1.56,.64,1) both;
    animation-delay: 1.4s; /* appears after button entrance */
    opacity: 0;
}

@keyframes wabBadgeIn {
    from { transform: scale(0); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

/* Subtle pulse on the badge itself */
#wab-badge::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: rgba(229, 57, 53, .35);
    animation: wabBadgeRing 2.5s ease-out infinite;
    animation-delay: 2s;
}

@keyframes wabBadgeRing {
    0%   { transform: scale(1);   opacity: .7; }
    70%  { transform: scale(2);   opacity: 0; }
    100% { transform: scale(2);   opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    #wab-badge, #wab-badge::after { animation: none; opacity: 1; }
}
