/* ── OHB Chatbot Widget ── */

/* Floating Bubble */
#ohb-chatbot-bubble {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0d6efd, #6610f2);
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(13,110,253,0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
}
#ohb-chatbot-bubble:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 24px rgba(13,110,253,0.45);
}
#ohb-chatbot-bubble .chatbot-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #dc3545;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
}
[data-bs-theme="dark"] #ohb-chatbot-bubble .chatbot-badge {
    border-color: #212529;
}

/* Chat Panel */
#ohb-chatbot-panel {
    position: fixed;
    bottom: 90px;
    right: 24px;
    z-index: 9998;
    width: 380px;
    max-height: 520px;
    border-radius: 16px;
    overflow: hidden;
    display: none;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    font-family: 'Inter', sans-serif;
    animation: chatbotSlideUp 0.25s ease;
}
#ohb-chatbot-panel.open {
    display: flex;
}
@keyframes chatbotSlideUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Light theme */
#ohb-chatbot-panel[data-theme="light"] {
    background: #fff;
    border: 1px solid #dee2e6;
}
#ohb-chatbot-panel[data-theme="light"] .chatbot-header {
    background: linear-gradient(135deg, #0d6efd, #6610f2);
    color: #fff;
}
#ohb-chatbot-panel[data-theme="light"] .chatbot-msg-bot {
    background: #f1f3f5;
    color: #212529;
}
#ohb-chatbot-panel[data-theme="light"] .chatbot-msg-user {
    background: #0d6efd;
    color: #fff;
}
#ohb-chatbot-panel[data-theme="light"] .chatbot-input-area {
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
}
#ohb-chatbot-panel[data-theme="light"] .chatbot-input {
    background: #fff;
    color: #212529;
    border: 1px solid #dee2e6;
}
#ohb-chatbot-panel[data-theme="light"] .chatbot-quick-btn {
    background: #e9ecef;
    color: #0d6efd;
    border: 1px solid #dee2e6;
}
#ohb-chatbot-panel[data-theme="light"] .chatbot-quick-btn:hover {
    background: #0d6efd;
    color: #fff;
    border-color: #0d6efd;
}
#ohb-chatbot-panel[data-theme="light"] .chatbot-search {
    background: #fff;
    color: #212529;
    border: 1px solid #dee2e6;
}

/* Dark theme */
#ohb-chatbot-panel[data-theme="dark"] {
    background: #212529;
    border: 1px solid #495057;
}
#ohb-chatbot-panel[data-theme="dark"] .chatbot-header {
    background: linear-gradient(135deg, #0d6efd, #6610f2);
    color: #fff;
}
#ohb-chatbot-panel[data-theme="dark"] .chatbot-msg-bot {
    background: #343a40;
    color: #e9ecef;
}
#ohb-chatbot-panel[data-theme="dark"] .chatbot-msg-user {
    background: #0d6efd;
    color: #fff;
}
#ohb-chatbot-panel[data-theme="dark"] .chatbot-input-area {
    background: #2b3035;
    border-top: 1px solid #495057;
}
#ohb-chatbot-panel[data-theme="dark"] .chatbot-input {
    background: #343a40;
    color: #e9ecef;
    border: 1px solid #495057;
}
#ohb-chatbot-panel[data-theme="dark"] .chatbot-quick-btn {
    background: #343a40;
    color: #6ea8fe;
    border: 1px solid #495057;
}
#ohb-chatbot-panel[data-theme="dark"] .chatbot-quick-btn:hover {
    background: #0d6efd;
    color: #fff;
    border-color: #0d6efd;
}
#ohb-chatbot-panel[data-theme="dark"] .chatbot-search {
    background: #343a40;
    color: #e9ecef;
    border: 1px solid #495057;
}

/* Header */
.chatbot-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    gap: 10px;
}
.chatbot-header-title {
    flex: 1;
    font-weight: 600;
    font-size: 0.9rem;
}
.chatbot-header-sub {
    font-size: 0.7rem;
    opacity: 0.85;
    font-weight: 400;
}
.chatbot-header-btn {
    background: none;
    border: none;
    color: inherit;
    font-size: 1rem;
    cursor: pointer;
    padding: 4px;
    opacity: 0.8;
}
.chatbot-header-btn:hover {
    opacity: 1;
}

/* Lang Selector */
.chatbot-lang-bar {
    display: flex;
    gap: 4px;
    padding: 6px 16px;
    border-bottom: 1px solid rgba(128,128,128,0.2);
}
.chatbot-lang-btn {
    font-size: 0.65rem;
    padding: 2px 8px;
    border-radius: 10px;
    border: 1px solid rgba(128,128,128,0.3);
    background: transparent;
    color: inherit;
    cursor: pointer;
    font-weight: 500;
    opacity: 0.7;
}
.chatbot-lang-btn.active {
    background: #0d6efd;
    color: #fff;
    border-color: #0d6efd;
    opacity: 1;
}

/* Messages Area */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 200px;
    max-height: 320px;
    scroll-behavior: smooth;
}
.chatbot-messages::-webkit-scrollbar {
    width: 4px;
}
.chatbot-messages::-webkit-scrollbar-thumb {
    background: rgba(128,128,128,0.3);
    border-radius: 4px;
}

/* Message Bubbles */
.chatbot-msg {
    max-width: 88%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.82rem;
    line-height: 1.45;
    word-wrap: break-word;
}
.chatbot-msg-bot {
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}
.chatbot-msg-user {
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}
.chatbot-msg-bot a,
.chatbot-msg-bot a:visited {
    color: #0d6efd;
    text-decoration: underline;
}
[data-bs-theme="dark"] .chatbot-msg-bot a,
[data-bs-theme="dark"] .chatbot-msg-bot a:visited {
    color: #6ea8fe;
}
.chatbot-msg-typing {
    display: flex;
    gap: 4px;
    padding: 12px 14px;
}
.chatbot-msg-typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #6c757d;
    animation: chatbotDot 1.2s infinite;
}
.chatbot-msg-typing span:nth-child(2) { animation-delay: 0.2s; }
.chatbot-msg-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes chatbotDot {
    0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
    40% { opacity: 1; transform: scale(1); }
}

/* Quick Actions */
.chatbot-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 4px 16px 8px;
}
.chatbot-quick-btn {
    font-size: 0.75rem;
    padding: 5px 12px;
    border-radius: 14px;
    border: 1px solid;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.15s;
    white-space: nowrap;
}
.chatbot-quick-btn i {
    margin-right: 4px;
    font-size: 0.7rem;
}

/* Search */
.chatbot-search-area {
    padding: 8px 16px;
}
.chatbot-search {
    width: 100%;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 0.8rem;
    outline: none;
}
.chatbot-search::placeholder {
    opacity: 0.5;
}

/* Input Area */
.chatbot-input-area {
    display: flex;
    padding: 10px 12px;
    gap: 8px;
    align-items: center;
}
.chatbot-input {
    flex: 1;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 0.82rem;
    outline: none;
}
.chatbot-send {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #0d6efd;
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
    transition: background 0.15s;
}
.chatbot-send:hover {
    background: #0b5ed7;
}

/* Auto-tip toast (mini notification) */
#ohb-chatbot-toast {
    position: fixed;
    bottom: 90px;
    right: 24px;
    z-index: 9997;
    background: linear-gradient(135deg, #0d6efd, #6610f2);
    color: #fff;
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 0.8rem;
    max-width: 320px;
    box-shadow: 0 4px 16px rgba(13,110,253,0.3);
    cursor: pointer;
    display: none;
    animation: chatbotSlideUp 0.3s ease;
    font-family: 'Inter', sans-serif;
}
#ohb-chatbot-toast.show {
    display: block;
}

/* Mobile */
@media (max-width: 576px) {
    #ohb-chatbot-panel {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        max-height: 75vh;
        border-radius: 16px 16px 0 0;
    }
    #ohb-chatbot-bubble {
        bottom: 16px;
        right: 16px;
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
    }
    #ohb-chatbot-toast {
        right: 16px;
        bottom: 80px;
        max-width: calc(100vw - 32px);
    }
    .chatbot-messages {
        max-height: 50vh;
    }
}
