/* ==========================================================================
   Sushma Solvents - website chatbot widget
   Self-contained. Every rule is scoped under .ssbot-root so it cannot affect
   the existing site.

   Specificity note: the local reset uses .ssbot-root + element = (0,1,1), so
   every component rule is written as .ssbot-root + class = (0,2,0) to make
   sure the component always beats the reset.
   ========================================================================== */

.ssbot-root {
    --ssbot-navy: #032D55;
    --ssbot-teal: #0B7686;
    --ssbot-ink: #1F242C;
    --ssbot-muted: #64748b;
    --ssbot-line: #e4e9f0;
    --ssbot-bg: #ffffff;
    --ssbot-soft: #f4f7fb;
    --ssbot-font: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}

/* ---- local reset: blocks the site's global element rules ---- */
.ssbot-root,
.ssbot-root *,
.ssbot-root *::before,
.ssbot-root *::after {
    box-sizing: border-box;
}

.ssbot-root p,
.ssbot-root h1,
.ssbot-root h2,
.ssbot-root h3,
.ssbot-root h4,
.ssbot-root h5,
.ssbot-root h6,
.ssbot-root ul,
.ssbot-root li,
.ssbot-root span,
.ssbot-root div {
    margin: 0;
    padding: 0;
    font-family: var(--ssbot-font, 'Montserrat', Arial, sans-serif);
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
    color: inherit;
    letter-spacing: normal;
    text-transform: none;
    transition: none;
}

.ssbot-root ul {
    list-style: none;
}

.ssbot-root input,
.ssbot-root textarea,
.ssbot-root button {
    font-family: var(--ssbot-font, 'Montserrat', Arial, sans-serif);
    font-size: 14px;
    line-height: 1.45;
    height: auto;
    width: auto;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    color: inherit;
    outline: none;
    text-transform: none;
    -webkit-appearance: none;
    appearance: none;
    transition: none;
}

.ssbot-root button {
    cursor: pointer;
}

/* ---- launcher ---- */
.ssbot-root .ssbot-launcher {
    position: fixed;
    right: 24px;
    bottom: 150px;
    z-index: 9997;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    padding: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ssbot-navy, #032D55) 0%, var(--ssbot-teal, #0B7686) 100%);
    color: #fff;
    font-size: 23px;
    line-height: 1;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.92), 0 10px 26px rgba(3, 45, 85, 0.38);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

.ssbot-root .ssbot-launcher:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 0 0 3px #fff, 0 16px 34px rgba(3, 45, 85, 0.45);
}

.ssbot-root .ssbot-launcher__close {
    display: none;
}

.ssbot-root.ssbot-is-open .ssbot-launcher__open {
    display: none;
}

.ssbot-root.ssbot-is-open .ssbot-launcher__close {
    display: block;
}

.ssbot-root .ssbot-badge {
    position: absolute;
    top: 0;
    right: 0;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #22c55e;
    border: 2px solid #fff;
}

.ssbot-root.ssbot-is-open .ssbot-badge {
    display: none;
}

/* ---- panel ---- */
.ssbot-root .ssbot-panel {
    position: fixed;
    right: 96px;
    bottom: 92px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    width: 376px;
    max-width: calc(100vw - 32px);
    height: 540px;
    max-height: calc(100vh - 190px);
    background: var(--ssbot-bg, #ffffff);
    border: 1px solid var(--ssbot-line, #e4e9f0);
    border-radius: 16px;
    box-shadow: 0 18px 50px rgba(3, 45, 85, 0.24);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(16px) scale(0.98);
    transform-origin: bottom right;
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
}

.ssbot-root.ssbot-is-open .ssbot-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* ---- header ---- */
.ssbot-root .ssbot-head {
    display: flex;
    align-items: center;
    gap: 11px;
    flex: 0 0 auto;
    padding: 14px;
    background: linear-gradient(120deg, var(--ssbot-navy, #032D55) 0%, var(--ssbot-teal, #0B7686) 100%);
    color: #fff;
}

.ssbot-root .ssbot-head__avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    font-size: 16px;
    line-height: 1;
}

.ssbot-root .ssbot-head__text {
    min-width: 0;
}

.ssbot-root .ssbot-head__title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ssbot-root .ssbot-head__status {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.35;
    opacity: 0.9;
    white-space: nowrap;
}

.ssbot-root .ssbot-head__dot {
    flex: 0 0 auto;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #4ade80;
}

.ssbot-root .ssbot-head__close {
    margin-left: auto;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border-radius: 50%;
    color: #fff;
    font-size: 15px;
    line-height: 1;
    opacity: 0.85;
    transition: background 0.25s ease, opacity 0.25s ease;
}

.ssbot-root .ssbot-head__close:hover {
    background: rgba(255, 255, 255, 0.18);
    opacity: 1;
}

/* ---- message log ---- */
.ssbot-root .ssbot-log {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 16px 14px 6px;
    background: var(--ssbot-soft, #f4f7fb);
}

.ssbot-root .ssbot-msg {
    display: flex;
    margin-bottom: 10px;
}

.ssbot-root .ssbot-msg__bubble {
    max-width: 84%;
    padding: 10px 13px;
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.55;
    border-radius: 14px;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}

.ssbot-root .ssbot-msg--bot .ssbot-msg__bubble {
    background: #fff;
    color: var(--ssbot-ink, #1F242C);
    border: 1px solid var(--ssbot-line, #e4e9f0);
    border-bottom-left-radius: 5px;
}

.ssbot-root .ssbot-msg--user {
    justify-content: flex-end;
}

.ssbot-root .ssbot-msg--user .ssbot-msg__bubble {
    background: var(--ssbot-navy, #032D55);
    color: #fff;
    border-bottom-right-radius: 5px;
}

.ssbot-root .ssbot-msg__bubble a {
    color: var(--ssbot-teal, #0B7686);
    font-weight: 600;
    text-decoration: underline;
}

.ssbot-root .ssbot-msg--user .ssbot-msg__bubble a {
    color: #bde8f0;
}

/* typing indicator */
.ssbot-root .ssbot-typing {
    display: flex;
    gap: 4px;
    align-items: center;
    padding: 13px 14px;
}

.ssbot-root .ssbot-typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #94a3b8;
    animation: ssbot-blink 1.3s infinite ease-in-out;
}

.ssbot-root .ssbot-typing span:nth-child(2) {
    animation-delay: 0.18s;
}

.ssbot-root .ssbot-typing span:nth-child(3) {
    animation-delay: 0.36s;
}

@keyframes ssbot-blink {

    0%,
    80%,
    100% {
        opacity: 0.25;
        transform: translateY(0);
    }

    40% {
        opacity: 1;
        transform: translateY(-3px);
    }
}

/* ---- quick reply chips ---- */
.ssbot-root .ssbot-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    flex: 0 0 auto;
    padding: 4px 14px 12px;
    background: var(--ssbot-soft, #f4f7fb);
}

.ssbot-root .ssbot-chip {
    padding: 8px 13px;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--ssbot-teal, #0B7686);
    background: #fff;
    border: 1px solid rgba(11, 118, 134, 0.35);
    border-radius: 50rem;
    transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.ssbot-root .ssbot-chip:hover {
    background: var(--ssbot-teal, #0B7686);
    color: #fff;
    transform: translateY(-1px);
}

/* ---- composer ---- */
.ssbot-root .ssbot-form {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    flex: 0 0 auto;
    padding: 10px 12px;
    background: #fff;
    border-top: 1px solid var(--ssbot-line, #e4e9f0);
}

.ssbot-root .ssbot-input {
    flex: 1 1 auto;
    min-width: 0;
    max-height: 96px;
    padding: 10px 13px;
    font-size: 13.5px;
    line-height: 1.45;
    color: var(--ssbot-ink, #1F242C);
    background: var(--ssbot-soft, #f4f7fb);
    border: 1px solid var(--ssbot-line, #e4e9f0);
    border-radius: 12px;
    resize: none;
    overflow-y: auto;
    transition: border-color 0.25s ease;
}

.ssbot-root .ssbot-input::placeholder {
    color: #94a3b8;
    font-size: 13px;
}

.ssbot-root .ssbot-input:focus {
    border-color: var(--ssbot-teal, #0B7686);
}

.ssbot-root .ssbot-send {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    background: var(--ssbot-teal, #0B7686);
    color: #fff;
    font-size: 14px;
    line-height: 1;
    transition: background 0.25s ease, transform 0.25s ease;
}

.ssbot-root .ssbot-send:hover {
    background: var(--ssbot-navy, #032D55);
    transform: scale(1.06);
}

.ssbot-root .ssbot-send:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

.ssbot-root .ssbot-foot {
    flex: 0 0 auto;
    padding: 0 12px 9px;
    font-size: 10.5px;
    line-height: 1.35;
    color: var(--ssbot-muted, #64748b);
    text-align: center;
    background: #fff;
}

.ssbot-root .ssbot-foot a {
    color: var(--ssbot-teal, #0B7686);
    font-weight: 600;
}

.ssbot-root .ssbot-error {
    color: #dc2626;
    font-weight: 600;
}

/* ---- tablet / mobile ---- */
@media (max-width: 767px) {
    .ssbot-root .ssbot-launcher {
        right: 16px;
        bottom: 134px;
        width: 54px;
        height: 54px;
        font-size: 21px;
    }

    .ssbot-root .ssbot-panel {
        /* bottom sheet: sits over the lower part of the screen, not all of it */
        top: auto;
        right: 12px;
        left: 12px;
        bottom: 12px;
        width: auto;
        max-width: none;
        height: 68vh;
        height: 68dvh;
        min-height: 360px;
        max-height: 540px;
        border-radius: 16px;
    }

    .ssbot-root .ssbot-msg__bubble {
        max-width: 88%;
    }
}

@media (max-width: 400px) {
    .ssbot-root .ssbot-chip {
        padding: 7px 11px;
        font-size: 12px;
    }

    .ssbot-root .ssbot-log {
        padding: 14px 11px 6px;
    }

    .ssbot-root .ssbot-chips {
        padding: 4px 11px 10px;
    }
}

/* short landscape phones */
@media (max-height: 560px) and (max-width: 900px) {
    .ssbot-root .ssbot-panel {
        top: 10px;
        bottom: 10px;
        height: auto;
        min-height: 0;
        max-height: none;
    }

    .ssbot-root .ssbot-launcher {
        bottom: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {

    .ssbot-root .ssbot-panel,
    .ssbot-root .ssbot-launcher,
    .ssbot-root .ssbot-chip,
    .ssbot-root .ssbot-send {
        transition: none;
    }

    .ssbot-root .ssbot-typing span {
        animation: none;
    }
}
