/* ==========================================================================
   Reef WhatsApp Button - Frontend Styles
   ========================================================================== */

/* Container */
.reef-wa-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999999;
    display: flex;
    align-items: center;
    gap: 12px;
    direction: ltr;
}

.reef-wa-container.reef-wa-rtl {
    right: auto;
    left: 24px;
    direction: rtl;
    flex-direction: row-reverse;
}

/* Main Button */
.reef-wa-button {
    position: relative;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 3px solid #25D366;
    background: #ffffff;
    cursor: pointer;
    padding: 0;
    outline: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

.reef-wa-button:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 24px rgba(37, 211, 102, 0.35), 0 4px 8px rgba(0, 0, 0, 0.12);
}

.reef-wa-button:active {
    transform: scale(0.96);
}

/* Avatar */
.reef-wa-avatar {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #25D366, #128C7E);
}

.reef-wa-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.reef-wa-avatar-initials {
    color: #ffffff;
    font-size: 20px;
    font-weight: 700;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    letter-spacing: 1px;
}

/* Online dot indicator */
.reef-wa-online-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    background: #25D366;
    border-radius: 50%;
    border: 2.5px solid #ffffff;
    z-index: 2;
}

/* WhatsApp icon badge */
.reef-wa-wa-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 24px;
    height: 24px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ffffff;
    z-index: 2;
}

.reef-wa-wa-badge svg {
    width: 13px;
    height: 13px;
}

/* Breathing Pulse Rings */
.reef-wa-pulse-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid #25D366;
    transform: translate(-50%, -50%);
    animation: reef-wa-pulse 2.5s ease-in-out infinite;
    pointer-events: none;
    opacity: 0;
}

.reef-wa-pulse-ring-2 {
    animation-delay: 1.25s;
}

@keyframes reef-wa-pulse {
    0% {
        width: 100%;
        height: 100%;
        opacity: 0.6;
    }
    100% {
        width: 160%;
        height: 160%;
        opacity: 0;
    }
}

/* Tooltip */
.reef-wa-tooltip {
    background: #ffffff;
    color: #1a1a2e;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    white-space: nowrap;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.08);
    opacity: 0;
    transform: translateX(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    position: relative;
}

/* Tooltip arrow pointing right (toward button) */
.reef-wa-tooltip::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -6px;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 6px solid #ffffff;
}

/* RTL tooltip arrow */
.reef-wa-rtl .reef-wa-tooltip::after {
    right: auto;
    left: -6px;
    border-left: none;
    border-right: 6px solid #ffffff;
}

/* Tooltip visible on hover */
.reef-wa-container:hover .reef-wa-tooltip {
    opacity: 1;
    transform: translateX(0);
}

/* Entrance animation */
.reef-wa-container {
    animation: reef-wa-slideIn 0.5s ease-out forwards;
}

@keyframes reef-wa-slideIn {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .reef-wa-container {
        bottom: 16px;
        right: 16px;
    }

    .reef-wa-container.reef-wa-rtl {
        right: auto;
        left: 16px;
    }

    .reef-wa-button {
        width: 56px;
        height: 56px;
    }

    .reef-wa-avatar {
        width: 46px;
        height: 46px;
    }

    .reef-wa-avatar-initials {
        font-size: 17px;
    }

    /* Hide tooltip on mobile - tap only */
    .reef-wa-tooltip {
        display: none;
    }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .reef-wa-pulse-ring {
        animation: none;
    }

    .reef-wa-container {
        animation: none;
    }

    .reef-wa-button:hover {
        transform: none;
    }
}
