/* WhatsApp Floating Widget */
.wa-widget-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-family: inherit;
}

/* Tooltip Balloon */
.wa-tooltip {
    background-color: #fff;
    color: #1a2352;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    margin-bottom: 16px;
    margin-right: 8px; /* Alignment visual tweak */
    opacity: 0;
    transform: translateY(10px) scale(0.95);
    pointer-events: none;
    transition: opacity 0.4s ease, transform 0.4s ease;
    position: relative;
}

.wa-tooltip.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.wa-tooltip-tail {
    position: absolute;
    bottom: -6px;
    right: 18px;
    width: 12px;
    height: 12px;
    background-color: #fff;
    transform: rotate(45deg);
    border-bottom-right-radius: 2px;
}

/* Floating Button */
.wa-float-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #25D366;
    border: none;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    animation: bounce-in 1s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.wa-icon-container {
    position: relative;
    z-index: 2;
    transition: transform 0.3s ease;
}

.wa-float-btn:hover .wa-icon-container {
    transform: scale(1.1) rotate(5deg);
}

.wa-halo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: #25D366;
    z-index: 1;
    animation: wa-pulse 3s infinite cubic-bezier(0.66, 0, 0, 1);
}

@keyframes bounce-in {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}

@keyframes wa-pulse {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 0.6; }
    100% { transform: translate(-50%, -50%) scale(1.6); opacity: 0; }
}

/* Chat Window */
.wa-chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 340px;
    background-color: #f5f7f9;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.25);
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transform-origin: bottom right;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.wa-chat-window.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* Header */
.wa-chat-header {
    background-color: #005e54; /* WA classic dark header */
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #fff;
}

.wa-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wa-avatar {
    width: 40px;
    height: 40px;
    background-color: rgba(255,255,255,0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wa-header-info h4 {
    margin: 0 0 2px 0;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
}

.wa-header-info p {
    margin: 0;
    font-size: 0.75rem;
    opacity: 0.8;
}

.wa-close-btn {
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
    padding: 4px;
}

.wa-close-btn:hover {
    opacity: 1;
}

/* Body */
.wa-chat-body {
    padding: 20px 16px;
    background-color: #efeae2; /* WA chat bg */
    flex: 1;
}

.wa-message-received {
    background-color: #fff;
    color: #111b21;
    padding: 12px 14px;
    border-radius: 0 8px 8px 8px;
    font-size: 0.875rem;
    line-height: 1.4;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    margin-bottom: 16px;
    position: relative;
}

.wa-message-received::before {
    content: '';
    position: absolute;
    top: 0;
    left: -8px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 8px 10px 0;
    border-color: transparent #fff transparent transparent;
}

/* Quick Options */
.wa-quick-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.wa-option-btn {
    background-color: rgba(37, 211, 102, 0.1);
    border: 1px solid rgba(37, 211, 102, 0.3);
    color: #005e54;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.wa-option-btn:hover {
    background-color: rgba(37, 211, 102, 0.2);
}

.wa-option-btn.active {
    background-color: #25D366;
    color: #fff;
    border-color: #25D366;
}

/* Footer */
.wa-chat-footer {
    padding: 16px;
    background-color: #fff;
}

.wa-send-btn {
    width: 100%;
    background-color: #25D366;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 12px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    transition: background-color 0.2s;
}

.wa-send-btn:hover {
    background-color: #1fae52;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .wa-widget-container {
        bottom: 16px;
        right: 16px;
    }
    
    .wa-chat-window {
        position: fixed;
        bottom: 84px;
        right: 16px;
        left: 16px;
        width: auto;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .wa-float-btn {
        animation: none;
    }
    .wa-halo {
        animation: none;
        display: none;
    }
    .wa-chat-window, .wa-tooltip {
        transition: opacity 0.2s ease;
        transform: none !important;
    }
}
