/* WhatsApp Chat Widget Styles */
.whatsapp-chat-widget * {
    box-sizing: border-box;
}

/* Notification Badge */
.whatsapp-chat-widget .notification-badge {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #25D366;
    color: white;
    padding: 12px 20px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
    animation: slideInNotification 0.5s ease-out, pulseNotification 2s infinite 1s;
    cursor: pointer;
    z-index: 10001;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.whatsapp-chat-widget .notification-badge::before {
    content: "💬";
    font-size: 16px;
}

/* WhatsApp Circle Button */
.whatsapp-chat-widget #waCircle {
    position: fixed;
    bottom: 95px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #25D366, #128C7E);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
    z-index: 10000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: continuousPulse 2s infinite;
}

.whatsapp-chat-widget #waCircle:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.5);
}

.whatsapp-chat-widget #waCircle svg {
    width: 35px;
    height: 35px;
    fill: white;
}

/* Notification Dot */
.whatsapp-chat-widget .notification-dot {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 20px;
    height: 20px;
    background: #ff4757;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 11px;
    font-weight: bold;
    border: 2px solid white;
    animation: bounce 1s infinite;
}

/* Chat Box */
.whatsapp-chat-widget #waBox {
    display: none;
    position: fixed;
    bottom: 165px;
    right: 20px;
    width: 350px;
    max-width: calc(100vw - 40px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    z-index: 10000;
    animation: slideInChat 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

/* Chat Header */
.whatsapp-chat-widget .chat-header {
    background: linear-gradient(135deg, #128C7E, #25D366);
    color: white;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.whatsapp-chat-widget .agent-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.whatsapp-chat-widget .agent-info h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.whatsapp-chat-widget .agent-info p {
    margin: 2px 0 0 0;
    font-size: 12px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 4px;
}

.whatsapp-chat-widget .online-dot {
    width: 6px;
    height: 6px;
    background: #4CAF50;
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

.whatsapp-chat-widget .close-btn {
    margin-left: auto;
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: background 0.2s;
}

.whatsapp-chat-widget .close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Chat Content */
.whatsapp-chat-widget .chat-content {
    padding: 20px 16px;
    min-height: 120px;
    max-height: 200px;
    overflow-y: auto;
    background: #f8f9fa;
}

.whatsapp-chat-widget .message {
    margin-bottom: 12px;
    animation: fadeInMessage 0.3s ease-out;
}

.whatsapp-chat-widget .message.bot {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.whatsapp-chat-widget .message.user {
    display: flex;
    justify-content: flex-end;
}

.whatsapp-chat-widget .message-bubble {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}

.whatsapp-chat-widget .message.bot .message-bubble {
    background: white;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.whatsapp-chat-widget .message.user .message-bubble {
    background: #dcf8c6;
    border-bottom-right-radius: 4px;
}

.whatsapp-chat-widget .message-time {
    font-size: 11px;
    color: #666;
    margin-top: 4px;
    text-align: right;
}

/* Input Area */
.whatsapp-chat-widget .chat-input {
    padding: 16px;
    background: white;
    border-top: 1px solid #e9ecef;
}

.whatsapp-chat-widget .input-container {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.whatsapp-chat-widget #waUserMessage {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e9ecef;
    border-radius: 22px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    min-height: 44px;
    max-height: 100px;
    outline: none;
    transition: border-color 0.2s;
}

.whatsapp-chat-widget #waUserMessage:focus {
    border-color: #25D366;
}

/* Send Button - Made Bigger and More Visible */
.whatsapp-chat-widget #waStart {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #25D366, #128C7E);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(37, 211, 102, 0.3);
    flex-shrink: 0;
}

.whatsapp-chat-widget #waStart:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
}

/* Send Button SVG - Made Much Larger */
.whatsapp-chat-widget #waStart svg {
    width: 28px !important;
    height: 28px !important;
    fill: white;
    transition: transform 0.2s;
}

.whatsapp-chat-widget #waStart:hover svg {
    transform: translateX(2px);
}

/* Alternative: If using Font Awesome or other icon fonts */
.whatsapp-chat-widget #waStart i {
    font-size: 22px !important;
    color: white;
}

/* Alternative: If using text content like → */
.whatsapp-chat-widget #waStart::before {
    content: "➤";
    font-size: 24px;
    color: white;
    font-weight: bold;
}

/* Hide the ::before if there's actual content inside */
.whatsapp-chat-widget #waStart:not(:empty)::before {
    display: none;
}

/* Animations */
@keyframes continuousPulse {
    0%, 100% { 
        box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4), 0 0 0 0 rgba(37, 211, 102, 0.7);
    }
    50% { 
        box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4), 0 0 0 10px rgba(37, 211, 102, 0);
    }
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% { transform: translate3d(0, 0, 0); }
    40%, 43% { transform: translate3d(0, -8px, 0); }
    70% { transform: translate3d(0, -4px, 0); }
    90% { transform: translate3d(0, -2px, 0); }
}

@keyframes slideInChat {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes slideInNotification {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulseNotification {
    0%, 100% { transform: translateX(0) scale(1); }
    50% { transform: translateX(-2px) scale(1.02); }
}

@keyframes fadeInMessage {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Responsive */
@media (max-width: 480px) {
    .whatsapp-chat-widget #waBox {
        width: calc(100vw - 20px);
        right: 10px;
        bottom: 210px;
    }
    
    .whatsapp-chat-widget .notification-badge {
        right: 10px;
        padding: 10px 16px;
        font-size: 13px;
    }
    
    /* WhatsApp button positioned to avoid conflicts */
    .whatsapp-chat-widget #waCircle {
        bottom: 140px;
        right: 15px;
        width: 52px;
        height: 52px;
    }
    
    .whatsapp-chat-widget #waCircle svg {
        width: 28px;
        height: 28px;
    }
    
    /* Keep send button large on mobile */
    .whatsapp-chat-widget #waStart {
        width: 46px;
        height: 46px;
    }
    
    .whatsapp-chat-widget #waStart svg {
        width: 24px !important;
        height: 24px !important;
    }
}

/* Custom scrollbar */
.whatsapp-chat-widget .chat-content::-webkit-scrollbar {
    width: 4px;
}

.whatsapp-chat-widget .chat-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.whatsapp-chat-widget .chat-content::-webkit-scrollbar-thumb {
    background: #25D366;
    border-radius: 2px;
}