/* ============================================
   RAKSHA WHATSAPP — Frontend CSS
   ============================================ */

#rwa-btn {
    position: fixed !important;
    z-index: 999999 !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: var(--rwa-size, 60px);
    height: var(--rwa-size, 60px);
    border-radius: var(--rwa-radius, 30px);
    background: var(--rwa-bg, #25D366);
    color: var(--rwa-color, #fff);
    text-decoration: none;
    box-shadow: 0 6px 24px rgba(37,211,102,0.45);
    transition: transform 0.25s cubic-bezier(.4,0,.2,1), box-shadow 0.25s;
    outline-offset: 4px;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
    overflow: visible;
}

#rwa-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 10px 36px rgba(37,211,102,0.6);
}

#rwa-btn:focus-visible {
    outline: 3px solid var(--rwa-bg, #25D366);
}

/* Icon SVG */
.rwa-icon-svg {
    width: 60% !important;
    height: 60% !important;
    flex-shrink: 0 !important;
    display: block !important;
}

/* Custom icon img */
.rwa-icon-img {
    width: 65% !important;
    height: 65% !important;
    max-width: 65% !important;
    max-height: 65% !important;
    object-fit: contain !important;
    border-radius: 4px !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Tooltip */
.rwa-tooltip {
    position: absolute;
    right: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%);
    white-space: nowrap;
    background: #1a1a2e;
    color: #fff;
    font-size: 0.78rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 8px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}

.rwa-tooltip::after {
    content: '';
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-left-color: #1a1a2e;
}

/* Tooltip on left-side positions */
#rwa-btn.rwa-tooltip-left .rwa-tooltip {
    right: auto;
    left: calc(100% + 12px);
}

#rwa-btn.rwa-tooltip-left .rwa-tooltip::after {
    left: auto;
    right: 100%;
    border-left-color: transparent;
    border-right-color: #1a1a2e;
}

#rwa-btn:hover .rwa-tooltip {
    opacity: 1;
}

/* Pulse animation */
@keyframes rwa-pulse-ring {
    0%   { transform: scale(1); opacity: 0.75; }
    100% { transform: scale(2); opacity: 0; }
}

/* Pulse uses a separate fixed pseudo-element so z-index can't go negative */
.rwa-pulse {
    animation: rwa-pulse-glow 2s ease-out infinite;
}

@keyframes rwa-pulse-glow {
    0%   { box-shadow: 0 0 0 0    rgba(37,211,102, 0.70), 0 6px 24px rgba(37,211,102,0.45); }
    50%  { box-shadow: 0 0 0 14px rgba(37,211,102, 0.15), 0 6px 24px rgba(37,211,102,0.45); }
    100% { box-shadow: 0 0 0 20px rgba(37,211,102, 0.00), 0 6px 24px rgba(37,211,102,0.45); }
}

/* Visibility helpers */
.rwa-mobile-only  { display: none; }
.rwa-desktop-only { display: flex; }

@media (max-width: 768px) {
    .rwa-mobile-only  { display: flex; }
    .rwa-desktop-only { display: none; }

    /* Tooltip on mobile: show above button */
    .rwa-tooltip {
        right: auto;
        left: 50%;
        top: auto;
        bottom: calc(100% + 10px);
        transform: translateX(-50%);
    }
    .rwa-tooltip::after {
        left: 50%;
        top: 100%;
        transform: translateX(-50%);
        border-left-color: transparent;
        border-top-color: #1a1a2e;
    }
}
