/* ==========================================================================
   Call Action Widget - Frontend Styles V2.1.1 (Fix Hover Freeze Bug)
   ========================================================================== */

/* Floating Widget Container */
.caw-floating-widget {
    position: fixed;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    gap: 14px;
    user-select: none;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
    pointer-events: none;
}

.caw-floating-widget * {
    box-sizing: border-box;
}

.caw-buttons-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: center;
}

/* Base Floating Button */
.caw-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    pointer-events: auto;
    border-radius: 50%;
    background-color: var(--caw-bg-color, #0084ff);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
    cursor: pointer;
}

/* Button Sizes */
.caw-size-small .caw-btn {
    width: 44px;
    height: 44px;
}
.caw-size-medium .caw-btn {
    width: 52px;
    height: 52px;
}
.caw-size-large .caw-btn {
    width: 60px;
    height: 60px;
}

.caw-btn:hover {
    transform: scale(1.12);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.35);
    color: #ffffff;
}

/* Icon Box inside Button */
.caw-icon-box {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
}

/* Custom Uploaded Image Icon - AUTO ROUNDED 50% */
.caw-custom-icon-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.caw-svg-icon {
    width: 60%;
    height: 60%;
    fill: currentColor;
    transition: transform 0.2s ease;
}

/* Hotline Phone Shake Animation */
.caw-btn .caw-phone-icon {
    animation: cawShake 2.5s infinite ease-in-out;
}

@keyframes cawShake {
    0%, 100% { transform: rotate(0deg); }
    10%, 30%, 50% { transform: rotate(-15deg); }
    20%, 40% { transform: rotate(15deg); }
    60% { transform: rotate(0deg); }
}

/* ==========================================================================
   Pulse Wave Animation System (Fixed no freeze)
   ========================================================================== */

.caw-pulse-active,
.caw-pulse-on-hover {
    position: relative;
}

.caw-pulse-wave {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: var(--caw-bg-color, #4caf50);
    transform: translate(-50%, -50%) scale(1);
    opacity: 0;
    z-index: 1;
    pointer-events: none;
}

/* 1. Mode ALWAYS ACTIVE */
.caw-pulse-active .caw-pulse-wave {
    animation: cawPulseWave 2s infinite ease-out;
}
.caw-pulse-active .caw-pulse-wave-2 {
    animation-delay: 0.75s;
}

/* 2. Mode HOVER ONLY (Starts animation ONLY on hover, completely resets to opacity: 0 when unhovered) */
.caw-pulse-on-hover .caw-pulse-wave {
    animation: none;
    opacity: 0;
}

.caw-pulse-on-hover:hover .caw-pulse-wave {
    animation: cawPulseWave 1.8s infinite ease-out;
}
.caw-pulse-on-hover:hover .caw-pulse-wave-2 {
    animation-delay: 0.6s;
}

@keyframes cawPulseWave {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.8;
    }
    100% {
        transform: translate(-50%, -50%) scale(2.2);
        opacity: 0;
    }
}

/* Red Notification Badge */
.caw-badge {
    position: absolute;
    top: -2px;
    left: -2px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 10px;
    background-color: #ff2b2b;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 6px rgba(255, 43, 43, 0.5);
    animation: cawBadgePulse 2s infinite;
}

.caw-position-bottom-right .caw-badge {
    left: -2px;
    right: auto;
}
.caw-position-bottom-left .caw-badge {
    right: -2px;
    left: auto;
}

@keyframes cawBadgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* Tooltip Popup Styling */
.caw-tooltip {
    position: absolute;
    top: 50%;
    transform: translateY(-50%) scale(0.9);
    white-space: nowrap;
    background: rgba(18, 24, 38, 0.88);
    backdrop-filter: blur(6px);
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 5;
}

/* Tooltip Position: Right Side (when widget is on Left) */
.caw-position-bottom-left .caw-tooltip {
    left: calc(100% + 12px);
}
.caw-position-bottom-left .caw-tooltip::before {
    content: "";
    position: absolute;
    top: 50%;
    right: 100%;
    transform: translateY(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: transparent rgba(18, 24, 38, 0.88) transparent transparent;
}

/* Tooltip Position: Left Side (when widget is on Right) */
.caw-position-bottom-right .caw-tooltip {
    right: calc(100% + 12px);
}
.caw-position-bottom-right .caw-tooltip::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 100%;
    transform: translateY(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: transparent transparent transparent rgba(18, 24, 38, 0.88);
}

/* Show Tooltip on Hover */
.caw-has-tooltips .caw-btn:hover .caw-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) scale(1);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .caw-floating-widget {
        gap: 10px;
    }
    .caw-tooltip {
        display: none !important;
    }
}
