/* ===== AI Chatbot - Modern Compact ===== */

/* Floating Button - Icon Only, Compact */
.wm-chat-btn {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(102,126,234,0.45);
    z-index: 9999;
    transition: all 0.3s;
    animation: chatPulse 3s ease infinite;
}
.wm-chat-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 28px rgba(102,126,234,0.6);
}
.wm-chat-btn i { font-size: 22px; }
.wm-chat-btn span { display: none; }

/* Tooltip on hover */
.wm-chat-btn::after {
    content: 'Chat with us';
    position: absolute;
    right: 64px;
    background: #1a1a2e;
    color: #fff;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}
.wm-chat-btn:hover::after { opacity: 1; }

@keyframes chatPulse {
    0%, 100% { box-shadow: 0 4px 20px rgba(102,126,234,0.45); }
    50% { box-shadow: 0 4px 20px rgba(102,126,234,0.45), 0 0 0 8px rgba(102,126,234,0.12); }
}

/* Unread badge */
.wm-unread-badge {
    position: absolute;
    top: -4px; right: -4px;
    background: #ef4444;
    color: #fff;
    width: 20px; height: 20px;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    animation: badgePop 0.3s ease;
}
@keyframes badgePop {
    0% { transform: scale(0); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* Chatbox */
.wm-chatbox {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 370px;
    height: 500px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 12px 48px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    z-index: 10000;
    overflow: hidden;
    opacity: 0;
    transform: translateY(16px) scale(0.96);
    pointer-events: none;
    transition: all 0.25s cubic-bezier(0.23,1,0.32,1);
}
.wm-chatbox.wm-open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* Header - Compact */
.wm-chat-header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.wm-chat-header-left { display: flex; align-items: center; gap: 10px; }
.wm-chat-avatar {
    width: 36px; height: 36px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
}
.wm-chat-title { font-weight: 600; font-size: 14px; }
.wm-chat-status { font-size: 10px; opacity: 0.8; display: flex; align-items: center; gap: 4px; }
.wm-status-dot {
    width: 6px; height: 6px;
    background: #34d399;
    border-radius: 50%;
    display: inline-block;
    animation: statusPulse 2s ease infinite;
}
@keyframes statusPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.wm-header-actions { display: flex; align-items: center; gap: 2px; }
.wm-header-btn {
    background: rgba(255,255,255,0.12);
    border: none;
    color: #fff;
    width: 30px; height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    display: flex; align-items: center; justify-content: center;
    transition: 0.2s;
}
.wm-header-btn:hover { background: rgba(255,255,255,0.25); }

.wm-chat-close {
    background: none; border: none; color: #fff; font-size: 22px;
    cursor: pointer; opacity: 0.8; transition: 0.2s;
    line-height: 1; margin-left: 2px;
}
.wm-chat-close:hover { opacity: 1; }

/* Agent Connected Bar */
.wm-agent-bar {
    background: #10b981;
    color: #fff;
    padding: 6px 14px;
    font-size: 11px;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    display: flex;
    align-items: center;
    gap: 6px;
}
.wm-agent-dot {
    width: 6px; height: 6px;
    background: #fff;
    border-radius: 50%;
    display: inline-block;
    animation: statusPulse 1.5s ease infinite;
}

/* Agent info in message */
.wm-agent-info {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
    font-size: 10px;
    font-weight: 700;
    opacity: 0.9;
}
.wm-agent-avatar {
    width: 24px; height: 24px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center top;
    border: 1.5px solid rgba(102,126,234,0.3);
}

/* Messages */
.wm-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: #f8f9fc;
}
.wm-chat-messages::-webkit-scrollbar { width: 3px; }
.wm-chat-messages::-webkit-scrollbar-thumb { background: #d0d0d0; border-radius: 3px; }

.wm-msg { display: flex; flex-direction: column; animation: msgIn 0.25s ease; }
.wm-msg.wm-user { align-items: flex-end; }
.wm-msg.wm-bot { align-items: flex-start; }
.wm-msg-bubble {
    max-width: 82%;
    padding: 9px 13px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.5;
    font-family: 'Poppins', sans-serif;
}
.wm-bot .wm-msg-bubble {
    background: #fff;
    color: #333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.wm-user .wm-msg-bubble {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.wm-msg-time {
    font-size: 9px;
    color: #aaa;
    margin-top: 2px;
    padding: 0 4px;
    font-family: 'Poppins', sans-serif;
}

@keyframes msgIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Typing indicator */
.wm-typing { display: flex; gap: 4px; padding: 10px 16px !important; }
.wm-typing span {
    width: 6px; height: 6px; background: #bbb; border-radius: 50%;
    animation: typingDot 1.2s ease infinite;
}
.wm-typing span:nth-child(2) { animation-delay: 0.2s; }
.wm-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingDot {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-5px); opacity: 1; }
}

/* Suggestions */
.wm-suggestions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.wm-sug-btn {
    background: #fff;
    border: 1.5px solid #667eea;
    color: #667eea;
    padding: 5px 12px;
    border-radius: 18px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    transition: all 0.2s;
}
.wm-sug-btn:hover {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff; border-color: transparent;
}

/* Input */
.wm-chat-input {
    padding: 10px 12px;
    display: flex;
    gap: 6px;
    border-top: 1px solid #f0f0f0;
    background: #fff;
    align-items: center;
}
.wm-chat-input input {
    flex: 1;
    min-width: 0;
    border: 1px solid #e8e8e8;
    border-radius: 22px;
    padding: 9px 14px;
    font-size: 13px;
    font-family: 'Poppins', sans-serif;
    outline: none;
    transition: border 0.2s;
}
.wm-chat-input input:focus { border-color: #667eea; }
.wm-chat-input button, .wm-voice-btn {
    width: 36px; height: 36px; min-width: 36px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff; border: none; border-radius: 50%;
    cursor: pointer; font-size: 14px;
    display: inline-flex; align-items: center; justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}
.wm-chat-input button i, .wm-voice-btn i {
    animation: none !important;
    transform: none !important;
}
.wm-chat-input button:hover, .wm-voice-btn:hover { transform: scale(1.06); box-shadow: 0 3px 12px rgba(102,126,234,0.35); }

/* Voice recording */
.wm-voice-btn.wm-recording {
    background: #ef4444 !important;
    animation: voicePulse 1s ease infinite;
}
@keyframes voicePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.4); }
    50% { box-shadow: 0 0 0 8px rgba(239,68,68,0); }
}

/* Lead form */
.wm-lead-form { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.wm-lead-form input {
    padding: 7px 11px; border: 1px solid #ddd; border-radius: 8px;
    font-size: 12px; font-family: 'Poppins', sans-serif; outline: none;
}
.wm-lead-form input:focus { border-color: #667eea; }
.wm-lead-form button {
    padding: 7px; background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff; border: none; border-radius: 8px; font-size: 12px;
    font-weight: 600; cursor: pointer; font-family: 'Poppins', sans-serif;
}

/* Contact Action Buttons */
.wm-contact-btns { display: flex; gap: 6px; margin-top: 8px; }
.wm-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
}
.wm-call-btn { background: #3b82f6; color: #fff; }
.wm-call-btn:hover { background: #2563eb; transform: translateY(-1px); }
.wm-wa-btn { background: #25D366; color: #fff; }
.wm-wa-btn:hover { background: #1da851; transform: translateY(-1px); }
.wm-action-btn i { font-size: 12px; }

/* Quote Options */
.wm-quote-options { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; animation: msgIn 0.25s ease; }
.wm-quote-btn {
    padding: 6px 12px;
    background: #fff;
    border: 1.5px solid #667eea;
    border-radius: 18px;
    color: #667eea;
    font-size: 11px;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
}
.wm-quote-btn:hover {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff; border-color: transparent;
}

/* Pricing Picker */
.wm-pricing-picker { display: flex; flex-direction: column; gap: 5px; margin-top: 5px; animation: msgIn 0.25s ease; }
.wm-price-option {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px; background: #fff;
    border: 1.5px solid #e8e8e8; border-radius: 10px;
    cursor: pointer; font-family: 'Poppins', sans-serif; transition: all 0.2s;
}
.wm-price-option:hover { border-color: #667eea; background: #f5f6ff; transform: translateX(3px); }
.wm-price-icon { font-size: 18px; }
.wm-price-label { flex: 1; font-size: 12px; font-weight: 600; color: #333; text-align: left; }
.wm-price-tag { font-size: 10px; font-weight: 700; color: #667eea; background: #f0f2ff; padding: 2px 8px; border-radius: 16px; }

.wm-price-card { background: linear-gradient(135deg, #f0f2ff, #e8eaff); border-radius: 10px; padding: 10px; margin-top: 6px; }
.wm-price-amount { font-size: 18px; font-weight: 700; color: #667eea; margin-bottom: 3px; }
.wm-price-best { font-size: 10px; color: #888; margin-bottom: 6px; font-style: italic; }
.wm-price-features { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 3px; }
.wm-price-features li { font-size: 11px; color: #444; }

/* ===== DARK MODE ===== */
.wm-chatbox[data-theme="dark"] .wm-chat-messages { background: #1a1a2e; }
.wm-chatbox[data-theme="dark"] .wm-bot .wm-msg-bubble { background: #16213e; color: #e0e0e0; box-shadow: 0 1px 4px rgba(0,0,0,0.2); }
.wm-chatbox[data-theme="dark"] .wm-chat-input { background: #1a1a2e; border-top-color: #2a2a4a; }
.wm-chatbox[data-theme="dark"] .wm-chat-input input { background: #16213e; border-color: #2a2a4a; color: #e0e0e0; }
.wm-chatbox[data-theme="dark"] .wm-msg-time { color: #555; }
.wm-chatbox[data-theme="dark"] .wm-sug-btn { background: #16213e; color: #8b9cf7; border-color: #8b9cf7; }
.wm-chatbox[data-theme="dark"] .wm-sug-btn:hover { background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; border-color: transparent; }
.wm-chatbox[data-theme="dark"] .wm-lead-form input { background: #16213e; border-color: #2a2a4a; color: #e0e0e0; }
.wm-chatbox[data-theme="dark"] .wm-reg-form input { background: #16213e; border-color: #2a2a4a; color: #e0e0e0; }
.wm-chatbox[data-theme="dark"] .wm-upload-btn { background: #16213e; color: #8b9cf7; }
.wm-chatbox[data-theme="dark"] .wm-upload-btn:hover { background: #667eea; color: #fff; }
.wm-chatbox[data-theme="dark"] .wm-chat-messages::-webkit-scrollbar-thumb { background: #444; }
.wm-chatbox[data-theme="dark"] .wm-quote-btn { background: #16213e; color: #8b9cf7; border-color: #8b9cf7; }
.wm-chatbox[data-theme="dark"] .wm-quote-btn:hover { background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; border-color: transparent; }
.wm-chatbox[data-theme="dark"] .wm-price-option { background: #16213e; border-color: #2a2a4a; }
.wm-chatbox[data-theme="dark"] .wm-price-option:hover { border-color: #8b9cf7; background: #1a1a3e; }
.wm-chatbox[data-theme="dark"] .wm-price-label { color: #e0e0e0; }
.wm-chatbox[data-theme="dark"] .wm-price-tag { background: #1a1a3e; color: #8b9cf7; }
.wm-chatbox[data-theme="dark"] .wm-price-card { background: linear-gradient(135deg, #1a1a3e, #16213e); }
.wm-chatbox[data-theme="dark"] .wm-price-amount { color: #8b9cf7; }
.wm-chatbox[data-theme="dark"] .wm-price-features li { color: #bbb; }

/* Registration Form */
.wm-reg-form { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.wm-reg-form input {
    padding: 10px 14px; border: 1.5px solid #e0e0e0; border-radius: 10px;
    font-size: 13px; font-family: 'Poppins', sans-serif; outline: none; transition: border 0.2s;
}
.wm-reg-form input:focus { border-color: #667eea; }
.wm-reg-form button {
    padding: 10px; background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff; border: none; border-radius: 10px; font-size: 13px;
    font-weight: 600; cursor: pointer; font-family: 'Poppins', sans-serif;
    display: flex; align-items: center; justify-content: center; gap: 6px; transition: all 0.2s;
}
.wm-reg-form button:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(102,126,234,0.35); }
.wm-reg-form button:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* Upload Button */
.wm-upload-btn {
    width: 36px; height: 36px; min-width: 36px;
    background: #f0f2ff; color: #667eea;
    border: none; border-radius: 50%; cursor: pointer;
    font-size: 14px; display: inline-flex; align-items: center; justify-content: center;
    transition: all 0.2s; flex-shrink: 0;
}
.wm-upload-btn i {
    animation: none !important;
    transform: none !important;
}

/* Chat Image */
.wm-chat-img {
    max-width: 100%; max-height: 180px; border-radius: 8px;
    cursor: pointer; margin-bottom: 4px; object-fit: cover;
}

/* Service Cards Grid */
.wm-service-grid {
    display: flex; flex-direction: column; gap: 6px; margin-top: 6px; animation: msgIn 0.25s ease;
}
.wm-srv-item {
    background: #fff; border: 1px solid #eee; border-radius: 10px;
    padding: 10px 12px; transition: all 0.2s;
}
.wm-srv-item:hover { border-color: #667eea; box-shadow: 0 2px 8px rgba(102,126,234,0.15); background: #f8f9ff; }
.wm-srv-top {
    display: flex; align-items: center; gap: 8px; margin-bottom: 3px;
}
.wm-srv-top i { color: #667eea; font-size: 14px; width: 18px; text-align: center; }
.wm-srv-top strong { font-size: 12px; color: #1a1a2e; }
.wm-srv-item p { font-size: 10px; color: #888; margin: 0; line-height: 1.4; }

/* Help Buttons Grid */
.wm-help-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 6px; animation: msgIn 0.25s ease;
}
.wm-help-btn {
    display: flex; align-items: center; gap: 6px;
    padding: 10px 12px; background: #fff; border: 1.5px solid #e8e8e8;
    border-radius: 10px; font-size: 11px; font-weight: 600;
    color: #333; cursor: pointer; font-family: 'Poppins', sans-serif;
    transition: all 0.2s;
}
.wm-help-btn i { color: #667eea; font-size: 14px; width: 18px; text-align: center; }
.wm-help-btn:hover { background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; border-color: transparent; }
.wm-help-btn:hover i { color: #fff; }


/* Sub-service Buttons */
.wm-sub-service-grid {
    display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; animation: msgIn 0.25s ease;
}
.wm-sub-srv-btn {
    display: flex; align-items: center; gap: 6px;
    padding: 8px 14px; background: #fff; border: 1.5px solid #764ba2;
    border-radius: 20px; font-size: 11px; font-weight: 600;
    color: #764ba2; cursor: pointer; font-family: 'Poppins', sans-serif;
    transition: all 0.2s;
}
.wm-sub-srv-btn i { font-size: 12px; }
.wm-sub-srv-btn:hover {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff; border-color: transparent; transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(118,75,162,0.3);
}

/* Dark mode sub-service */
.wm-chatbox[data-theme="dark"] .wm-sub-srv-btn { background: #16213e; border-color: #8b9cf7; color: #8b9cf7; }
.wm-chatbox[data-theme="dark"] .wm-sub-srv-btn:hover { background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; border-color: transparent; }

/* Dark mode for new buttons */
.wm-chatbox[data-theme="dark"] .wm-srv-item { background: #16213e; border-color: #2a2a4a; }
.wm-chatbox[data-theme="dark"] .wm-srv-top strong { color: #e0e0e0; }
.wm-chatbox[data-theme="dark"] .wm-srv-item p { color: #888; }
.wm-chatbox[data-theme="dark"] .wm-help-btn { background: #16213e; border-color: #2a2a4a; color: #e0e0e0; }
.wm-chatbox[data-theme="dark"] .wm-help-btn:hover { background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; }

/* Mobile */
@media (max-width: 480px) {
    .wm-chatbox { width: calc(100% - 16px); height: calc(100% - 80px); bottom: 8px; right: 8px; border-radius: 14px; }
    .wm-chat-btn { bottom: 18px; right: 18px; width: 50px; height: 50px; }
    .wm-chat-btn i { font-size: 20px; }
    .wm-chat-btn::after { display: none; }
}
