/* WhatsApp Chat Widget Styles */
#whatsapp-chat-widget {
    position: fixed;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* Position Classes */
.whatsapp-widget-bottom-right {
    bottom: 20px;
    right: 20px;
}

.whatsapp-widget-bottom-left {
    bottom: 20px;
    left: 20px;
}

.whatsapp-widget-top-right {
    top: 20px;
    right: 20px;
}

.whatsapp-widget-top-left {
    top: 20px;
    left: 20px;
}

/* Floating Button */
.whatsapp-bubble {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #25D366;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    transition: all 0.3s ease;
    position: relative;
    animation: pulse 2s infinite;
}

.whatsapp-bubble:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.6);
}

.whatsapp-bubble svg {
    fill: white !important;
    color: white !important;
}

.whatsapp-bubble svg path {
    fill: white !important;
}

@keyframes pulse {
    0% {
        box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    }
    50% {
        box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4), 0 0 0 10px rgba(37, 211, 102, 0.1);
    }
    100% {
        box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    }
}

/* Chat Window */
.whatsapp-chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 300px;
    max-width: 90vw;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    transform: scale(0.8);
    opacity: 0;
    transition: all 0.3s ease;
    transform-origin: bottom right;
}

.whatsapp-widget-bottom-left .whatsapp-chat-window {
    right: auto;
    left: 0;
    transform-origin: bottom left;
}

.whatsapp-widget-top-right .whatsapp-chat-window {
    bottom: auto;
    top: 80px;
    transform-origin: top right;
}

.whatsapp-widget-top-left .whatsapp-chat-window {
    bottom: auto;
    top: 80px;
    right: auto;
    left: 0;
    transform-origin: top left;
}

.whatsapp-chat-window.show {
    transform: scale(1);
    opacity: 1;
}

/* Header */
.whatsapp-header {
    background-color: #25D366;
    color: white;
    padding: 15px;
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
}

.whatsapp-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.whatsapp-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
}

.whatsapp-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.whatsapp-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.whatsapp-info {
    flex: 1;
}

.whatsapp-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
}

.whatsapp-status {
    font-size: 12px;
    opacity: 0.9;
}

/* Messages */
.whatsapp-messages {
    padding: 20px;
    max-height: 200px;
    overflow-y: auto;
    background: #f7f7f7;
}

.whatsapp-message {
    margin-bottom: 15px;
}

.whatsapp-message-received .whatsapp-message-content {
    background: white;
    color: #333;
    padding: 12px 15px;
    border-radius: 18px 18px 18px 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    position: relative;
    max-width: 85%;
}

.whatsapp-message-sent .whatsapp-message-content {
    background: #dcf8c6;
    color: #333;
    padding: 12px 15px;
    border-radius: 18px 18px 4px 18px;
    margin-left: auto;
    max-width: 85%;
    position: relative;
}

.whatsapp-message-time {
    font-size: 11px;
    color: #666;
    margin-top: 5px;
    text-align: right;
}

.whatsapp-message-received .whatsapp-message-time {
    text-align: left;
}

/* Input Area */
.whatsapp-input-area {
    padding: 15px;
    background: white;
    border-top: 1px solid #e0e0e0;
}

.whatsapp-input-container {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

#whatsapp-message-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 10px 15px;
    outline: none;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

#whatsapp-message-input:focus {
    border-color: #25D366;
}

#whatsapp-send {
    background-color: #25D366;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
    border-radius: 25px;
    padding: 10px;
}

#whatsapp-send:hover {
    background-color: #128C7E;
}

#whatsapp-send svg {
    fill: none;
}

.whatsapp-actions {
    display: flex;
    justify-content: center;
}

.whatsapp-action-btn {
    background-color: #25D366;
    color: white;
    border: none;
    border-radius: 20px;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
    width: 100%;
    font-weight: 500;
}

.whatsapp-action-btn:hover {
    background-color: #128C7E;
}

/* Responsive */
@media (max-width: 480px) {
    .whatsapp-chat-window {
        width: 280px;
        bottom: 70px;
    }
    
    .whatsapp-widget-bottom-left .whatsapp-chat-window,
    .whatsapp-widget-top-left .whatsapp-chat-window {
        left: 10px;
    }
    
    .whatsapp-widget-bottom-right .whatsapp-chat-window,
    .whatsapp-widget-top-right .whatsapp-chat-window {
        right: 10px;
    }
}

/* Animation for message sending */
.whatsapp-message.sending {
    opacity: 0.6;
}

.whatsapp-message.sent {
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Loading dots animation */
.whatsapp-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 15px;
    background: white;
    border-radius: 18px 18px 18px 4px;
    max-width: 60px;
}

.whatsapp-typing span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #999;
    animation: typing 1.4s infinite ease-in-out;
}

.whatsapp-typing span:nth-child(1) {
    animation-delay: -0.32s;
}

.whatsapp-typing span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typing {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}
