/* SHE Careers - AI chat widget.
   Everything is scoped under #she-chat-root (an ID beats almost any theme rule) and the
   accent colour comes from --she-chat-color, set from the plugin's settings. */

#she-chat-root, #she-chat-root * { box-sizing: border-box; }
#she-chat-root {
    --she-chat-color: #0b5cff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #1f2937;
}

/* ---------- launcher ---------- */
#she-chat-root .she-chat-launcher {
    position: fixed; bottom: var(--she-chat-bottom, 20px); z-index: 2147483000;
    width: 58px; height: 58px; padding: 0; margin: 0;
    display: flex; align-items: center; justify-content: center;
    border: none; border-radius: 50%; cursor: pointer;
    background: var(--she-chat-color); color: #fff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
    transition: transform .2s ease, box-shadow .2s ease;
}
#she-chat-root .she-chat-launcher:hover { transform: scale(1.06); box-shadow: 0 10px 28px rgba(0, 0, 0, .3); }
#she-chat-root .she-chat-launcher:focus-visible,
#she-chat-root .she-chat-close:focus-visible,
#she-chat-root .she-chat-send:focus-visible,
#she-chat-root .she-chat-chip:focus-visible { outline: 3px solid rgba(11, 92, 255, .45); outline-offset: 2px; }
#she-chat-root.she-chat-right .she-chat-launcher { right: var(--she-chat-side, 20px); }
#she-chat-root.she-chat-left .she-chat-launcher { left: var(--she-chat-side, 20px); }
#she-chat-root .she-chat-launcher.she-chat-launcher-hidden { display: none; }

/* ---------- panel ---------- */
#she-chat-root .she-chat-panel {
    position: fixed; bottom: calc(var(--she-chat-bottom, 20px) + 72px); z-index: 2147483001;
    width: 370px; max-width: calc(100vw - 24px);
    height: 540px; max-height: calc(100vh - var(--she-chat-bottom, 20px) - 96px);
    display: flex; flex-direction: column;
    background: #fff; border-radius: 16px; overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .28);
    animation: she-chat-in .22s ease-out;
}
#she-chat-root .she-chat-panel[hidden] { display: none; }
#she-chat-root.she-chat-right .she-chat-panel { right: var(--she-chat-side, 20px); }
#she-chat-root.she-chat-left .she-chat-panel { left: var(--she-chat-side, 20px); }
@keyframes she-chat-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------- header ---------- */
#she-chat-root .she-chat-head {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px; background: var(--she-chat-color); color: #fff;
}
#she-chat-root .she-chat-avatar {
    width: 38px; height: 38px; flex: 0 0 38px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255, 255, 255, .22); font-weight: 700; font-size: 16px;
}
#she-chat-root .she-chat-titles { flex: 1; min-width: 0; display: flex; flex-direction: column; }
#she-chat-root .she-chat-titles strong { font-size: 15px; font-weight: 700; color: #fff; }
#she-chat-root .she-chat-titles span { font-size: 12px; opacity: .85; color: #fff; }
#she-chat-root .she-chat-close {
    width: 34px; height: 34px; padding: 0; margin: 0; border: none; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    background: transparent; color: #fff; cursor: pointer;
}
#she-chat-root .she-chat-close:hover { background: rgba(255, 255, 255, .18); }

/* ---------- messages ---------- */
#she-chat-root .she-chat-body {
    flex: 1; overflow-y: auto; padding: 16px 14px;
    background: #f5f7fb; display: flex; flex-direction: column; gap: 10px;
}
#she-chat-root .she-chat-msg { display: flex; }
#she-chat-root .she-chat-msg.she-chat-user { justify-content: flex-end; }
#she-chat-root .she-chat-bubble {
    max-width: 84%; padding: 10px 13px; border-radius: 14px;
    white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere;
    text-align: start;
}
#she-chat-root .she-chat-assistant .she-chat-bubble {
    background: #fff; color: #1f2937; border: 1px solid #e5e7eb; border-bottom-left-radius: 4px;
}
#she-chat-root .she-chat-user .she-chat-bubble {
    background: var(--she-chat-color); color: #fff; border-bottom-right-radius: 4px;
}
#she-chat-root .she-chat-bubble a { color: inherit; text-decoration: underline; word-break: break-all; }
#she-chat-root .she-chat-assistant .she-chat-bubble a { color: var(--she-chat-color); }
#she-chat-root .she-chat-error .she-chat-bubble { background: #fef2f2; border-color: #fecaca; color: #991b1b; }

/* typing dots */
#she-chat-root .she-chat-typing .she-chat-bubble { display: flex; gap: 4px; padding: 13px 14px; }
#she-chat-root .she-chat-typing .she-chat-bubble span {
    width: 7px; height: 7px; border-radius: 50%; background: #9ca3af;
    animation: she-chat-dot 1.2s infinite ease-in-out;
}
#she-chat-root .she-chat-typing .she-chat-bubble span:nth-child(2) { animation-delay: .15s; }
#she-chat-root .she-chat-typing .she-chat-bubble span:nth-child(3) { animation-delay: .3s; }
@keyframes she-chat-dot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-4px); } }

/* ---------- quick questions ---------- */
#she-chat-root .she-chat-chips {
    display: flex; flex-wrap: wrap; gap: 8px; padding: 0 14px 12px; background: #f5f7fb;
}
#she-chat-root .she-chat-chip {
    padding: 7px 12px; margin: 0; border-radius: 999px; cursor: pointer;
    border: 1px solid var(--she-chat-color); background: #fff; color: var(--she-chat-color);
    font: inherit; font-size: 13px; font-weight: 600; line-height: 1.3;
}
#she-chat-root .she-chat-chip:hover { background: var(--she-chat-color); color: #fff; }

/* ---------- input ---------- */
#she-chat-root .she-chat-form {
    display: flex; align-items: flex-end; gap: 8px; margin: 0;
    padding: 10px 12px; background: #fff; border-top: 1px solid #e5e7eb;
}
#she-chat-root .she-chat-input {
    flex: 1; min-height: 40px; max-height: 96px; margin: 0; padding: 9px 12px;
    border: 1px solid #d1d5db; border-radius: 12px; resize: none; outline: none;
    font: inherit; font-size: 14px; line-height: 1.4; color: #1f2937; background: #fff;
    box-shadow: none;
}
#she-chat-root .she-chat-input:focus { border-color: var(--she-chat-color); }
#she-chat-root .she-chat-send {
    width: 40px; height: 40px; flex: 0 0 40px; padding: 0; margin: 0; border: none; border-radius: 12px;
    display: flex; align-items: center; justify-content: center; cursor: pointer;
    background: var(--she-chat-color); color: #fff;
}
#she-chat-root .she-chat-send:disabled { opacity: .5; cursor: not-allowed; }
#she-chat-root .she-chat-foot {
    padding: 0 12px 9px; background: #fff; color: #9ca3af; font-size: 11px; text-align: center;
}

/* ---------- phones ---------- */
@media (max-width: 480px) {
    #she-chat-root .she-chat-panel,
    #she-chat-root.she-chat-right .she-chat-panel,
    #she-chat-root.she-chat-left .she-chat-panel {
        left: 8px; right: 8px; bottom: 8px; width: auto; max-width: none;
        height: calc(100vh - 16px); height: calc(100dvh - 16px); max-height: none;
    }
    #she-chat-root .she-chat-input { font-size: 16px; } /* stops iOS zooming into the field */
}

@media (prefers-reduced-motion: reduce) {
    #she-chat-root .she-chat-panel, #she-chat-root .she-chat-launcher,
    #she-chat-root .she-chat-typing .she-chat-bubble span { animation: none; transition: none; }
}

/* ---------- theme overrides ----------
   The site theme styles every <button> (e.g. a gradient on :hover/:focus/:active). These rules
   pin the widget's own colours in every state so the theme can't repaint them. */
#she-chat-root .she-chat-launcher,
#she-chat-root .she-chat-launcher:hover,
#she-chat-root .she-chat-launcher:focus,
#she-chat-root .she-chat-launcher:active,
#she-chat-root .she-chat-send,
#she-chat-root .she-chat-send:hover,
#she-chat-root .she-chat-send:focus,
#she-chat-root .she-chat-send:active {
    background-color: var(--she-chat-color) !important;
    background-image: none !important;
    color: #fff !important;
    border: none !important;
    filter: none !important;
}
#she-chat-root .she-chat-close,
#she-chat-root .she-chat-close:focus,
#she-chat-root .she-chat-close:active {
    background-color: transparent !important;
    background-image: none !important;
    color: #fff !important;
    border: none !important;
}
#she-chat-root .she-chat-close:hover {
    background-color: rgba(255, 255, 255, .18) !important;
    background-image: none !important;
    color: #fff !important;
}
#she-chat-root .she-chat-chip {
    background-color: #fff !important;
    background-image: none !important;
    color: var(--she-chat-color) !important;
    border: 1px solid var(--she-chat-color) !important;
}
#she-chat-root .she-chat-chip:hover,
#she-chat-root .she-chat-chip:focus,
#she-chat-root .she-chat-chip:active {
    background-color: var(--she-chat-color) !important;
    background-image: none !important;
    color: #fff !important;
}

/* ---------- extra-strong theme overrides (doubled ID = higher specificity than theme button rules) ---------- */
#she-chat-root#she-chat-root .she-chat-launcher,
#she-chat-root#she-chat-root .she-chat-launcher:hover,
#she-chat-root#she-chat-root .she-chat-launcher:focus,
#she-chat-root#she-chat-root .she-chat-launcher:focus-visible,
#she-chat-root#she-chat-root .she-chat-launcher:active {
    background: var(--she-chat-color) !important;
    background-image: none !important;
    border: none !important;
    color: #fff !important;
    opacity: 1 !important;
    filter: none !important;
    -webkit-text-fill-color: #fff !important;
}
#she-chat-root#she-chat-root .she-chat-launcher::before,
#she-chat-root#she-chat-root .she-chat-launcher::after,
#she-chat-root#she-chat-root .she-chat-send::before,
#she-chat-root#she-chat-root .she-chat-send::after,
#she-chat-root#she-chat-root .she-chat-close::before,
#she-chat-root#she-chat-root .she-chat-close::after,
#she-chat-root#she-chat-root .she-chat-chip::before,
#she-chat-root#she-chat-root .she-chat-chip::after {
    content: none !important;
    display: none !important;
    background: none !important;
}
#she-chat-root#she-chat-root .she-chat-launcher svg,
#she-chat-root#she-chat-root .she-chat-send svg,
#she-chat-root#she-chat-root .she-chat-close svg {
    display: block !important;
    stroke: currentColor !important;
    fill: none !important;
    opacity: 1 !important;
    visibility: visible !important;
}
