/* 360Dot add-on styles: site search + AI chat widget */

:root {
    --addon-theme: #00acd5;
    --addon-theme-2: #0089aa;
    --addon-dark: #061822;
    --addon-bg: #F3F7FB;
    --addon-text: #585858;
}

/* ============ Site search toggle (header) ============ */
.header-search-box { margin-left: 6px; margin-right: 6px; }
.site-search-toggle {
    background: transparent;
    border: 0;
    color: var(--addon-dark);
    font-size: 17px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all .3s ease;
    line-height: 1;
    padding: 0;
}
.site-search-toggle:hover { background: rgba(0, 172, 213, .12); color: var(--addon-theme); }

/* ============ Search overlay / modal ============ */
.site-search__overlay {
    position: fixed;
    inset: 0;
    background: rgba(6, 24, 34, .65);
    z-index: 9998;
    display: none;
    overflow-y: auto;
}
.site-search__overlay.open { display: block; }
.site-search__box {
    max-width: 660px;
    margin: 9vh auto 40px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 24px 70px rgba(6, 24, 34, .35);
    overflow: hidden;
}
.site-search__bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--addon-bg);
}
.site-search__bar i { color: var(--addon-theme); font-size: 18px; }
.site-search__bar input {
    border: 0;
    outline: 0;
    flex: 1;
    font-size: 17px;
    font-family: inherit;
    color: var(--addon-dark);
    background: transparent;
}
.site-search__bar input::placeholder { color: #98a3aa; }
.site-search__esc {
    border: 1px solid #d9e2e8;
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 11px;
    color: #8a96a0;
    letter-spacing: .5px;
}
.site-search__results { max-height: 50vh; overflow-y: auto; }
.site-search__msg {
    padding: 26px 20px;
    text-align: center;
    color: #8a96a0;
    font-size: 14px;
}
.site-search__result {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 13px 20px;
    cursor: pointer;
    border-bottom: 1px solid #f0f4f7;
    transition: background .2s ease;
    font-family: inherit;
    background: transparent;
    border-left: 0;
    border-right: 0;
    border-top: 0;
    width: 100%;
    text-align: left;
}
.site-search__result:hover,
.site-search__result.active { background: var(--addon-bg); }
.site-search__result i { color: var(--addon-theme); margin-top: 4px; }
.site-search__result h6 { margin: 0; font-size: 15px; color: var(--addon-dark); font-weight: 600; }
.site-search__result h6 mark { background: #ffe9a8; color: inherit; padding: 0 2px; }
.site-search__result p { margin: 2px 0 0; font-size: 12.5px; color: var(--addon-text); }

/* ============ Chat widget ============ */
.chatbot-fab {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: var(--addon-theme);
    color: #fff;
    font-size: 24px;
    border: 0;
    box-shadow: 0 10px 28px rgba(0, 172, 213, .45);
    cursor: pointer;
    z-index: 9990;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .25s ease, background .25s ease;
}
.chatbot-fab:hover { background: var(--addon-theme-2); transform: translateY(-2px); }
.chatbot-fab .fab-close { display: none; }
.chatbot-fab.open .fab-open { display: none; }
.chatbot-fab.open .fab-close { display: block; }
.chatbot-fab::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid rgba(0, 172, 213, .55);
    animation: chatbot-pulse 2.2s infinite;
    pointer-events: none;
}
@keyframes chatbot-pulse {
    0% { transform: scale(1); opacity: .9; }
    70% { transform: scale(1.45); opacity: 0; }
    100% { transform: scale(1.45); opacity: 0; }
}

.chatbot-panel {
    position: fixed;
    right: 24px;
    bottom: 96px;
    width: 380px;
    max-width: calc(100vw - 32px);
    height: min(560px, calc(100vh - 130px));
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 30px 80px rgba(6, 24, 34, .35);
    z-index: 9991;
    display: none;
    flex-direction: column;
    overflow: hidden;
    font-family: inherit;
}
.chatbot-panel.open { display: flex; }

.chatbot-head {
    background: var(--addon-dark);
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.chatbot-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--addon-theme);
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
}
.chatbot-head-copy { flex: 1; min-width: 0; }
.chatbot-head-copy h4 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: .2px; }
.chatbot-head-copy p { margin: 1px 0 0; font-size: 11.5px; color: rgba(255,255,255,.65); }
.chatbot-close {
    background: rgba(255,255,255,.12);
    color: #fff;
    border: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 13px;
}
.chatbot-close:hover { background: var(--addon-theme); }

.chatbot-body { flex: 1; overflow-y: auto; background: #fbfdfe; padding: 14px; }

.chatbot-msgs { display: flex; flex-direction: column; gap: 10px; }
.msg {
    max-width: 82%;
    padding: 9px 13px;
    border-radius: 12px;
    font-size: 13.5px;
    line-height: 1.5;
    word-break: break-word;
    animation: msg-in .25s ease;
}
@keyframes msg-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.msg.user {
    align-self: flex-end;
    background: var(--addon-theme);
    color: #fff;
    border-bottom-right-radius: 4px;
}
.msg.bot {
    align-self: flex-start;
    background: #eef4f8;
    color: var(--addon-dark);
    border-bottom-left-radius: 4px;
}
.msg .msg-time { display: block; font-size: 10px; opacity: .65; margin-top: 4px; }

.typing { align-self: flex-start; background: #eef4f8; border-radius: 12px; border-bottom-left-radius: 4px; padding: 11px 14px; display: flex; gap: 5px; }
.typing span {
    width: 7px; height: 7px; border-radius: 50%; background: var(--addon-theme);
    animation: typing-dot 1s infinite ease-in-out;
}
.typing span:nth-child(2) { animation-delay: .15s; }
.typing span:nth-child(3) { animation-delay: .3s; }
@keyframes typing-dot { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }

.chatbot-gate {
    text-align: center;
    padding: 26px 22px 18px;
}
.chatbot-gate h5 { font-size: 16px; color: var(--addon-dark); margin: 0 0 4px; font-weight: 700; }
.chatbot-gate p { font-size: 12.5px; color: var(--addon-text); margin: 0 0 18px; line-height: 1.55; }
.chatbot-field { text-align: left; margin-bottom: 12px; }
.chatbot-field label { font-size: 11.5px; color: var(--addon-text); margin-bottom: 5px; display: block; font-weight: 600; }
.chatbot-field input {
    width: 100%;
    border: 1px solid #dbe4ea;
    border-radius: 9px;
    padding: 10px 13px;
    font-size: 14px;
    font-family: inherit;
    outline: 0;
    background: #fff;
    color: var(--addon-dark);
}
.chatbot-field input:focus { border-color: var(--addon-theme); box-shadow: 0 0 0 3px rgba(0,172,213,.15); }
.chatbot-btn {
    width: 100%;
    background: var(--addon-theme);
    color: #fff;
    border: 0;
    border-radius: 9px;
    padding: 11px 14px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background .2s ease;
}
.chatbot-btn:hover { background: var(--addon-theme-2); }
.chatbot-btn:disabled { opacity: .55; cursor: not-allowed; }
.chatbot-error { font-size: 12px; color: #d33b3b; margin: 4px 0 0; text-align: left; display: none; }
.chatbot-error.show { display: block; }
.chatbot-link { background: none; border: 0; color: var(--addon-theme); font-size: 12.5px; cursor: pointer; text-decoration: underline; font-family: inherit; }
.chatbot-link:disabled { color: #9aa7af; cursor: not-allowed; text-decoration: none; }
.chatbot-userchip {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    background: rgba(0,172,213,.08); border: 1px solid rgba(0,172,213,.25);
    color: var(--addon-theme-2); font-size: 11.5px; border-radius: 20px; padding: 4px 12px; margin-bottom: 10px;
}
.chatbot-userchip button { background: none; border: 0; color: inherit; cursor: pointer; font-weight: 700; font-family: inherit; }
.chatbot-foot {
    display: flex; gap: 8px; padding: 12px; border-top: 1px solid #eef2f5; background: #fff;
}
.chatbot-foot input {
    flex: 1; border: 1px solid #dbe4ea; border-radius: 22px; padding: 10px 15px;
    font-size: 13.5px; font-family: inherit; outline: 0;
}
.chatbot-foot input:focus { border-color: var(--addon-theme); }
.chatbot-send {
    width: 44px; height: 44px; border-radius: 50%; border: 0; flex: none;
    background: var(--addon-theme); color: #fff; font-size: 15px; cursor: pointer; transition: background .2s ease;
}
.chatbot-send:hover { background: var(--addon-theme-2); }
.hidden { display: none !important; }

@media (max-width: 480px) {
    .chatbot-panel { right: 12px; left: 12px; width: auto; bottom: 88px; height: min(560px, calc(100vh - 110px)); }
    .chatbot-fab { right: 16px; bottom: 16px; }
}
