/* Shared chatbot drawer — content styles.
   Drawer shell (position, width, slide animation) lives in base.css. */

.lcd-messages {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    padding: 0.75rem 1rem;
    min-height: 0;
}

.lcd-bubble {
    max-width: 88%;
    font-size: 0.85rem;
    line-height: 1.5;
    border-radius: 12px;
    padding: 0.55rem 0.85rem;
    word-break: break-word;
}

.lcd-bubble-user {
    align-self: flex-end;
    background: #62D84E;
    color: #021E2F;
    border-radius: 12px 12px 2px 12px;
}

.lcd-bubble-assistant {
    align-self: flex-start;
    background: rgba(255,255,255,0.06);
    color: #E0E0E0;
    border-radius: 12px 12px 12px 2px;
}

.lcd-bubble-error {
    align-self: flex-start;
    background: rgba(255,107,107,0.12);
    color: #FF6B6B;
    border-radius: 12px;
    font-size: 0.78rem;
}

/* Thinking dots */
.lcd-thinking {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0.65rem 0.85rem;
}

.lcd-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.40);
    animation: lcd-pulse 1.2s ease-in-out infinite;
}
.lcd-dot:nth-child(2) { animation-delay: 0.2s; }
.lcd-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes lcd-pulse {
    0%, 100% { opacity: 0.3; transform: scale(0.85); }
    50%       { opacity: 1;   transform: scale(1); }
}

/* Raw toggle */
.lcd-raw-toggle {
    font-size: 0.68rem;
    color: rgba(255,255,255,0.40);
    cursor: pointer;
    margin-top: 0.35rem;
    user-select: none;
}
.lcd-raw-toggle:hover { color: rgba(255,255,255,0.65); }

.lcd-raw {
    margin-top: 0.35rem;
    padding: 0.4rem 0.6rem;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 5px;
    font-size: 0.7rem;
    color: rgba(255,255,255,0.45);
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 180px;
    overflow-y: auto;
    font-family: 'Consolas', 'Monaco', monospace;
}

/* Input row */
.lcd-input-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    border-top: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}

.lcd-input {
    flex: 1;
    resize: none;
    min-height: 42px;
    max-height: 120px;
    background: rgba(255,255,255,0.06);
    color: #E0E0E0;
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 8px;
    padding: 0.5rem 0.65rem;
    font-family: 'Source Sans 3', system-ui, sans-serif;
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.15s;
}
.lcd-input:focus { border-color: #62D84E; }
.lcd-input::placeholder { color: rgba(255,255,255,0.30); }

.lcd-send-btn {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    background: #62D84E;
    border: none;
    border-radius: 8px;
    color: #021E2F;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    padding: 0;
}
.lcd-send-btn:hover { background: #4EC43C; }
.lcd-send-btn svg { width: 16px; height: 16px; }

/* Drawer body layout — override lm-drawer-body to flex column */
#lm-chatbot-drawer .lm-drawer-body {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
}

/* Inner container holding chat + history panes */
.lcd-inner {
    position: relative;
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Chat pane */
.lcd-chat-pane {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    transform: translateX(0);
    transition: transform 0.22s ease;
}

.lcd-inner.lcd-history-open .lcd-chat-pane {
    transform: translateX(100%);
}

/* History pane */
.lcd-history-pane {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg-panel, #032D42);
    transform: translateX(-100%);
    transition: transform 0.22s ease;
}

.lcd-inner.lcd-history-open .lcd-history-pane {
    transform: translateX(0);
}

.lcd-history-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}

.lcd-history-back {
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.6);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
}
.lcd-history-back:hover { color: #fff; background: rgba(255,255,255,0.08); }
.lcd-history-back svg { width: 14px; height: 14px; }

.lcd-history-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: rgba(255,255,255,0.55);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.lcd-history-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.4rem 0;
}

.lcd-history-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.55rem 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    position: relative;
}
.lcd-history-item:hover { background: rgba(255,255,255,0.05); }
.lcd-history-item-active { background: rgba(98,216,78,0.08); border-left: 2px solid #62D84E; }

.lcd-history-item-body { flex: 1; min-width: 0; }
.lcd-history-item-title {
    font-size: 0.82rem;
    color: #E0E0E0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.lcd-history-item-meta {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.35);
    margin-top: 0.15rem;
}

.lcd-history-item-delete {
    flex-shrink: 0;
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.25);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 0 0.25rem;
    border-radius: 3px;
    align-self: center;
}
.lcd-history-item-delete:hover { color: #FF6B6B; background: rgba(255,107,107,0.1); }

/* Header extra buttons */
.lcd-header-btn {
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.5);
    cursor: pointer;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-size: 1.1rem;
    line-height: 1;
}
.lcd-header-btn:hover { color: #fff; background: rgba(255,255,255,0.08); }
.lcd-header-btn svg { width: 15px; height: 15px; }

/* Empty history state */
.lcd-history-empty {
    padding: 2rem 1rem;
    text-align: center;
    color: rgba(255,255,255,0.3);
    font-size: 0.8rem;
}
