/* ========================================
   WhatsApp Popup Message - Auto Engagement
   ======================================== */

.whatsapp-popup {
    position: fixed;
    bottom: 100px;
    right: 85px;
    z-index: 9999;
    max-width: 320px;
    opacity: 0;
    transform: translateY(20px) scale(0.9);
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.whatsapp-popup.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

.whatsapp-popup-content {
    position: relative;
    background: white;
    border-radius: 12px;
    padding: 16px 18px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15),
        0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.whatsapp-popup-content:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2),
        0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

/* Close button */
.whatsapp-popup-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 2;
}

.whatsapp-popup-close:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: rotate(90deg);
}

.whatsapp-popup-close svg {
    stroke: #666;
}

/* Avatar */
.whatsapp-popup-avatar {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
    animation: pulse-avatar 2s ease-in-out infinite;
}

@keyframes pulse-avatar {

    0%,
    100% {
        box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
    }

    50% {
        box-shadow: 0 4px 20px rgba(37, 211, 102, 0.5);
    }
}

/* Message content */
.whatsapp-popup-message {
    flex: 1;
    padding-right: 20px;
}

.whatsapp-popup-name {
    font-size: 14px;
    font-weight: 700;
    color: #075e54;
    margin-bottom: 4px;
    font-family: 'Inter', system-ui, sans-serif;
}

.whatsapp-popup-text {
    font-size: 14px;
    color: #333;
    line-height: 1.5;
    margin-bottom: 6px;
    font-family: 'Inter', system-ui, sans-serif;
}

.whatsapp-popup-time {
    font-size: 11px;
    color: #999;
    font-family: 'Inter', system-ui, sans-serif;
}

/* Speech bubble arrow */
.whatsapp-popup-content::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 30px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid white;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.1));
}

/* Typing indicator animation */
@keyframes typing {

    0%,
    60%,
    100% {
        opacity: 0.4;
    }

    30% {
        opacity: 1;
    }
}

/* Pulse animation for initial appearance */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.whatsapp-popup.show .whatsapp-popup-content {
    animation: slideInUp 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .whatsapp-popup {
        right: 20px;
        bottom: 90px;
        max-width: 280px;
        left: 20px;
    }

    .whatsapp-popup-content {
        padding: 14px 16px;
        gap: 12px;
    }

    .whatsapp-popup-avatar {
        width: 44px;
        height: 44px;
    }

    .whatsapp-popup-avatar svg {
        width: 24px;
        height: 24px;
    }

    .whatsapp-popup-name {
        font-size: 13px;
    }

    .whatsapp-popup-text {
        font-size: 13px;
    }

    .whatsapp-popup-content::after {
        right: 20px;
    }
}

@media (max-width: 480px) {
    .whatsapp-popup {
        max-width: calc(100vw - 40px);
        right: 20px;
        left: 20px;
    }
}

/* Improve WhatsApp float button */
.whatsapp-float {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.4);
    z-index: 9998;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
}

.whatsapp-float:hover {
    transform: translateY(-4px) scale(1.1);
    box-shadow: 0 12px 32px rgba(37, 211, 102, 0.6);
}

.whatsapp-float:active {
    transform: translateY(-2px) scale(1.05);
}

/* Pulse ring animation */
.whatsapp-float::before {
    content: '';
    position: absolute;
    inset: -8px;
    border: 2px solid rgba(37, 211, 102, 0.6);
    border-radius: 50%;
    animation: pulse-ring 2s ease-out infinite;
}

@keyframes pulse-ring {
    0% {
        transform: scale(0.9);
        opacity: 1;
    }

    100% {
        transform: scale(1.3);
        opacity: 0;
    }
}

@media (max-width: 768px) {
    .whatsapp-float {
        width: 56px;
        height: 56px;
    }

    .whatsapp-float svg {
        width: 26px;
        height: 26px;
    }
}