/* ============================================================================
 * AfroshiftERP — Assistant widget (floating FAQ / help) — store front only
 * Professional, on-brand look for the public shop. Works on mobile + desktop.
 * ========================================================================= */

/* CRITICAL: [hidden] must always win, or the panel can never be minimized. */
.assistant-panel[hidden] { display: none !important; }

.assistant-fab {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    background: #1a1a1a;
    color: #fff;
    font-size: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.30);
    z-index: 9999;
    transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
}
.assistant-fab:hover { background: #000; transform: scale(1.07); box-shadow: 0 10px 30px rgba(0,0,0,.36); }
.assistant-fab:active { transform: scale(.96); }
.assistant-fab:focus-visible { outline: 3px solid #999; outline-offset: 2px; }

/* Fab wiggle "attention" pulse once after load */
@keyframes assistantPulse {
    0%   { box-shadow: 0 0 0 0 rgba(26, 26, 26, .45); }
    70%  { box-shadow: 0 0 0 16px rgba(26, 26, 26, 0); }
    100% { box-shadow: 0 0 0 0 rgba(26, 26, 26, 0); }
}
.assistant-fab { animation: assistantPulse 2.2s ease 1.2s 2; }

.assistant-panel {
    position: fixed;
    right: 20px;
    bottom: 90px;
    width: 380px;
    max-width: calc(100vw - 28px);
    max-height: min(600px, calc(100vh - 120px));
    background: #fff;
    border: 1px solid #e2e2e2;
    border-radius: 18px;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.26);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform-origin: bottom right;
    animation: assistantIn .22s ease;
}
@keyframes assistantIn {
    from { opacity: 0; transform: translateY(14px) scale(.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---- Branded header ---- */
.assistant-head {
    background: #141414;
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 11px;
    flex: 0 0 auto;
}
.assistant-brand-logo {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    object-fit: contain;
    background: #fff;
    padding: 3px;
    flex: 0 0 auto;
}
.assistant-head-titles { flex: 1; min-width: 0; }
.assistant-head-title { font-weight: 800; font-size: 14.5px; letter-spacing: -.2px; display: flex; align-items: center; gap: 7px; }
.assistant-head-sub { font-size: 11px; opacity: .72; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.assistant-close {
    background: rgba(255, 255, 255, .12);
    border: none;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    transition: background .15s ease;
}
.assistant-close:hover { background: rgba(255, 255, 255, .26); }
.assistant-close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* ---- Body ---- */
.assistant-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 9px;
    background: #fafafa;
}
.assistant-msg {
    max-width: 88%;
    padding: 10px 13px;
    border-radius: 14px;
    font-size: 13.5px;
    line-height: 1.6;
    word-wrap: break-word;
    white-space: pre-line;
}
.assistant-bot { background: #ececec; color: #1f1f1f; align-self: flex-start; border-bottom-left-radius: 5px; }
.assistant-user { background: #1a1a1a; color: #fff; align-self: flex-end; border-bottom-right-radius: 5px; }

.assistant-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    padding: 4px 2px 8px;
}
.assistant-chip {
    border: 1px solid #d6d6d6;
    background: #fff;
    color: #333;
    border-radius: 999px;
    padding: 7px 13px;
    font-size: 12.5px;
    cursor: pointer;
    transition: all .15s ease;
}
.assistant-chip:hover { background: #141414; border-color: #141414; color: #fff; transform: translateY(-1px); }
.assistant-chip:focus-visible { outline: 2px solid #777; outline-offset: 1px; }

/* ---- Input ---- */
.assistant-input {
    display: flex;
    gap: 9px;
    padding: 12px;
    border-top: 1px solid #e8e8e8;
    background: #fff;
    flex: 0 0 auto;
}
.assistant-input input {
    flex: 1;
    border: 1px solid #d4d4d4;
    border-radius: 999px;
    padding: 11px 16px;
    font-size: 13.5px;
    outline: none;
    background: #fafafa;
    color: #1f1f1f;
    transition: border-color .15s ease, background .15s ease;
}
.assistant-input input:focus { border-color: #555; background: #fff; }
.assistant-input button {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: #141414;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    flex: 0 0 auto;
    transition: background .15s ease, transform .15s ease;
}
.assistant-input button:hover { background: #000; transform: scale(1.05); }
.assistant-input button:focus-visible { outline: 2px solid #777; }

/* ---- Footer contact row ---- */
.assistant-foot {
    flex: 0 0 auto;
    background: #fff;
    border-top: 1px solid #ececec;
    padding: 9px 14px;
    font-size: 11.5px;
    color: #777;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.assistant-foot a { color: #333; font-weight: 600; text-decoration: none; }
.assistant-foot a:hover { text-decoration: underline; }

/* ---- Mobile: bottom-sheet feel ---- */
@media (max-width: 520px) {
    .assistant-fab { right: 14px; bottom: 14px; width: 54px; height: 54px; }
    .assistant-panel {
        left: 10px;
        right: 10px;
        bottom: 12px;
        width: auto;
        max-width: none;
        max-height: min(72vh, 560px);
        border-radius: 20px;
        transform-origin: bottom center;
    }
    .assistant-head { padding: 13px 14px; }
}
