/* Help Bolt — Knowledge Base AI Widget */
#help-bolt-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* Trigger Button */
#help-bolt-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px 12px 14px;
    border-radius: 50px;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 8px 28px rgba(0,0,0,0.2);
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.3s;
    border: none;
    position: relative;
}
#help-bolt-trigger:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 12px 36px rgba(0,0,0,0.25);
}
#help-bolt-trigger.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.8);
}

#help-bolt-trigger-avatar {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}
#help-bolt-trigger-avatar svg {
    width: 100%;
    height: 100%;
    display: block;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}
#help-bolt-trigger-label {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

/* Panel */
#help-bolt-panel {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 380px;
    height: 560px;
    max-height: 80vh;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(15,23,42,0.2);
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: scale(0.9) translateY(20px);
    transform-origin: bottom right;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
    border: 1px solid #e2e8f0;
}
#help-bolt-panel.open {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: all;
}

/* Header */
#help-bolt-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    color: #fff;
    flex-shrink: 0;
}
#help-bolt-header-avatar {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}
#help-bolt-header-avatar svg {
    width: 100%;
    height: 100%;
    display: block;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
}
#help-bolt-header-info {
    flex: 1;
    min-width: 0;
}
#help-bolt-header-name {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
}
#help-bolt-header-status {
    font-size: 11px;
    opacity: 0.85;
    margin-top: 1px;
}
#help-bolt-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: #fff;
    font-size: 22px;
    line-height: 1;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
    padding: 0;
}
#help-bolt-close:hover {
    background: rgba(255,255,255,0.35);
}

/* Message Area */
#help-bolt-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #f8fafc;
}
#help-bolt-messages::-webkit-scrollbar {
    width: 4px;
}
#help-bolt-messages::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

/* Message Bubbles */
.help-bolt-message {
    display: flex;
    gap: 10px;
    max-width: 90%;
    animation: helpBoltFadeIn 0.3s ease;
}
@keyframes helpBoltFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.help-bolt-bot {
    align-self: flex-start;
}
.help-bolt-user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.help-bolt-msg-avatar {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    margin-top: 2px;
}
.help-bolt-msg-avatar svg {
    width: 100%;
    height: 100%;
    display: block;
}
.help-bolt-msg-content {
    background: #fff;
    padding: 10px 14px;
    border-radius: 14px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    border: 1px solid #e2e8f0;
}
.help-bolt-user .help-bolt-msg-content {
    background: #0ea5e9;
    border-color: #0ea5e9;
    color: #fff;
}
.help-bolt-msg-sender {
    font-size: 11px;
    font-weight: 700;
    color: #0ea5e9;
    margin-bottom: 3px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.help-bolt-user .help-bolt-msg-sender {
    display: none;
}
.help-bolt-msg-text {
    font-size: 13.5px;
    line-height: 1.6;
    color: #1e293b;
}
.help-bolt-msg-text strong {
    color: #0f172a;
}
.help-bolt-user .help-bolt-msg-text {
    color: #fff;
}
.help-bolt-msg-text br {
    margin-bottom: 4px;
    content: '';
    display: block;
}
.help-bolt-msg-categories {
    margin-top: 10px;
    font-size: 12px;
    color: #64748b;
}

/* Category Buttons */
#help-bolt-categories {
    padding: 0 16px 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex-shrink: 0;
}
.help-bolt-cat-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 50px;
    border: 1.5px solid #e2e8f0;
    background: #fff;
    font-size: 12px;
    font-weight: 600;
    color: #334155;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}
.help-bolt-cat-btn:hover {
    border-color: #0ea5e9;
    color: #0ea5e9;
    background: #f0f9ff;
}
.help-bolt-cat-count {
    background: #f1f5f9;
    padding: 0 7px;
    border-radius: 50px;
    font-size: 11px;
    color: #64748b;
    font-weight: 600;
}
.help-bolt-cat-btn:hover .help-bolt-cat-count {
    background: #dbeafe;
    color: #0ea5e9;
}

/* Quick Question Buttons */
.help-bolt-quick-qs {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0 16px 4px;
    animation: helpBoltFadeIn 0.3s ease;
}
.help-bolt-q-btn {
    text-align: left;
    padding: 8px 14px;
    border-radius: 10px;
    border: 1.5px solid #e2e8f0;
    background: #fff;
    font-size: 12.5px;
    font-weight: 500;
    color: #334155;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    line-height: 1.4;
}
.help-bolt-q-btn:hover {
    border-color: #0ea5e9;
    background: #f0f9ff;
    color: #0369a1;
}

/* Input Area */
#help-bolt-input-area {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid #e2e8f0;
    background: #fff;
    flex-shrink: 0;
}
#help-bolt-input {
    flex: 1;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
    background: #f8fafc;
}
#help-bolt-input:focus {
    border-color: #0ea5e9;
    background: #fff;
}
#help-bolt-input::placeholder {
    color: #94a3b8;
}
#help-bolt-send {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: none;
    background: #0ea5e9;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
    flex-shrink: 0;
    padding: 0;
}
#help-bolt-send:hover {
    background: #0284c7;
    transform: scale(1.05);
}
#help-bolt-send svg {
    display: block;
}

/* Responsive */
@media (max-width: 480px) {
    #help-bolt-panel {
        width: calc(100vw - 24px);
        height: 70vh;
        right: 0;
        bottom: 0;
        border-radius: 16px;
    }
    #help-bolt-trigger {
        padding: 10px 16px 10px 12px;
    }
    #help-bolt-trigger-label {
        font-size: 13px;
    }
}

/* Toast overrides */
.help-bolt-toast {
    position: fixed;
    bottom: 80px;
    right: 24px;
    z-index: 10000;
    background: #0f172a;
    color: #fff;
    padding: 10px 18px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    animation: helpBoltFadeIn 0.3s ease;
}

/* Typing Indicator */
.help-bolt-typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 0;
}
.help-bolt-typing-indicator span {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #94a3b8;
    animation: helpBoltTyping 1.4s infinite ease-in-out;
}
.help-bolt-typing-indicator span:nth-child(1) { animation-delay: 0s; }
.help-bolt-typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.help-bolt-typing-indicator span:nth-child(3) { animation-delay: 0.4s; }
@keyframes helpBoltTyping {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-6px); opacity: 1; }
}

/* Suggestion buttons (post-answer) */
.help-bolt-suggestion-btn {
    text-align: left;
    padding: 7px 12px;
    border-radius: 8px;
    border: 1.5px solid #e2e8f0;
    background: #fff;
    font-size: 12px;
    color: #334155;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    line-height: 1.3;
}
.help-bolt-suggestion-btn:hover {
    background: #f0f9ff;
    border-color: #0ea5e9;
    color: #0369a1;
}

/* Feedback Buttons */
.help-bolt-feedback {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 16px 2px;
    animation: helpBoltFadeIn 0.3s ease;
}
.help-bolt-feedback-label {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 500;
}
.help-bolt-feedback-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1.5px solid #e2e8f0;
    background: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
    color: #94a3b8;
}
.help-bolt-feedback-btn:hover {
    transform: scale(1.15);
}
.help-bolt-feedback-up:hover {
    border-color: #059669;
    color: #059669;
    background: #f0fdf4;
}
.help-bolt-feedback-down:hover {
    border-color: #dc2626;
    color: #dc2626;
    background: #fef2f2;
}
.help-bolt-feedback-thanks {
    font-size: 11px;
    color: #64748b;
    font-style: italic;
    line-height: 1.3;
}
