/* Chatbot Widget Styles */
.chatbot-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    font-family: system-ui, -apple-system, sans-serif;
}

.chatbot-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(30, 64, 175, 0.4);
    transition: all 0.3s ease;
}

.chatbot-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 25px rgba(30, 64, 175, 0.5);
}

.chatbot-window {
    position: absolute;
    bottom: 75px;
    right: 0;
    width: 380px;
    max-width: calc(100vw - 48px);
    height: 520px;
    max-height: calc(100vh - 120px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.chatbot-window.open {
    display: flex;
    animation: chatbotSlideIn 0.3s ease;
}

@keyframes chatbotSlideIn {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.chatbot-header {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    color: #fff;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chatbot-header__info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chatbot-header__avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    padding: 6px;
}

.chatbot-header__title {
    font-weight: 600;
    font-size: 15px;
}

.chatbot-header__status {
    font-size: 12px;
    opacity: 0.9;
}

.chatbot-header__close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.chatbot-header__close:hover {
    background: rgba(255,255,255,0.3);
}

.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f8fafc;
}

.chatbot-message {
    max-width: 85%;
    animation: messageIn 0.3s ease;
}

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

.chatbot-message--bot {
    align-self: flex-start;
}

.chatbot-message--user {
    align-self: flex-end;
}

.chatbot-message__content {
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
}

.chatbot-message--bot .chatbot-message__content {
    background: #fff;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 4px;
}

.chatbot-message--user .chatbot-message__content {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.chatbot-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.chatbot-quick-reply {
    background: #fff;
    border: 1px solid #1e40af;
    color: #1e40af;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.chatbot-quick-reply:hover {
    background: #1e40af;
    color: #fff;
}

.chatbot-input {
    padding: 12px 16px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 10px;
    background: #fff;
}

.chatbot-input input {
    flex: 1;
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    padding: 10px 16px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.chatbot-input input:focus {
    border-color: #1e40af;
}

.chatbot-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.chatbot-send:hover {
    transform: scale(1.05);
}

.chatbot-contact-panel {
    position: absolute;
    inset: 0;
    background: #fff;
    z-index: 10;
    display: flex;
    flex-direction: column;
}

.chatbot-contact-panel__header {
    padding: 16px;
    border-bottom: 1px solid #e2e8f0;
}

.chatbot-contact-panel__back {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    color: #1e40af;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.chatbot-contact-panel__content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chatbot-contact-panel__content h4 {
    margin: 0;
    font-size: 18px;
    color: #0f172a;
}

.chatbot-contact-panel__content p {
    margin: 0;
    color: #64748b;
    font-size: 14px;
}

.chatbot-contact-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    transition: all 0.2s;
}

.chatbot-contact-btn--whatsapp {
    background: #25d366;
    color: #fff;
}

.chatbot-contact-btn--whatsapp:hover {
    background: #1da851;
}

.chatbot-contact-btn--email {
    background: #1e40af;
    color: #fff;
}

.chatbot-contact-btn--email:hover {
    background: #1e3a8a;
}

.chatbot-contact-btn--form {
    background: #f1f5f9;
    color: #1e293b;
    border: 1px solid #e2e8f0;
}

.chatbot-contact-btn--form:hover {
    background: #e2e8f0;
}

/* Email Form Panel */
.chatbot-email-panel {
    position: absolute;
    inset: 0;
    background: #fff;
    z-index: 11;
    display: flex;
    flex-direction: column;
}

.chatbot-email-panel__back {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    color: #1e40af;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.chatbot-email-panel__content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
}

.chatbot-email-panel__content h4 {
    margin: 0 0 8px 0;
    font-size: 18px;
    color: #0f172a;
}

.chatbot-email-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chatbot-form-group input,
.chatbot-form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.chatbot-form-group input:focus,
.chatbot-form-group textarea:focus {
    outline: none;
    border-color: #1e40af;
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.chatbot-form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.chatbot-email-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.chatbot-email-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.3);
}

.chatbot-email-submit:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.chatbot-email-status {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    text-align: center;
    display: none;
}

.chatbot-email-status.success {
    display: block;
    background: #d1fae5;
    color: #065f46;
}

.chatbot-email-status.error {
    display: block;
    background: #fee2e2;
    color: #991b1b;
}

.chatbot-email-status.loading {
    display: block;
    background: #e0f2fe;
    color: #0369a1;
}

/* Button style for email btn (not link) */
button.chatbot-contact-btn--email {
    width: 100%;
    border: none;
    cursor: pointer;
    text-align: left;
}

/* Status dot */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    margin-right: 6px;
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Topic buttons grid */
.chatbot-topics {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0;
}
.chatbot-topic-btn, [data-topic] {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 13px;
    color: #1e293b;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}
.chatbot-topic-btn:hover, [data-topic]:hover {
    background: #1e40af;
    color: #fff;
    border-color: #1e40af;
}
.topic-icon { font-size: 16px; }
.chatbot-hint, .hint { color: #64748b; font-size: 12px; margin-top: 8px; }

/* AI Response styling */
.ai-resp { line-height: 1.6; }
.ai-resp p { margin: 8px 0; }
.ai-resp ul { margin: 8px 0; padding-left: 20px; }
.ai-resp li { margin: 4px 0; }
.ai-resp strong { color: #1e40af; }

/* Highlight box */
.hl {
    background: linear-gradient(135deg, #dbeafe 0%, #e0f2fe 100%);
    border: 1px solid #93c5fd;
    border-radius: 10px;
    padding: 12px 16px;
    margin: 10px 0;
    font-weight: 500;
    color: #1e40af;
}

/* Account options */
.opt {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px 14px;
    margin: 8px 0;
}

/* Feature grid */
.feat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin: 12px 0;
}
.feat-grid span {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}
.feat-grid span:hover {
    background: #1e40af;
    color: #fff;
    border-color: #1e40af;
}

/* Pricing cards */
.plans {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 10px 0;
}
.plan {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
}

/* Follow-up buttons */
.followup {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
}
.followup span {
    display: block;
    font-size: 11px;
    color: #64748b;
    margin-bottom: 8px;
}
.followup button {
    display: inline-block;
    padding: 6px 12px;
    margin: 3px 4px 3px 0;
    background: #fff;
    border: 1px solid #1e40af;
    border-radius: 16px;
    font-size: 12px;
    color: #1e40af;
    cursor: pointer;
    transition: all 0.2s;
}
.followup button:hover {
    background: #1e40af;
    color: #fff;
}

/* CTA link */
.cta-link {
    display: inline-block;
    color: #1e40af;
    font-weight: 600;
    text-decoration: none;
}
.cta-link:hover {
    text-decoration: underline;
}

/* Phone contact button */
.chatbot-contact-btn--phone {
    background: #f1f5f9;
    color: #1e293b;
    border: 1px solid #e2e8f0;
}
.chatbot-contact-btn--phone:hover {
    background: #e2e8f0;
}

@media (max-width: 480px) {
    .chatbot-widget {
        bottom: 16px;
        right: 16px;
    }
    .chatbot-toggle {
        width: 48px;
        height: 48px;
    }
    .chatbot-toggle svg {
        width: 22px;
        height: 22px;
    }
    .chatbot-window {
        width: calc(100vw - 32px);
        height: calc(100vh - 100px);
        bottom: 60px;
        right: -8px;
    }
    .feat-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .chatbot-toggle {
        width: 52px;
        height: 52px;
    }
    .chatbot-toggle svg {
        width: 24px;
        height: 24px;
    }
}
