/* Kitchen Selections AI Chatbot – widget styles */

#ks-root {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999999;
    font-family: 'Jost', sans-serif;
}

/* ── Toggle button ────────────────────────────────────── */

#ks-toggle {
    width: 54px;
    height: 54px;
    background: #CE1417;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(206, 20, 23, 0.45);
    margin-left: auto;
    transition: background 0.2s, transform 0.15s;
}

#ks-toggle:hover {
    background: #811205;
    transform: scale(1.06);
}

/* ── Panel ────────────────────────────────────────────── */

#ks-panel {
    position: absolute;
    bottom: 66px;
    right: 0;
    width: 340px;
    background: #fff;
    border: 1px solid #e0e0da;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: ks-slide-in 0.22s ease;
}

@keyframes ks-slide-in {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0);    }
}

/* ── Header ───────────────────────────────────────────── */

#ks-hdr {
    background: #1A1A1A;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

#ks-led {
    width: 8px;
    height: 8px;
    background: #CE1417;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 6px rgba(206, 20, 23, 0.7);
}

#ks-name {
    font-family: 'Cormorant Garamond', serif;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.02em;
}

#ks-tag {
    font-size: 10px;
    color: #666;
    font-weight: 300;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-top: 2px;
}

/* ── Message feed ─────────────────────────────────────── */

#ks-feed {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #f7f7f5;
    min-height: 200px;
    max-height: 300px;
    scroll-behavior: smooth;
}

.ks-msg {
    padding: 10px 13px;
    font-size: 13px;
    line-height: 1.68;
    max-width: 90%;
    word-wrap: break-word;
}

.ks-bot {
    background: #fff;
    border: 1px solid #e4e4de;
    color: #1A1A1A;
    align-self: flex-start;
    border-radius: 0 8px 8px 8px;
}

.ks-user {
    background: #CE1417;
    color: #fff;
    align-self: flex-end;
    border-radius: 8px 8px 0 8px;
}

/* ── Typing indicator ─────────────────────────────────── */

.ks-typing {
    display: flex;
    gap: 5px;
    align-items: center;
    padding: 12px 13px;
    background: #fff;
    border: 1px solid #e4e4de;
    align-self: flex-start;
    border-radius: 0 8px 8px 8px;
    width: fit-content;
}

.ks-typing span {
    width: 6px;
    height: 6px;
    background: #CE1417;
    border-radius: 50%;
    animation: ks-bounce 1.4s ease infinite;
}

.ks-typing span:nth-child(2) { animation-delay: 0.2s; }
.ks-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes ks-bounce {
    0%, 60%, 100% { transform: translateY(0);    opacity: 0.4; }
    30%            { transform: translateY(-6px); opacity: 1;   }
}

/* ── Input bar ────────────────────────────────────────── */

#ks-bar {
    display: flex;
    border-top: 1px solid #e4e4de;
    background: #fff;
    flex-shrink: 0;
}

#ks-bar textarea {
    flex: 1;
    border: none;
    padding: 12px 14px;
    font-family: 'Jost', sans-serif;
    font-size: 13px;
    color: #1A1A1A;
    resize: none;
    height: 46px;
    outline: none;
    background: transparent;
    line-height: 1.5;
}

#ks-bar textarea::placeholder { color: #bbb; }

#ks-send {
    background: #CE1417;
    border: none;
    color: #fff;
    padding: 0 16px;
    cursor: pointer;
    font-family: 'Jost', sans-serif;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition: background 0.2s;
    flex-shrink: 0;
}

#ks-send:hover:not(:disabled) { background: #811205; }
#ks-send:disabled { opacity: 0.3; cursor: default; }

/* ── Lead capture form ────────────────────────────────── */

#ks-lf {
    padding: 14px 16px;
    flex-direction: column;
    gap: 8px;
    border-top: 1px solid #e4e4de;
    background: #fff;
    flex-shrink: 0;
}

#ks-lf label {
    font-size: 10px;
    color: #999;
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

#ks-lf input {
    border: 1px solid #e4e4de;
    padding: 9px 12px;
    font-family: 'Jost', sans-serif;
    font-size: 13px;
    color: #1A1A1A;
    outline: none;
    width: 100%;
    transition: border-color 0.2s;
    background: #fff;
}

#ks-lf input:focus { border-color: #CE1417; }

#ks-lf-btn {
    background: #1A1A1A;
    border: none;
    color: #fff;
    padding: 11px;
    cursor: pointer;
    font-family: 'Jost', sans-serif;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-top: 2px;
    transition: background 0.2s;
    width: 100%;
}

#ks-lf-btn:hover:not(:disabled) { background: #CE1417; }
#ks-lf-btn:disabled { opacity: 0.4; cursor: default; }

/* ── Confirmation message ─────────────────────────────── */

#ks-ok {
    padding: 18px 16px;
    font-size: 13px;
    color: #1A1A1A;
    line-height: 1.65;
    border-top: 1px solid #e4e4de;
    background: #fff;
    text-align: center;
    flex-shrink: 0;
}

#ks-ok strong { color: #CE1417; font-weight: 500; }

/* ── Footer ───────────────────────────────────────────── */

#ks-pw {
    text-align: center;
    padding: 7px;
    font-size: 10px;
    color: #ccc;
    background: #fff;
    border-top: 1px solid #f0f0ec;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}

/* ── Responsive ───────────────────────────────────────── */

@media (max-width: 400px) {
    #ks-panel { width: calc(100vw - 32px); }
    #ks-root  { right: 16px; bottom: 16px; }
}
