/* AI Site Navigator Pro — Widget Styles */
:root {
    --aisnav-primary:  #2563eb;
    --aisnav-bg:       #ffffff;
    --aisnav-surface:  #f8f9fa;
    --aisnav-border:   #e2e8f0;
    --aisnav-text:     #1e293b;
    --aisnav-muted:    #64748b;
    --aisnav-radius:   12px;
    --aisnav-shadow:   0 8px 32px rgba(0,0,0,.14);
    --aisnav-w:        360px;
    --aisnav-h:        480px;
}

/* ── Floating launcher ──────────────────────────────────────── */
.aisnav-floating-container { position: fixed; z-index: 99999; }
.aisnav-floating-container.bottom-right { bottom: 24px; right: 24px; }
.aisnav-floating-container.bottom-left  { bottom: 24px; left:  24px; }

.aisnav-launcher {
    width: 56px; height: 56px; border-radius: 50%;
    background: var(--aisnav-primary);
    border: none; cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,0,0,.22);
    display: flex; align-items: center; justify-content: center;
    transition: transform .2s, box-shadow .2s;
}
.aisnav-launcher:hover { transform: scale(1.08); box-shadow: 0 6px 20px rgba(0,0,0,.28); }
.aisnav-launcher svg   { width: 26px; height: 26px; fill: #fff; }

/* ── Chat window ────────────────────────────────────────────── */
.aisnav-window {
    position: absolute;
    bottom: 68px; right: 0;
    width: var(--aisnav-w);
    height: var(--aisnav-h);
    background: var(--aisnav-bg);
    border-radius: var(--aisnav-radius);
    box-shadow: var(--aisnav-shadow);
    display: flex; flex-direction: column;
    overflow: hidden;
    animation: aisnav-pop .18s ease;
    border: 1px solid var(--aisnav-border);
}
.aisnav-floating-container.bottom-left .aisnav-window { right: auto; left: 0; }

@keyframes aisnav-pop {
    from { opacity: 0; transform: translateY(8px) scale(.97); }
    to   { opacity: 1; transform: none; }
}
.aisnav-window.aisnav-hidden { display: none; }

/* ── Inline embed ───────────────────────────────────────────── */
.aisnav-inline-container .aisnav-window {
    position: relative;
    bottom: auto; right: auto;
    width: 100%; height: var(--aisnav-h);
    box-shadow: var(--aisnav-shadow);
    border-radius: var(--aisnav-radius);
}
.aisnav-inline-container .aisnav-window.aisnav-hidden { display: flex; }

/* ── Header ─────────────────────────────────────────────────── */
.aisnav-header {
    background: var(--aisnav-primary);
    color: #fff;
    padding: 14px 16px;
    display: flex; align-items: center; justify-content: space-between;
    font-weight: 600; font-size: .95rem;
    flex-shrink: 0;
}
.aisnav-header-left  { display: flex; align-items: center; gap: 8px; }
.aisnav-header-dot   { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; }
.aisnav-lang-picker  { background: none; border: 1px solid rgba(255,255,255,.4); color: #fff; border-radius: 6px; padding: 2px 6px; font-size: .8rem; cursor: pointer; }
.aisnav-lang-picker option { color: #000; }
.aisnav-close        { background: none; border: none; color: rgba(255,255,255,.8); cursor: pointer; font-size: 1.2rem; line-height: 1; padding: 0; }
.aisnav-close:hover  { color: #fff; }

/* ── Messages ───────────────────────────────────────────────── */
.aisnav-messages {
    flex: 1; overflow-y: auto; padding: 16px;
    display: flex; flex-direction: column; gap: 10px;
    scroll-behavior: smooth;
}
.aisnav-msg { max-width: 85%; padding: 10px 14px; border-radius: 10px; font-size: .9rem; line-height: 1.55; word-break: break-word; }
.aisnav-msg a { color: var(--aisnav-primary); text-decoration: underline; }
.aisnav-msg.user       { background: var(--aisnav-primary); color: #fff; align-self: flex-end; border-bottom-right-radius: 3px; }
.aisnav-msg.assistant  { background: var(--aisnav-surface); color: var(--aisnav-text); align-self: flex-start; border-bottom-left-radius: 3px; border: 1px solid var(--aisnav-border); }
.aisnav-msg.typing     { background: var(--aisnav-surface); border: 1px solid var(--aisnav-border); }
.aisnav-typing-dots    { display: flex; gap: 4px; align-items: center; height: 18px; }
.aisnav-typing-dots span { width: 7px; height: 7px; background: var(--aisnav-muted); border-radius: 50%; animation: aisnav-bounce .9s infinite; }
.aisnav-typing-dots span:nth-child(2) { animation-delay: .15s; }
.aisnav-typing-dots span:nth-child(3) { animation-delay: .30s; }
@keyframes aisnav-bounce {
    0%,80%,100% { transform: translateY(0); }
    40%          { transform: translateY(-6px); }
}

/* ── Input area ─────────────────────────────────────────────── */
.aisnav-input-area {
    display: flex; align-items: flex-end; gap: 6px;
    padding: 10px 12px;
    border-top: 1px solid var(--aisnav-border);
    background: var(--aisnav-bg);
    flex-shrink: 0;
}
.aisnav-input {
    flex: 1; border: 1px solid var(--aisnav-border); border-radius: 8px;
    padding: 9px 12px; font-size: .9rem; resize: none;
    font-family: inherit; line-height: 1.45;
    min-height: 40px; max-height: 120px;
    background: var(--aisnav-surface);
    color: var(--aisnav-text);
    outline: none; transition: border-color .15s;
}
.aisnav-input:focus { border-color: var(--aisnav-primary); }
.aisnav-btn {
    width: 38px; height: 38px; border-radius: 8px; border: none;
    background: var(--aisnav-primary); color: #fff;
    cursor: pointer; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s;
}
.aisnav-btn:hover   { filter: brightness(1.1); }
.aisnav-btn:disabled { opacity: .5; cursor: not-allowed; }
.aisnav-btn svg     { width: 18px; height: 18px; fill: #fff; }
.aisnav-btn.mic     { background: var(--aisnav-surface); border: 1px solid var(--aisnav-border); }
.aisnav-btn.mic svg { fill: var(--aisnav-muted); }
.aisnav-btn.mic.recording     { background: #fee2e2; border-color: #ef4444; }
.aisnav-btn.mic.recording svg { fill: #ef4444; }

/* ── Branding footer ────────────────────────────────────────── */
.aisnav-branding { text-align: center; font-size: .7rem; color: var(--aisnav-muted); padding: 4px 0 8px; }
.aisnav-branding a { color: inherit; text-decoration: none; }

/* ── Mobile ─────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .aisnav-floating-container.bottom-right,
    .aisnav-floating-container.bottom-left {
        bottom: 0; left: 0; right: 0; width: 100%;
    }
    .aisnav-window {
        width: 100%; height: 65dvh; min-height: 320px;
        border-bottom-left-radius: 0; border-bottom-right-radius: 0;
        bottom: 64px; right: 0; left: 0;
    }
    .aisnav-launcher {
        position: fixed; bottom: 12px; right: 16px;
    }
    .aisnav-floating-container.bottom-left .aisnav-launcher { right: auto; left: 16px; }
}
