/**
 * WA Widget – Frontend Floating Button Styles
 *
 * Lightweight CSS for the floating WhatsApp button.
 * No dependencies – designed to work with any theme.
 */

/* -------------------------------------------------------------------------
   Button base
   ------------------------------------------------------------------------- */
.wawidget-btn {
    position: fixed;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #25D366;
    border-radius: 50%;
    text-decoration: none;
    cursor: pointer;
    box-shadow:
        0 4px 14px rgba(37, 211, 102, 0.4),
        0 2px 4px rgba(0, 0, 0, 0.08);
    transition:
        transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 0.25s ease;

    /* Entrance animation */
    animation: wawidget-enter 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    animation-delay: 0.8s;
}

.wawidget-btn:hover {
    transform: scale(1.1);
    box-shadow:
        0 8px 24px rgba(37, 211, 102, 0.5),
        0 3px 6px rgba(0, 0, 0, 0.1);
}

.wawidget-btn:active {
    transform: scale(0.96);
}

.wawidget-btn:focus-visible {
    outline: 2px solid #25D366;
    outline-offset: 3px;
}

/* Icon */
.wawidget-btn__icon {
    display: block;
    fill: #fff;
    flex-shrink: 0;
}

/* -------------------------------------------------------------------------
   Sizes
   ------------------------------------------------------------------------- */
.wawidget-btn--small {
    width: 48px;
    height: 48px;
}
.wawidget-btn--small .wawidget-btn__icon {
    width: 26px;
    height: 26px;
}

.wawidget-btn--medium {
    width: 60px;
    height: 60px;
}
.wawidget-btn--medium .wawidget-btn__icon {
    width: 32px;
    height: 32px;
}

.wawidget-btn--large {
    width: 72px;
    height: 72px;
}
.wawidget-btn--large .wawidget-btn__icon {
    width: 40px;
    height: 40px;
}

/* -------------------------------------------------------------------------
   Positions
   ------------------------------------------------------------------------- */
.wawidget-btn--bottom-right {
    bottom: 24px;
    right: 24px;
}

.wawidget-btn--bottom-left {
    bottom: 24px;
    left: 24px;
}

/* -------------------------------------------------------------------------
   Pulse ring (attention grabber — plays once after entrance)
   ------------------------------------------------------------------------- */
.wawidget-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(37, 211, 102, 0.35);
    animation: wawidget-pulse 2s ease-out 2s 3; /* 3 pulses, starts 2s after load */
    pointer-events: none;
    z-index: -1;
}

/* -------------------------------------------------------------------------
   Animations
   ------------------------------------------------------------------------- */
@keyframes wawidget-enter {
    0% {
        opacity: 0;
        transform: scale(0.3) translateY(30px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes wawidget-pulse {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }
    100% {
        transform: scale(1.8);
        opacity: 0;
    }
}

/* -------------------------------------------------------------------------
   Mobile adjustments
   ------------------------------------------------------------------------- */
@media screen and (max-width: 480px) {
    .wawidget-btn--bottom-right {
        bottom: 16px;
        right: 16px;
    }
    .wawidget-btn--bottom-left {
        bottom: 16px;
        left: 16px;
    }

    /* Slightly smaller on very small screens */
    .wawidget-btn--large {
        width: 60px;
        height: 60px;
    }
    .wawidget-btn--large .wawidget-btn__icon {
        width: 32px;
        height: 32px;
    }
}

/* -------------------------------------------------------------------------
   Reduced motion
   ------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .wawidget-btn,
    .wawidget-btn::before {
        animation: none;
    }
    .wawidget-btn:hover {
        transform: none;
    }
}
