/* ===== Floating Chatbot Widget - ToolsHub theme (#00d09c) ===== */
#chatbot-root {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Toggle button */
.chatbot-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    background: linear-gradient(135deg, #00d09c, #00a87a);
    color: #fff;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 208, 156, 0.35);
    font-size: 14px;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
    line-height: 1;
}

.chatbot-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(0, 208, 156, 0.45);
}

.chatbot-toggle i {
    font-size: 18px;
}

/* Panel hidden by default; shown when .is-open is on #chatbot-root */
.chatbot-panel {
    display: none;
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 380px;
    max-width: calc(100vw - 32px);
    height: 520px;
    max-height: calc(100vh - 120px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
    flex-direction: column;
    overflow: hidden;
}

#chatbot-root.is-open .chatbot-panel {
    display: flex;
    animation: chatbotSlideUp 0.25s ease-out;
}

#chatbot-root.is-open .chatbot-toggle .chatbot-toggle-label {
    display: none;
}

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

/* Header */
.chatbot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: linear-gradient(135deg, #00d09c, #00a87a);
    color: #fff;
}

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

.chatbot-header-info > i {
    font-size: 22px;
    background: rgba(255, 255, 255, 0.18);
    padding: 8px;
    border-radius: 50%;
}

.chatbot-title {
    font-weight: 700;
    font-size: 15px;
    line-height: 1.2;
}

.chatbot-subtitle {
    font-size: 12px;
    opacity: 0.9;
    margin-top: 2px;
}

.chatbot-close {
    background: transparent;
    color: #fff;
    border: none;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    padding: 0;
    line-height: 1;
}

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

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

.chatbot-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.chatbot-msg.bot {
    align-self: flex-start;
    background: #fff;
    color: #1a1a1a;
    border: 1px solid #e5e9ec;
    border-bottom-left-radius: 4px;
}

.chatbot-msg.bot a {
    color: #00a87a;
    font-weight: 600;
    text-decoration: underline;
}

.chatbot-msg.bot a:hover {
    color: #00d09c;
}

.chatbot-msg.user {
    align-self: flex-end;
    background: linear-gradient(135deg, #00d09c, #00a87a);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.chatbot-msg.bot.typing {
    color: #777;
    font-style: italic;
}

.chatbot-msg.error {
    align-self: stretch;
    background: #fff4f4;
    color: #b00020;
    border: 1px solid #f5c6c6;
    text-align: center;
    font-size: 13px;
}

/* Quota bar */
.chatbot-quota {
    padding: 6px 16px;
    background: #fff7e6;
    color: #92400e;
    font-size: 12px;
    text-align: center;
    border-top: 1px solid #fde68a;
}

/* Form */
.chatbot-form {
    display: flex;
    gap: 8px;
    padding: 12px;
    background: #fff;
    border-top: 1px solid #e5e9ec;
}

.chatbot-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 22px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.15s;
    font-family: inherit;
}

.chatbot-input:focus {
    border-color: #00d09c;
    box-shadow: 0 0 0 3px rgba(0, 208, 156, 0.15);
}

.chatbot-send {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #00d09c, #00a87a);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.15s;
    padding: 0;
}

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

.chatbot-send:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.chatbot-footer {
    padding: 8px 12px;
    font-size: 11px;
    color: #888;
    text-align: center;
    background: #fafafa;
    border-top: 1px solid #f0f0f0;
}

/* Quick action chips inside bot messages */
.chatbot-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.chatbot-actions a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: #e6f9f4;
    color: #00a87a;
    border: 1px solid #b3eddc;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.chatbot-actions a:hover {
    background: #00d09c;
    color: #fff;
}

/* Mobile */
@media (max-width: 480px) {
    #chatbot-root {
        bottom: 12px;
        right: 12px;
    }
    .chatbot-toggle-label {
        display: none;
    }
    .chatbot-toggle {
        width: 56px;
        height: 56px;
        padding: 0;
        justify-content: center;
        border-radius: 50%;
    }
    .chatbot-toggle i {
        font-size: 22px;
    }
    .chatbot-panel {
        position: fixed;
        bottom: 80px;
        right: 12px;
        left: 12px;
        width: auto;
        max-width: none;
        height: calc(100vh - 100px);
    }
}
