/* ══════════════════════════════════════════════════════
   Chatbot – מרכז קול  |  kol-chatbot.css  v2.1.0
   All selectors prefixed with #kol-chatbot
══════════════════════════════════════════════════════ */

#kol-chatbot {
    --kol-ink:     #0D1A33;
    --kol-ocean:   #1E3769;   /* PRIMARY */
    --kol-deep:    #142856;   /* darker */
    --kol-teal:    #2D5BA3;   /* accent */
    --kol-horizon: #8BA9D4;   /* border */
    --kol-mist:    #EEF3FA;   /* bubble bg */
    --kol-cream:   #FDFCF9;   /* window bg */
    --kol-ease:    cubic-bezier(.16,1,.3,1);

    font-family: 'Assistant', 'Heebo', Arial, sans-serif !important;
    position: fixed !important;
    bottom: 24px !important;
    right: 24px !important;
    left: auto !important;
    top: auto !important;
    z-index: 99999 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-end !important;
    pointer-events: none;
}

#kol-chatbot * { pointer-events: auto; box-sizing: border-box; }

#kol-chatbot button, #kol-chatbot a {
    font-family: 'Assistant', 'Heebo', Arial, sans-serif !important;
    -webkit-appearance: none;
    appearance: none;
}

/* ── Toggle button ─────────────────────────────────── */
#kol-chatbot .kol-cb-toggle {
    position: relative;
    width: 62px !important;
    height: 62px !important;
    border-radius: 50% !important;
    border: none !important;
    background: linear-gradient(135deg, #1E3769 0%, #142856 100%) !important;
    color: #fff !important;
    cursor: pointer;
    box-shadow: 0 8px 28px rgba(30,55,105,.5), 0 2px 8px rgba(0,0,0,.18) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: transform .3s var(--kol-ease), box-shadow .3s ease;
    animation: kol-bounce-in .7s var(--kol-ease) both;
    order: 2;
    padding: 0 !important;
    margin: 0 !important;
    outline: none;
    text-decoration: none !important;
}

#kol-chatbot .kol-cb-toggle:hover {
    transform: scale(1.08);
    box-shadow: 0 12px 36px rgba(30,55,105,.6), 0 4px 12px rgba(0,0,0,.2) !important;
}

#kol-chatbot .kol-cb-toggle:focus-visible {
    outline: 3px solid var(--kol-horizon) !important;
    outline-offset: 3px;
}

#kol-chatbot .kol-cb-icon-chat {
    transition: opacity .2s, transform .25s var(--kol-ease);
    flex-shrink: 0;
}
#kol-chatbot .kol-cb-icon-close {
    position: absolute;
    opacity: 0;
    transform: rotate(-90deg) scale(.6);
    transition: opacity .2s, transform .25s var(--kol-ease);
}
#kol-chatbot.is-open .kol-cb-icon-chat  { opacity: 0; transform: rotate(90deg) scale(.6); }
#kol-chatbot.is-open .kol-cb-icon-close { opacity: 1; transform: rotate(0deg) scale(1); }

#kol-chatbot .kol-cb-pulse {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: #1E3769;
    opacity: .38;
    animation: kol-pulse 2.4s ease-out infinite;
    pointer-events: none;
}
#kol-chatbot.is-open .kol-cb-pulse { display: none; }

/* ── Chat window ───────────────────────────────────── */
#kol-chatbot .kol-cb-window {
    position: absolute !important;
    bottom: 78px !important;
    right: 0 !important;
    left: auto !important;
    width: 360px;
    max-height: 82vh;
    background: var(--kol-cream) !important;
    border-radius: 20px;
    box-shadow: 0 24px 64px rgba(13,26,51,.22), 0 8px 24px rgba(13,26,51,.12);
    overflow: hidden;
    display: flex !important;
    flex-direction: column;
    transform: translateY(18px) scale(.96);
    opacity: 0;
    pointer-events: none !important;
    transition: transform .35s var(--kol-ease), opacity .28s ease;
    order: 1;
    margin: 0 !important;
    padding: 0 !important;
}

#kol-chatbot.is-open .kol-cb-window {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: all !important;
}

/* ── Header ────────────────────────────────────────── */
#kol-chatbot .kol-cb-header {
    display: flex !important;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #1E3769 0%, #142856 100%) !important;
    color: #fff !important;
    flex-shrink: 0;
}

#kol-chatbot .kol-cb-header-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,.13) !important;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 5px;
}

#kol-chatbot .kol-cb-header-info { flex: 1; text-align: right; }
#kol-chatbot .kol-cb-header-name { font-size: 15px; font-weight: 700; color: #fff !important; margin: 0; line-height: 1.2; }

#kol-chatbot .kol-cb-header-status {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
    margin-top: 2px;
}

#kol-chatbot .kol-cb-online-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: #4ADE80 !important;
    flex-shrink: 0;
}

#kol-chatbot .kol-cb-status-text { font-size: 12px; opacity: .82; color: #fff !important; }

/* ── Language footer (persistent bottom strip) ─────── */
#kol-chatbot .kol-cb-lang-footer {
    display: flex !important;
    flex-shrink: 0 !important;
    border-top: 2px solid rgba(30,55,105,.13) !important;
    background: #fff !important;
    overflow: hidden !important;
    border-radius: 0 0 20px 20px !important;
}

#kol-chatbot .kol-cb-lang-btn {
    flex: 1 !important;
    padding: 11px 4px !important;
    border: none !important;
    border-left: 1px solid rgba(30,55,105,.09) !important;
    border-radius: 0 !important;
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    color: var(--kol-teal) !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    font-family: 'Assistant', 'Heebo', Arial, sans-serif !important;
    cursor: pointer !important;
    text-align: center !important;
    transition: background .15s, color .15s !important;
    letter-spacing: .2px !important;
    text-decoration: none !important;
    margin: 0 !important;
}

#kol-chatbot .kol-cb-lang-btn:first-child { border-left: none !important; }

#kol-chatbot .kol-cb-lang-btn:hover {
    background: var(--kol-mist) !important;
    background-color: var(--kol-mist) !important;
    color: var(--kol-ocean) !important;
}

#kol-chatbot .kol-cb-lang-btn.active,
#kol-chatbot .kol-cb-lang-btn[aria-pressed="true"] {
    background: var(--kol-ocean) !important;
    background-color: var(--kol-ocean) !important;
    background-image: none !important;
    color: #fff !important;
}

#kol-chatbot .kol-cb-header-close {
    background: rgba(255,255,255,.12) !important;
    border: none !important;
    border-radius: 50%;
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    color: rgba(255,255,255,.75) !important;
    cursor: pointer;
    transition: background .18s;
    flex-shrink: 0;
    padding: 0 !important;
}
#kol-chatbot .kol-cb-header-close:hover {
    background: rgba(255,255,255,.22) !important;
    color: #fff !important;
}

/* ── Messages ──────────────────────────────────────── */
#kol-chatbot .kol-cb-messages {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 16px 14px 8px;
    scroll-behavior: smooth;
    display: flex;
    flex-direction: column;
    gap: 9px;
    background: var(--kol-cream) !important;
}

#kol-chatbot .kol-cb-messages::-webkit-scrollbar { width: 4px; }
#kol-chatbot .kol-cb-messages::-webkit-scrollbar-thumb { background: var(--kol-horizon); border-radius: 4px; }

#kol-chatbot .kol-cb-msg {
    max-width: 88%;
    padding: 11px 15px;
    background: var(--kol-mist) !important;
    border-radius: 18px 18px 18px 4px;
    font-size: 14px;
    line-height: 1.65;
    color: var(--kol-ink) !important;
    white-space: pre-line;
    align-self: flex-start;
    animation: kol-msg-in .28s var(--kol-ease) both;
    box-shadow: 0 2px 6px rgba(13,26,51,.06);
    font-family: 'Assistant', 'Heebo', Arial, sans-serif !important;
}

#kol-chatbot .kol-cb-window[dir="rtl"] .kol-cb-msg { border-radius: 18px 18px 4px 18px; }

/* Typing */
#kol-chatbot .kol-cb-typing {
    display: flex;
    gap: 5px;
    padding: 13px 16px;
    background: var(--kol-mist) !important;
    border-radius: 18px 18px 18px 4px;
    width: fit-content;
    align-self: flex-start;
    animation: kol-msg-in .28s var(--kol-ease) both;
}
#kol-chatbot .kol-cb-typing span {
    width: 7px; height: 7px;
    background: var(--kol-horizon) !important;
    border-radius: 50%;
    animation: kol-dot-bounce 1.3s ease-in-out infinite;
    display: block;
}
#kol-chatbot .kol-cb-typing span:nth-child(2) { animation-delay: .18s; }
#kol-chatbot .kol-cb-typing span:nth-child(3) { animation-delay: .36s; }

/* ── Options ───────────────────────────────────────── */
#kol-chatbot .kol-cb-options {
    padding: 6px 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 7px;
    flex-shrink: 0;
    background: var(--kol-cream) !important;
    border-top: 1px solid rgba(139,169,212,.2);
    overflow-y: auto;
    max-height: 55vh;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
#kol-chatbot .kol-cb-options::-webkit-scrollbar { display: none; }

#kol-chatbot .kol-cb-opt {
    display: block !important;
    width: 100% !important;
    padding: 10px 15px !important;
    background: #ffffff !important;
    background-color: #ffffff !important;
    background-image: none !important;
    border: 1.5px solid var(--kol-horizon) !important;
    border-radius: 10px !important;
    font-family: 'Assistant', 'Heebo', Arial, sans-serif !important;
    font-size: 13.5px !important;
    font-weight: 600 !important;
    color: var(--kol-ocean) !important;
    text-align: right !important;
    cursor: pointer !important;
    transition: background .16s ease, color .16s ease, border-color .16s ease, transform .14s ease;
    text-decoration: none !important;
    line-height: 1.35 !important;
    animation: kol-opt-in .28s var(--kol-ease) both;
    box-shadow: none !important;
    margin: 0 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
}

#kol-chatbot .kol-cb-opt:hover {
    background: var(--kol-ocean) !important;
    background-color: var(--kol-ocean) !important;
    background-image: none !important;
    color: #fff !important;
    border-color: var(--kol-ocean) !important;
    transform: translateX(2px);
    text-decoration: none !important;
}

#kol-chatbot .kol-cb-opt:active { transform: scale(.97); }

#kol-chatbot .kol-cb-opt.is-back {
    background: transparent !important;
    background-color: transparent !important;
    border-color: rgba(139,169,212,.35) !important;
    color: var(--kol-teal) !important;
    opacity: .75;
    font-weight: 500 !important;
}
#kol-chatbot .kol-cb-opt.is-back:hover {
    opacity: 1;
    background: var(--kol-mist) !important;
    color: var(--kol-ink) !important;
    border-color: var(--kol-horizon) !important;
}

#kol-chatbot .kol-cb-opt.is-primary {
    background: linear-gradient(135deg, #1E3769 0%, #142856 100%) !important;
    background-color: #1E3769 !important;
    color: #fff !important;
    border-color: transparent !important;
    box-shadow: 0 4px 14px rgba(30,55,105,.35) !important;
}
#kol-chatbot .kol-cb-opt.is-primary:hover {
    box-shadow: 0 6px 20px rgba(30,55,105,.48) !important;
    transform: translateX(2px) translateY(-1px);
    background: linear-gradient(135deg, #1E3769 0%, #142856 100%) !important;
    color: #fff !important;
}

/* ── Input capture ─────────────────────────────────── */
#kol-chatbot .kol-cb-input-wrap {
    display: flex !important;
    gap: 8px !important;
    padding: 4px 12px 6px !important;
    align-items: center !important;
}

#kol-chatbot .kol-cb-input {
    flex: 1 !important;
    border: 1.5px solid var(--kol-horizon) !important;
    border-radius: 10px !important;
    padding: 9px 13px !important;
    font-size: 14px !important;
    font-family: 'Assistant', 'Heebo', Arial, sans-serif !important;
    color: var(--kol-ink) !important;
    background: #fff !important;
    outline: none !important;
    box-sizing: border-box !important;
    transition: border-color .18s !important;
}
#kol-chatbot .kol-cb-input:focus { border-color: var(--kol-ocean) !important; }

#kol-chatbot .kol-cb-send {
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, #1E3769 0%, #142856 100%) !important;
    background-image: linear-gradient(135deg, #1E3769 0%, #142856 100%) !important;
    border: none !important;
    color: #fff !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    font-size: 17px !important;
    padding: 0 !important;
    box-shadow: 0 3px 10px rgba(30,55,105,.35) !important;
    transition: transform .15s !important;
}
#kol-chatbot .kol-cb-send:hover { transform: scale(1.08); }

#kol-chatbot .kol-cb-skip {
    text-align: center !important;
    font-size: 12px !important;
    color: var(--kol-teal) !important;
    cursor: pointer !important;
    text-decoration: underline !important;
    background: none !important;
    border: none !important;
    width: 100% !important;
    padding: 2px 0 6px !important;
    font-family: 'Assistant', 'Heebo', Arial, sans-serif !important;
}

#kol-chatbot .kol-cb-err {
    color: #e53935 !important;
    font-size: 12px !important;
    padding: 0 12px 4px !important;
    text-align: center !important;
    font-family: 'Assistant', 'Heebo', Arial, sans-serif !important;
}

/* ── Animations ─────────────────────────────────────── */
@keyframes kol-pulse {
    0%   { transform: scale(1);   opacity: .38; }
    100% { transform: scale(2.2); opacity: 0; }
}
@keyframes kol-bounce-in {
    0%   { transform: scale(0) rotate(-20deg); opacity: 0; }
    70%  { transform: scale(1.12) rotate(3deg); opacity: 1; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}
@keyframes kol-msg-in {
    from { transform: translateY(8px); opacity: 0; }
    to   { transform: translateY(0);   opacity: 1; }
}
@keyframes kol-opt-in {
    from { transform: translateY(6px); opacity: 0; }
    to   { transform: translateY(0);   opacity: 1; }
}
@keyframes kol-dot-bounce {
    0%, 60%, 100% { transform: translateY(0); }
    30%            { transform: translateY(-7px); }
}

/* ── Mobile — compact corner ───────────────────────── */
@media (max-width: 500px) {
    #kol-chatbot {
        bottom: 16px !important;
        right: 16px !important;
        left: auto !important;
    }
    #kol-chatbot .kol-cb-toggle { width: 56px !important; height: 56px !important; }
    #kol-chatbot .kol-cb-window {
        width: calc(100vw - 32px) !important;
        max-height: 76vh !important;
        bottom: 74px !important;
        right: -8px !important;
        border-radius: 16px !important;
    }
}

/* ── Reduced motion ─────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    #kol-chatbot .kol-cb-toggle    { animation: none; }
    #kol-chatbot .kol-cb-pulse     { animation: none; }
    #kol-chatbot .kol-cb-window    { transition: opacity .15s; }
    #kol-chatbot .kol-cb-msg       { animation: none; }
    #kol-chatbot .kol-cb-opt       { animation: none; }
    #kol-chatbot .kol-cb-typing span { animation: none; }
}
