/* ============================================================
   Lannoy Com Manager - AI Chat Agent Styles v2.0
   ============================================================ */

/* ── Floating Button ─────────────────────────────────────── */
#lcm-ai-toggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #E91E8C 0%, #C71A75 100%);
    color: white;
    border: none;
    font-size: 28px;
    cursor: pointer;
    z-index: 99998;
    box-shadow: 0 6px 24px rgba(233,30,140,0.45);
    transition: transform .25s, box-shadow .25s;
    display: flex;
    align-items: center;
    justify-content: center;
}
#lcm-ai-toggle:hover {
    transform: scale(1.12);
    box-shadow: 0 8px 32px rgba(233,30,140,0.55);
}
#lcm-ai-toggle .lcm-ai-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    background: #27AE60;
    border-radius: 50%;
    border: 2px solid white;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Chat Panel ──────────────────────────────────────────── */
#lcm-ai-panel {
    position: fixed;
    bottom: 110px;
    right: 30px;
    width: 400px;
    max-height: 600px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 16px 60px rgba(0,0,0,0.22);
    z-index: 99997;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.85) translateY(20px);
    opacity: 0;
    pointer-events: none;
    transition: transform .3s cubic-bezier(.175,.885,.32,1.275),
                opacity .25s ease;
}
#lcm-ai-panel.open {
    transform: scale(1) translateY(0);
    opacity: 1;
    pointer-events: all;
}

/* ── Panel Header ────────────────────────────────────────── */
.lcm-ai-header {
    background: linear-gradient(135deg, #E91E8C 0%, #C71A75 100%);
    color: white;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}
.lcm-ai-header-avatar {
    width: 42px;
    height: 42px;
    background: rgba(255,255,255,0.25);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}
.lcm-ai-header-info strong {
    display: block;
    font-size: 16px;
    font-weight: 700;
}
.lcm-ai-header-info span {
    font-size: 12px;
    opacity: .85;
}
.lcm-ai-close {
    margin-left: auto;
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s;
    line-height: 1;
}
.lcm-ai-close:hover { background: rgba(255,255,255,0.35); }

/* ── Quick Actions ───────────────────────────────────────── */
.lcm-ai-quick {
    padding: 12px 16px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
    background: #fafafa;
}
.lcm-ai-quick-btn {
    padding: 6px 12px;
    background: white;
    border: 2px solid #E91E8C;
    color: #E91E8C;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    white-space: nowrap;
}
.lcm-ai-quick-btn:hover {
    background: #E91E8C;
    color: white;
}

/* ── Messages ────────────────────────────────────────────── */
.lcm-ai-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
}
.lcm-ai-msg {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    animation: lcmMsgIn .2s ease;
}
@keyframes lcmMsgIn {
    from { opacity:0; transform: translateY(8px); }
    to   { opacity:1; transform: translateY(0); }
}
.lcm-ai-msg.user { flex-direction: row-reverse; }

.lcm-ai-msg-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}
.lcm-ai-msg.ai .lcm-ai-msg-avatar {
    background: linear-gradient(135deg, #E91E8C, #C71A75);
    color: white;
}
.lcm-ai-msg.user .lcm-ai-msg-avatar {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.lcm-ai-msg-bubble {
    max-width: 78%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.6;
    word-break: break-word;
    white-space: pre-wrap;
}
.lcm-ai-msg.ai .lcm-ai-msg-bubble {
    background: #f4f4f8;
    color: #2C3E50;
    border-bottom-left-radius: 4px;
}
.lcm-ai-msg.user .lcm-ai-msg-bubble {
    background: linear-gradient(135deg, #E91E8C, #C71A75);
    color: white;
    border-bottom-right-radius: 4px;
}

/* ── Typing indicator ────────────────────────────────────── */
.lcm-ai-typing {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 10px 14px;
    background: #f4f4f8;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    width: fit-content;
}
.lcm-ai-typing span {
    width: 8px;
    height: 8px;
    background: #E91E8C;
    border-radius: 50%;
    display: inline-block;
    animation: lcmDot 1.2s infinite;
}
.lcm-ai-typing span:nth-child(2) { animation-delay: .2s; }
.lcm-ai-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes lcmDot {
    0%, 80%, 100% { transform: scale(0.7); opacity: .5; }
    40%            { transform: scale(1.1); opacity: 1; }
}

/* ── Copy button on AI messages ──────────────────────────── */
.lcm-ai-copy {
    display: none;
    background: none;
    border: none;
    color: #aaa;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 6px;
    border-radius: 4px;
    transition: color .2s;
    align-self: flex-end;
    margin-left: 4px;
}
.lcm-ai-msg.ai:hover .lcm-ai-copy { display: inline-flex; }
.lcm-ai-copy:hover { color: #E91E8C; }

/* ── Input ───────────────────────────────────────────────── */
.lcm-ai-input-area {
    padding: 14px 16px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    gap: 10px;
    align-items: flex-end;
    flex-shrink: 0;
    background: white;
}
#lcm-ai-input {
    flex: 1;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    max-height: 120px;
    overflow-y: auto;
    transition: border-color .2s;
    outline: none;
    line-height: 1.5;
}
#lcm-ai-input:focus { border-color: #E91E8C; }
#lcm-ai-send {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #E91E8C, #C71A75);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .2s, opacity .2s;
    flex-shrink: 0;
}
#lcm-ai-send:hover { transform: scale(1.1); }
#lcm-ai-send:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ── No API key warning ──────────────────────────────────── */
.lcm-ai-no-key {
    padding: 16px;
    background: #fff8e1;
    margin: 12px;
    border-radius: 10px;
    font-size: 13px;
    color: #7d6608;
    border-left: 4px solid #F39C12;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 480px) {
    #lcm-ai-panel {
        width: calc(100vw - 20px);
        right: 10px;
        bottom: 90px;
    }
    #lcm-ai-toggle { bottom: 20px; right: 20px; }
}
