/* ===================================================
   WhatsApp Bubble — Frontend Styles
   =================================================== */

/* Base bubble */
.wab-bubble {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.wab-bubble:hover {
    transform: scale(1.08);
}

.wab-bubble.wab-hidden {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

.wab-bubble.wab-visible {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
}

/* Link */
.wab-bubble__link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: #fff;
}

/* Icon */
.wab-bubble__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

.wab-bubble__icon svg {
    display: block;
}

.wab-bubble__icon img {
    display: block;
    object-fit: contain;
}

/* Tooltip — base */
.wab-tooltip {
    position: absolute;
    white-space: nowrap;
    background: #333;
    color: #fff;
    font-size: 13px;
    padding: 6px 12px;
    border-radius: 6px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 1;
    line-height: 1.4;
}

.wab-tooltip::after {
    content: '';
    position: absolute;
    border: 5px solid transparent;
}

.wab-bubble:hover .wab-tooltip {
    opacity: 1;
    transform: translate(0, 0);
}

/* ---- Tooltip: bottom-right (tooltip goes up-left) ---- */
.wab-bubble[data-position="bottom-right"] .wab-tooltip {
    bottom: calc(100% + 8px);
    right: 0;
    transform: translateY(4px);
}
.wab-bubble[data-position="bottom-right"] .wab-tooltip::after {
    top: 100%;
    right: 16px;
    border-top-color: #333;
}

/* ---- Tooltip: bottom-left (tooltip goes up-right) ---- */
.wab-bubble[data-position="bottom-left"] .wab-tooltip {
    bottom: calc(100% + 8px);
    left: 0;
    transform: translateY(4px);
}
.wab-bubble[data-position="bottom-left"] .wab-tooltip::after {
    top: 100%;
    left: 16px;
    border-top-color: #333;
}

/* ---- Tooltip: top-right (tooltip goes down-left) ---- */
.wab-bubble[data-position="top-right"] .wab-tooltip {
    top: calc(100% + 8px);
    right: 0;
    transform: translateY(-4px);
}
.wab-bubble[data-position="top-right"] .wab-tooltip::after {
    bottom: 100%;
    right: 16px;
    border-bottom-color: #333;
}

/* ---- Tooltip: top-left (tooltip goes down-right) ---- */
.wab-bubble[data-position="top-left"] .wab-tooltip {
    top: calc(100% + 8px);
    left: 0;
    transform: translateY(-4px);
}
.wab-bubble[data-position="top-left"] .wab-tooltip::after {
    bottom: 100%;
    left: 16px;
    border-bottom-color: #333;
}

/* Schedule off-message tooltip override */
.wab-bubble[data-schedule="off"] .wab-tooltip {
    background: #f44336;
}
.wab-bubble[data-schedule="off"][data-position="bottom-right"] .wab-tooltip::after,
.wab-bubble[data-schedule="off"][data-position="bottom-left"] .wab-tooltip::after {
    border-top-color: #f44336;
}
.wab-bubble[data-schedule="off"][data-position="top-right"] .wab-tooltip::after,
.wab-bubble[data-schedule="off"][data-position="top-left"] .wab-tooltip::after {
    border-bottom-color: #f44336;
}

/* ===================================================
   Animations
   =================================================== */

/* Bounce */
.wab-animate-bounce {
    animation: wab-bounce 0.6s ease both;
}

@keyframes wab-bounce {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.1);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Fade In */
.wab-animate-fade-in {
    animation: wab-fadeIn 0.5s ease both;
}

@keyframes wab-fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Slide In */
.wab-animate-slide-in {
    animation: wab-slideIn 0.5s ease both;
}

@keyframes wab-slideIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* None */
.wab-animate-none {
    animation: none;
}

/* Hidden state — overrides animation until triggered */
.wab-bubble.wab-hidden {
    animation: none !important;
}

/* Pulse subtle animation on idle */
.wab-bubble:not(:hover)::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: inherit;
    background: inherit;
    opacity: 0;
    animation: wab-pulse 2.5s ease-in-out infinite;
    z-index: -1;
}

@keyframes wab-pulse {
    0%, 100% {
        opacity: 0;
        transform: scale(1);
    }
    50% {
        opacity: 0.2;
        transform: scale(1.15);
    }
}
