/* LMS MCP Chat Widget */
.lms-chat-launcher {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #2563eb;
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, background 0.2s;
}
.lms-chat-launcher:hover {
    transform: scale(1.08);
    background: #1d4ed8;
}
.lms-chat-launcher svg {
    width: 28px;
    height: 28px;
    fill: currentColor;
}

.lms-chat-panel {
    position: fixed;
    bottom: 92px;
    right: 24px;
    width: 380px;
    max-width: calc(100vw - 32px);
    height: 520px;
    max-height: calc(100vh - 120px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    z-index: 99999;
    display: none;
    flex-direction: column;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.lms-chat-panel.open {
    display: flex;
}

.lms-chat-header {
    background: #2563eb;
    color: #fff;
    padding: 16px 20px;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.lms-chat-header-close {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    padding: 0;
    opacity: 0.8;
}
.lms-chat-header-close:hover {
    opacity: 1;
}

.lms-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.lms-chat-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
    white-space: pre-wrap;
}
.lms-chat-msg.user {
    align-self: flex-end;
    background: #2563eb;
    color: #fff;
    border-bottom-right-radius: 4px;
}
.lms-chat-msg.assistant {
    align-self: flex-start;
    background: #f1f5f9;
    color: #1e293b;
    border-bottom-left-radius: 4px;
}
.lms-chat-msg.assistant .tool-status {
    font-size: 12px;
    color: #64748b;
    font-style: italic;
    margin-top: 4px;
}

.lms-chat-typing {
    align-self: flex-start;
    padding: 10px 14px;
    background: #f1f5f9;
    border-radius: 12px;
    font-size: 14px;
    color: #64748b;
    display: none;
}
.lms-chat-typing.visible {
    display: block;
}

.lms-chat-input-area {
    padding: 12px 16px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}
.lms-chat-input {
    flex: 1;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    outline: none;
    resize: none;
    font-family: inherit;
    min-height: 20px;
    max-height: 80px;
}
.lms-chat-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37,99,235,0.15);
}
.lms-chat-send {
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0 16px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}
.lms-chat-send:hover {
    background: #1d4ed8;
}
.lms-chat-send:disabled {
    background: #93c5fd;
    cursor: not-allowed;
}

/* Mobile */
@media (max-width: 480px) {
    .lms-chat-panel {
        bottom: 0;
        right: 0;
        width: 100vw;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }
    .lms-chat-launcher {
        bottom: 16px;
        right: 16px;
    }
}
