/* ============================================
   WHATSAPP CHAT WIDGET
   ============================================ */

.whatsapp-widget {
    position: fixed;
    bottom: 100px;
    right: 30px;
    z-index: 9999;
}

/* WhatsApp Button */
.whatsapp-button {
    position: relative;
    width: 60px;
    height: 60px;
    margin-right: 30px;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s infinite;
}

.whatsapp-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(37, 211, 102, 0.6);
}

.whatsapp-button svg {
    width: 32px;
    height: 32px;
    color: white;
}

.whatsapp-notification {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 24px;
    height: 24px;
    background: #FF3B30;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    border: 2px solid white;
    animation: bounce 1s infinite;
}

/* Pulse Animation */
@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    }

    50% {
        box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4),
            0 0 0 10px rgba(37, 211, 102, 0.1),
            0 0 0 20px rgba(37, 211, 102, 0.05);
    }
}

/* Bounce Animation */
@keyframes bounce {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

/* Chat Box */
.whatsapp-chat-box {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 360px;
    max-width: calc(100vw - 40px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transform: scale(0.8) translateY(20px);
    transform-origin: bottom right;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.whatsapp-chat-box.active {
    opacity: 1;
    visibility: visible;
    transform: scale(1) translateY(0);
}

/* Chat Header */
.whatsapp-chat-header {
    background: linear-gradient(135deg, #128C7E 0%, #075E54 100%);
    padding: 20px;
    border-radius: 16px 16px 0 0;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.whatsapp-chat-avatar {
    position: relative;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
}

.whatsapp-chat-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.whatsapp-status-online {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background: #25D366;
    border: 2px solid white;
    border-radius: 50%;
}

.whatsapp-chat-info {
    flex: 1;
    color: white;
}

.whatsapp-chat-info h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.whatsapp-chat-info p {
    margin: 4px 0 0;
    font-size: 13px;
    opacity: 0.9;
}

.whatsapp-chat-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.whatsapp-chat-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Chat Body */
.whatsapp-chat-body {
    padding: 20px;
    background: #ECE5DD;
    min-height: 200px;
    max-height: 300px;
    overflow-y: auto;
}

.whatsapp-message {
    background: white;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    position: relative;
}

.whatsapp-message-received {
    border-radius: 0 8px 8px 8px;
}

.whatsapp-message p {
    margin: 0 0 8px;
    font-size: 14px;
    line-height: 1.5;
    color: #303030;
}

.whatsapp-message p:last-of-type {
    margin-bottom: 0;
}

.whatsapp-message-time {
    display: block;
    font-size: 11px;
    color: #667781;
    text-align: right;
    margin-top: 4px;
}

/* Quick Replies */
.whatsapp-quick-replies {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.whatsapp-quick-reply {
    background: white;
    border: 1px solid #E9EDEF;
    padding: 12px 16px;
    border-radius: 20px;
    font-size: 14px;
    color: #128C7E;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.whatsapp-quick-reply:hover {
    background: #F0F2F5;
    border-color: #128C7E;
}

.whatsapp-quick-reply i {
    font-size: 16px;
}

/* Chat Footer */
.whatsapp-chat-footer {
    padding: 16px 20px;
    background: white;
    border-radius: 0 0 16px 16px;
    border-top: 1px solid #E9EDEF;
}

.whatsapp-send-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: white;
    border: none;
    border-radius: 30px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

.whatsapp-send-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
}

.whatsapp-send-button i {
    font-size: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .whatsapp-widget {
        bottom: 90px;
        right: 20px;
    }

    .whatsapp-button {
        width: 56px;
        height: 56px;
    }

    .whatsapp-button svg {
        width: 28px;
        height: 28px;
    }

    .whatsapp-chat-box {
        width: calc(100vw - 40px);
        bottom: 70px;
    }

    .whatsapp-chat-header {
        padding: 16px;
    }

    .whatsapp-chat-avatar {
        width: 45px;
        height: 45px;
    }

    .whatsapp-chat-info h4 {
        font-size: 15px;
    }

    .whatsapp-chat-info p {
        font-size: 12px;
    }

    .whatsapp-chat-body {
        max-height: 250px;
    }
}

/* Scrollbar Styling */
.whatsapp-chat-body::-webkit-scrollbar {
    width: 6px;
}

.whatsapp-chat-body::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
}

.whatsapp-chat-body::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.whatsapp-chat-body::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}