/* WhatsApp Chat Widget Styles */
.whatsapp-chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

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

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

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

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

/* Notification Badge */
.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #FF3B30;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    animation: badge-bounce 0.5s ease;
}

@keyframes badge-bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* Chat Window */
.whatsapp-chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slide-up 0.3s ease;
}

@keyframes slide-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.whatsapp-chat-window.active {
    display: flex;
}

/* Chat Header */
.chat-header {
    background: linear-gradient(135deg, #25D366, #128C7E);
    color: white;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-avatar svg {
    width: 25px;
    height: 25px;
    fill: #25D366;
}

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

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

.close-chat {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

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

/* Chat Messages */
.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #E5DDD5;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><rect width="100" height="100" fill="%23E5DDD5"/><path d="M0 0L100 100M100 0L0 100" stroke="%23D7CCC8" stroke-width="0.5" opacity="0.3"/></svg>');
}

.welcome-message {
    text-align: center;
    padding: 20px;
    color: #667781;
}

.welcome-message svg {
    width: 60px;
    height: 60px;
    fill: #25D366;
    margin-bottom: 10px;
}

.welcome-message h4 {
    margin: 10px 0 5px;
    color: #111B21;
    font-size: 18px;
}

.welcome-message p {
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
}

/* Quick Replies */
.quick-replies {
    padding: 15px;
    background: white;
    border-top: 1px solid #E9EDEF;
}

.quick-reply-btn {
    display: block;
    width: 100%;
    padding: 12px;
    margin: 5px 0;
    background: #E7F7F0;
    border: 1px solid #DCF0E8;
    border-radius: 18px;
    color: #111B21;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.quick-reply-btn:hover {
    background: #DCF0E8;
    transform: translateY(-1px);
}

/* Chat Input */
.chat-input-container {
    padding: 15px;
    background: white;
    border-top: 1px solid #E9EDEF;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #E9EDEF;
    border-radius: 20px;
    outline: none;
    font-size: 14px;
    resize: none;
    max-height: 100px;
    font-family: inherit;
}

.chat-input:focus {
    border-color: #25D366;
}

.send-btn {
    width: 40px;
    height: 40px;
    background: #25D366;
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.send-btn:hover {
    background: #128C7E;
}

.send-btn svg {
    width: 20px;
    height: 20px;
    fill: white;
}

/* Responsive Design */
@media (max-width: 480px) {
    .whatsapp-chat-widget {
        bottom: 15px;
        right: 15px;
    }
    
    .whatsapp-button {
        width: 55px;
        height: 55px;
    }
    
    .whatsapp-chat-window {
        width: calc(100vw - 30px);
        height: calc(100vh - 100px);
        right: -15px;
    }
}

/* Loading State */
.loading-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #667781;
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 15px;
    background: #DCF0E8;
    border-radius: 18px;
    margin: 10px;
    max-width: 200px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: #94A3B8;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot: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;
    }
}
