/* Jak-Cabinet — shared AI chatbot widget */
.chatbot-toggle-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: var(--primary, #8d6e63);
    color: var(--white, #fff);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    border: none;
    z-index: 10000;
    transition: var(--transition, all 0.3s ease);
}
.chatbot-toggle-btn:hover {
    transform: scale(1.08);
    background: var(--primary-dark, #5d4037);
}
.chatbot-container {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 350px;
    max-width: calc(100vw - 2rem);
    background: var(--white, #fff);
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px);
    opacity: 0;
    pointer-events: none;
    transition: var(--transition, all 0.3s ease);
}
.chatbot-container.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
}
.chatbot-header {
    background: var(--primary, #8d6e63);
    color: var(--white, #fff);
    padding: 0.85rem 1rem;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-sans, 'Inter', sans-serif);
}
.chatbot-header-title { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.95rem; }
.chatbot-header-start {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
    min-width: 0;
}
.chatbot-back-btn {
    border: none;
    background: none;
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.72rem;
    font-weight: 500;
    padding: 0;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
    font-family: var(--font-sans, 'Inter', sans-serif);
}
.chatbot-back-btn:hover { color: #fff; }
.chatbot-header--live .chatbot-header-title { font-size: 0.9rem; }
.chatbot-header-actions { display: flex; gap: 0.35rem; }
.chatbot-icon-btn {
    width: 32px; height: 32px; border: none; border-radius: 8px;
    background: rgba(255,255,255,0.12); color: #fff; cursor: pointer;
}
.chatbot-icon-btn:hover { background: rgba(255,255,255,0.22); }
.chatbot-body {
    height: 300px;
    padding: 1rem;
    overflow-y: auto;
    background: #fafafa;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}
.chat-message {
    padding: 0.8rem;
    border-radius: 10px;
    max-width: 80%;
    font-size: 0.9rem;
    line-height: 1.4;
    font-family: var(--font-sans, 'Inter', sans-serif);
}
.chat-message.bot {
    background: #e0e0e0;
    align-self: flex-start;
    border-bottom-left-radius: 2px;
}
.chat-message.typing {
    opacity: 0.7;
    font-style: italic;
}
.chat-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    background: transparent !important;
    padding: 0 0.8rem 0.8rem !important;
    max-width: 100% !important;
}
.chat-action-btn {
    border: 1px solid var(--primary, #8d6e63);
    background: var(--white, #fff);
    color: var(--primary, #8d6e63);
    border-radius: 999px;
    padding: 0.45rem 0.85rem;
    font-size: 0.8rem;
    font-family: var(--font-sans, 'Inter', sans-serif);
    cursor: pointer;
    transition: var(--transition, all 0.3s ease);
}
.chat-action-btn:hover {
    background: var(--primary, #8d6e63);
    color: var(--white, #fff);
}
.chat-action-btn--pdf {
    text-decoration: none;
    display: inline-block;
}
.chat-action-btn--pdf::before {
    content: "📄 ";
}
.chat-message.user {
    background: var(--primary, #8d6e63);
    color: var(--white, #fff);
    align-self: flex-end;
    border-bottom-right-radius: 2px;
}
.chatbot-footer {
    display: flex;
    padding: 0.8rem;
    background: var(--white, #fff);
    border-top: 1px solid #eee;
}
.chatbot-footer input {
    flex: 1;
    padding: 0.8rem;
    border: 1px solid #eee;
    border-radius: 20px;
    outline: none;
    font-family: var(--font-sans, 'Inter', sans-serif);
}
.chatbot-footer button {
    background: none;
    border: none;
    color: var(--primary, #8d6e63);
    font-size: 1.2rem;
    padding: 0 0.8rem;
    cursor: pointer;
}
.chatbot-container--faq .chatbot-body {
    height: 340px;
}
.chat-faq-list {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin-top: 0.15rem;
}
.chat-faq-list.is-collapsed {
    display: none;
}
.chat-faq-btn {
    width: 100%;
    text-align: left;
    border: 1px solid #e6ddd7;
    background: #fff;
    color: #2b211c;
    border-radius: 10px;
    padding: 0.65rem 0.75rem;
    font-size: 0.82rem;
    line-height: 1.35;
    font-family: var(--font-sans, 'Inter', sans-serif);
    cursor: pointer;
    transition: var(--transition, all 0.3s ease);
}
.chat-faq-btn:hover {
    border-color: var(--primary, #8d6e63);
    background: rgba(141, 110, 99, 0.06);
    color: var(--primary-dark, #5d4037);
}
.chatbot-footer--faq {
    padding: 0.75rem;
    border-top: 1px solid #eee;
}
.chat-staff-btn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: none;
    border-radius: 999px;
    padding: 0.75rem 1rem;
    background: var(--primary, #8d6e63);
    color: var(--white, #fff);
    font-size: 0.88rem;
    font-weight: 600;
    font-family: var(--font-sans, 'Inter', sans-serif);
    cursor: pointer;
    transition: var(--transition, all 0.3s ease);
}
.chat-staff-btn:hover {
    background: var(--primary-dark, #5d4037);
}
.admin-body .chatbot-container {
    bottom: 90px;
}
