/* ==========================================================================
   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); }
}

/* Base Floating Button Link Structure */
.caw-btn-item {
    display: block !important;
    pointer-events: auto !important;
    margin: 0 !important;
    padding: 0 !important;
}

.caw-btn-link {
    display: inline-flex !important;
    align-items: center !important;
    text-decoration: none !important;
    outline: none !important;
    margin: 0 !important;
    padding: 0 !important;
    white-space: nowrap !important;
    background: transparent !important;
    border: none !important;
    cursor: pointer !important;
}

.caw-position-bottom-right .caw-btn-link {
    flex-direction: row-reverse !important;
    gap: 8px !important;
}

.caw-position-bottom-left .caw-btn-link {
    flex-direction: row !important;
    gap: 8px !important;
}

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

.caw-size-small .caw-btn, .caw-size-small .caw-btn-icon { width: 44px !important; height: 44px !important; }
.caw-size-medium .caw-btn, .caw-size-medium .caw-btn-icon { width: 52px !important; height: 52px !important; }
.caw-size-large .caw-btn, .caw-size-large .caw-btn-icon { width: 60px !important; height: 60px !important; }

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

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

.caw-position-bottom-left .caw-tooltip { left: calc(100% + 12px) !important; }
.caw-position-bottom-right .caw-tooltip { right: calc(100% + 12px) !important; }

.caw-has-tooltips .caw-btn-link:hover .caw-tooltip,
.caw-has-tooltips .caw-btn:hover .caw-tooltip {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(-50%) scale(1) !important;
}

/* Speech Bubble Tail for Floating Buttons */
.caw-btn-icon::before,
.caw-btn::before {
    content: "" !important;
    position: absolute !important;
    bottom: -1px !important;
    left: 2px !important;
    width: 0 !important;
    height: 0 !important;
    border-style: solid !important;
    border-width: 10px 0 0 10px !important;
    border-color: var(--caw-bg-color, #0084ff) transparent transparent transparent !important;
    transform: rotate(-18deg) !important;
    z-index: 1 !important;
    pointer-events: none !important;
}

/* ==========================================================================
   Expanded Pill Label Bar System (Strict Horizontal Alignment & Theme Protection)
   ========================================================================== */

.caw-buttons-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
}

.caw-position-bottom-right .caw-buttons-list {
    align-items: flex-end !important;
}

.caw-position-bottom-left .caw-buttons-list {
    align-items: flex-start !important;
}

/* Red Pill Label Span - EXACT MATCH TO USER'S THEME CODE */
.caw-pill-label {
    display: inline-block !important;
    background-color: var(--caw-pill-bg, #f62d3e) !important;
    color: #ffffff !important;
    border: 1px solid #ffffff !important;
    border-radius: 20px !important;
    padding: 5px 12px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    letter-spacing: 0.3px !important;
    box-shadow: 0 4px 12px rgba(246, 45, 62, 0.4) !important;
    white-space: nowrap !important;
    text-transform: none !important;
    transition: transform 0.25s ease, box-shadow 0.25s ease !important;
    margin: 0 !important;
}

.caw-btn-link:hover .caw-pill-label {
    transform: scale(1.05) !important;
    box-shadow: 0 6px 18px rgba(246, 45, 62, 0.6) !important;
    color: #ffffff !important;
}

/* Size Adjustments for Pill Label */
.caw-size-small .caw-pill-label {
    font-size: 12px !important;
    padding: 4px 10px !important;
}
.caw-size-medium .caw-pill-label {
    font-size: 14px !important;
    padding: 5px 12px !important;
}
.caw-size-large .caw-pill-label {
    font-size: 16px !important;
    padding: 7px 16px !important;
}


