/********************************************************
 * Modern Floating WhatsApp Chat - Updated Styles
 ********************************************************/

/* Container for the Floating WhatsApp Button */
.floating-wpp {
    position: fixed;
    bottom: 20px;
    right: 20px;  /* Placed at bottom-right for a modern feel */
    z-index: 9999;
    font-family: Arial, sans-serif;
}

/* The WhatsApp Button */
.floating-wpp .floating-wpp-button {
    width: 65px;
    height: 65px;
    background: linear-gradient(145deg, #25D366, #128C7E); /* Modern gradient */
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* Pulsating Glow Effect for extra attention */
.floating-wpp .floating-wpp-button::after {
    content: "";
    position: absolute;
    width: 75px;
    height: 75px;
    background: rgba(37, 211, 102, 0.2);
    border-radius: 50%;
    animation: pulse-animation 1.5s infinite;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Hover Effect for the Button */
.floating-wpp .floating-wpp-button:hover {
    transform: scale(1.1);
    box-shadow: 0px 6px 20px rgba(37, 211, 102, 0.5);
}

/* Glassmorphism Style Chat Popup */
.floating-wpp .floating-wpp-popup {
    position: absolute; /* Keep it positioned relative to the button */
    bottom: 80px;
    right: 0;
    width: 320px;
    border-radius: 12px;
    background: #FFFFFF;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0px 4px 15px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    opacity: 0; /* Make it invisible when not active */
    transform: scale(0.9); /* Shrink it slightly when hidden */
    pointer-events: none; /* Prevent interaction when hidden */
    transition: opacity 0.3s ease, transform 0.3s ease;
    transform-origin: bottom right;
}

/* Active Popup State */
.floating-wpp .floating-wpp-popup.active {
    opacity: 1; /* Make it visible */
    transform: scale(1); /* Restore its size */
    pointer-events: auto; /* Allow interaction */
}

/* Chat Header with Gradient */
.floating-wpp .floating-wpp-popup .floating-wpp-head {
    background: linear-gradient(145deg, #25D366, #128C7E);
    color: #fff;
    font-weight: bold;
    padding: 14px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    cursor: pointer;
}

/* Close Button Icon */
.floating-wpp .floating-wpp-popup .floating-wpp-head svg {
    cursor: pointer;
    transition: transform 0.2s;
}
.floating-wpp .floating-wpp-popup .floating-wpp-head svg:hover {
    transform: rotate(90deg);
}

/* Chat Message Body */
.floating-wpp .floating-wpp-popup .floating-wpp-message {
    background: rgba(255, 255, 255, 0.95);
    padding: 12px;
    margin: 12px;
    border-radius: 8px;
    box-shadow: inset 0px 1px 4px rgba(0, 0, 0, 0.1);
    font-size: 14px;
    background: #F0F2F5;
    color: #111B21;
}

/* Chat Input Area */
.floating-wpp .floating-wpp-input-message {
    background: rgba(255, 255, 255, 0.9);
    padding: 10px;
    display: flex;
    align-items: center;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    border-top: 1px solid rgba(0,0,0,0.1);
    max-height: 100px; /* Set a maximum height for the input area */
    overflow-y: auto; /* Enable vertical scrolling if content exceeds max-height */
}
.floating-wpp .floating-wpp-input-message textarea {
    border: none;
    background: transparent;
    outline: none;
    padding: 8px;
    width: 100%;
    font-size: 14px;
    resize: none;
    font-family: inherit;
    overflow-y: auto; /* Allow scrolling inside the textarea */
}

/* Send Button */
.floating-wpp .floating-wpp-btn-send {
    margin-left: 12px;
    cursor: pointer;
    transition: transform 0.2s;
    background-color: #25D366;
    border-radius: 6px;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
}
.floating-wpp .floating-wpp-btn-send:hover {
    transform: scale(1.2);
}
.floating-wpp .floating-wpp-btn-send svg {
    fill: #000; /* Black arrow for contrast */
    width: 20px;
    height: 20px;
}

/* Keyframes for Pulsing Animation */
@keyframes pulse-animation {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }
    50% {
        transform: scale(1.3);
        opacity: 0.3;
    }
    100% {
        transform: scale(1);
        opacity: 0.6;
    }
}