/* WhatsApp Widget Container */
.whatsapp-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
}

/* WhatsApp Button */
.whatsapp-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: #25D366;
    border-radius: 50%;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
    animation: whatsapp-pulse 2s infinite;
    position: relative;
}

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

.whatsapp-button svg {
    width: 35px;
    height: 35px;
    fill: white;
}

.whatsapp-button .whatsapp-tooltip {
    position: absolute;
    right: 75px;
    top: 50%;
    transform: translateY(-50%);
    background: #000;
    color: white;
    padding: 8px 15px;
    border-radius: 8px;
    font-size: 14px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.whatsapp-button:hover .whatsapp-tooltip {
    opacity: 1;
}

.whatsapp-button .whatsapp-tooltip::after {
    content: '';
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    border-left: 8px solid #000;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
}

/* WhatsApp Chat Box */
.whatsapp-chat-box {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 350px;
    max-height: 500px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.8) translateY(20px);
    transition: all 0.3s ease;
}

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

/* Chat Header */
.whatsapp-chat-header {
    background: linear-gradient(135deg, #25D366 0%, #20BA5A 100%);
    color: white;
    padding: 18px 20px;
    border-radius: 15px 15px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.whatsapp-chat-header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.whatsapp-chat-header h4 {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.whatsapp-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border-radius: 50%;
    font-weight: 300;
}

.whatsapp-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1) rotate(90deg);
}

/* Chat Body */
.whatsapp-chat-body {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
    background: #ECE5DD;
    background-image:
        repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(255,255,255,.05) 10px, rgba(255,255,255,.05) 20px);
}

.whatsapp-message-bubble {
    background: white;
    padding: 12px 15px;
    border-radius: 10px;
    max-width: 80%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    margin-bottom: 10px;
}

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

/* Chat Footer */
.whatsapp-chat-footer {
    display: flex;
    gap: 10px;
    padding: 15px;
    background: #F0F0F0;
    border-radius: 0 0 15px 15px;
    border-top: 1px solid #E0E0E0;
}

.whatsapp-chat-footer input {
    flex: 1;
    padding: 12px 18px;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    outline: none;
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.whatsapp-chat-footer input:focus {
    box-shadow: 0 2px 8px rgba(37, 211, 102, 0.2);
    border: 1px solid #25D366;
}

.whatsapp-chat-footer input::placeholder {
    color: #999;
}

.whatsapp-chat-footer button {
    width: 45px;
    height: 45px;
    min-width: 45px;
    background: #25D366 !important;
    border: none !important;
    border-radius: 50% !important;
    cursor: pointer;
    display: flex !important;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(37, 211, 102, 0.3);
    padding: 0 !important;
    flex-shrink: 0;
}

.whatsapp-chat-footer button:hover {
    background: #20BA5A !important;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.5);
}

.whatsapp-chat-footer button svg {
    display: block !important;
    width: 22px !important;
    height: 22px !important;
    fill: white !important;
    pointer-events: none;
}

#whatsapp-send-btn {
    position: relative;
}

#whatsapp-send-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0);
    transition: background 0.2s ease;
}

#whatsapp-send-btn:active::after {
    background: rgba(255,255,255,0.2);
}

/* Pulse animation */
@keyframes whatsapp-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(37, 211, 102, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
    }
}

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

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

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

    .whatsapp-button .whatsapp-tooltip {
        display: none;
    }

    .whatsapp-chat-box {
        width: calc(100vw - 40px);
        max-width: 350px;
        bottom: 20px;
        right: 20px;
    }
}
