/* Fixed wrapper: column flex so robot stacks above the button */
.lms-chatbot-launcher-wrap {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 9998;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

/* Robot gif: large, sits above the button; negative bottom margin makes it overlap */
.lms-chatbot-robot-gif {
    width: 140px;
    height: auto;
    display: block;
    margin-left: -8px;
    margin-bottom: -32px;
    position: relative;
    z-index: 2;
    cursor: pointer;
    filter: drop-shadow(0 6px 12px rgba(0,0,0,0.18));
}

/* Pill button */
.lms-chatbot-launcher {
    position: relative;
    z-index: 1;
    border: 0;
    border-radius: 999px;
    padding: 14px 24px 14px 110px;
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    background: #1055a8;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    letter-spacing: 0.01em;
}

.lms-chatbot-launcher:hover {
    background: linear-gradient(to right, #0b578a, #1e88c9);
}



/* Outer panel: overflow visible so robot can poke above */
.lms-chatbot-panel {
    position: fixed;
    right: 24px;
    bottom: 80px;
    width: 340px;
    max-width: calc(100vw - 24px);
    height: 460px;
    max-height: calc(100vh - 110px);
    display: none;
    z-index: 9999;
    overflow: visible;
    background: transparent;
}

.lms-chatbot-open .lms-chatbot-panel {
    display: block;
}

/* Robot poking above the panel */
.lms-chatbot-panel-robot {
    position: absolute;
    bottom: 100%;
    margin-bottom: -55px;
    left: 12px;
    width: 90px;
    height: auto;
    display: block;
    pointer-events: none;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.20));
    z-index: 2;
}

/* Inner wrapper: this is the actual scrollable card */
.lms-chatbot-panel-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    border-radius: 12px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
    border: 1px solid #d8dde3;
}

.lms-chatbot-header {
    background: #0f6ead;
    color: #ffffff;
    padding: 10px 12px;
    padding-left: 110px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.lms-chatbot-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.lms-chatbot-close {
    border: 0;
    background: transparent;
    color: #ffffff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.lms-chatbot-mute-btn,
.lms-chatbot-stop-btn,
.lms-chatbot-clear-btn {
    border: 0;
    background: rgba(255,255,255,0.15);
    color: #ffffff;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    border-radius: 6px;
    padding: 3px 7px;
    display: inline-flex;
    align-items: center;
    transition: background 0.2s;
}

.lms-chatbot-mute-btn:hover,
.lms-chatbot-stop-btn:hover,
.lms-chatbot-clear-btn:hover {
    background: rgba(255,255,255,0.30);
}

.lms-chatbot-stop-btn {
    font-size: 11px;
    letter-spacing: 1px;
    background: rgba(255, 80, 80, 0.30);
}

.lms-chatbot-stop-btn:hover {
    background: rgba(255, 80, 80, 0.55);
}

/* ── Quick reply chips ── */
.lms-chatbot-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    padding: 4px 0 8px 0;
    animation: lms-fadein 0.3s ease;
}

.lms-chatbot-chip {
    border: 1.5px solid #0f6ead;
    background: #ffffff;
    color: #0f6ead;
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s, color 0.18s;
    white-space: nowrap;
}

.lms-chatbot-chip:hover {
    background: #0f6ead;
    color: #ffffff;
}

@keyframes lms-fadein {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Typing indicator ── */
.lms-chatbot-typing {
    display: flex;
    margin: 0 0 10px 0;
}

.lms-chatbot-typing-bubble {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 10px 14px !important;
}

.lms-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #aab4be;
    display: inline-block;
    animation: lms-bounce 1.2s infinite ease-in-out;
}

.lms-dot:nth-child(1) { animation-delay: 0s; }
.lms-dot:nth-child(2) { animation-delay: 0.2s; }
.lms-dot:nth-child(3) { animation-delay: 0.4s; }

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

.lms-chatbot-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 12px;
    background: #f7f9fb;
}

.lms-chatbot-msg {
    margin: 0 0 10px 0;
    display: flex;
}

.lms-chatbot-msg-user {
    justify-content: flex-end;
}

.lms-chatbot-bubble {
    max-width: 85%;
    border-radius: 10px;
    padding: 9px 10px;
    line-height: 1.4;
    font-size: 13px;
    white-space: pre-wrap;
}

.lms-chatbot-msg-bot .lms-chatbot-bubble {
    background: #ffffff;
    border: 1px solid #d8dde3;
    color: #1f2a37;
}

.lms-chatbot-msg-user .lms-chatbot-bubble {
    background: #0f6ead;
    color: #ffffff;
}

.lms-chatbot-form {
    border-top: 1px solid #e5e8ec;
    display: flex;
    gap: 8px;
    padding: 10px;
    background: #ffffff;
    flex-shrink: 0;
}

.lms-chatbot-input {
    flex: 1;
    min-width: 0;
    border: 1px solid #c7cfd8;
    border-radius: 8px;
    padding: 9px 10px;
    font-size: 13px;
}

.lms-chatbot-send {
    border: 0;
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    background: #0f6ead;
    cursor: pointer;
}

.lms-chatbot-send:disabled {
    opacity: 0.6;
    cursor: default;
}

/* ── Mic button ── */
.lms-chatbot-mic {
    border: 1px solid #c7cfd8;
    border-radius: 8px;
    padding: 9px 10px;
    background: #f0f4f8;
    color: #0f6ead;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.18s, border-color 0.18s;
}

.lms-chatbot-mic:hover {
    background: #dce8f5;
    border-color: #0f6ead;
}

.lms-chatbot-mic-active {
    background: #fee2e2 !important;
    border-color: #ef4444 !important;
    color: #ef4444 !important;
    animation: lms-mic-pulse 1s infinite;
}

@keyframes lms-mic-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    50%       { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}

/* ── Proactive notification bubble ── */
.lms-chatbot-notify {
    position: absolute;
    bottom: calc(100% + 10px);
    right: 0;
    background: #ffffff;
    border: 1px solid #d8dde3;
    border-radius: 12px 12px 4px 12px;
    padding: 10px 30px 10px 14px;
    font-size: 13px;
    font-weight: 600;
    color: #1f2a37;
    white-space: nowrap;
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    cursor: pointer;
    opacity: 0;
    transform: translateY(8px) scale(0.95);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.lms-chatbot-notify-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
    animation: lms-notify-bounce 0.5s ease;
}

@keyframes lms-notify-bounce {
    0%   { transform: translateY(8px) scale(0.95); }
    60%  { transform: translateY(-4px) scale(1.02); }
    100% { transform: translateY(0) scale(1); }
}

.lms-chatbot-notify::after {
    content: "";
    position: absolute;
    bottom: -7px;
    right: 18px;
    width: 12px;
    height: 12px;
    background: #ffffff;
    border-right: 1px solid #d8dde3;
    border-bottom: 1px solid #d8dde3;
    transform: rotate(45deg);
}

.lms-chatbot-notify-close {
    position: absolute;
    top: 4px;
    right: 6px;
    border: 0;
    background: transparent;
    font-size: 15px;
    line-height: 1;
    color: #6b7280;
    cursor: pointer;
    padding: 2px 4px;
}

.lms-chatbot-notify-close:hover {
    color: #1f2a37;
}

/* ── Mic auto-send countdown bar ── */
.lms-chatbot-mic-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 5px 10px 6px;
    background: #fffbeb;
    border-top: 1px solid #fde68a;
    font-size: 12px;
    color: #92400e;
    animation: lms-fadein 0.2s ease;
    flex-shrink: 0;
}

.lms-chatbot-mic-cancel {
    border: 1px solid #f59e0b;
    background: transparent;
    color: #b45309;
    font-size: 11px;
    font-weight: 600;
    border-radius: 6px;
    padding: 2px 8px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
}

.lms-chatbot-mic-cancel:hover {
    background: #fde68a;
}
