/* Digilumos ChatBot - Frontend Widget */
:root {
    --dlc-orange: #D9883F;
    --dlc-dark:   #c0772e;
    --dlc-z:      99999;
}

#dlc-chat-wrapper {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: var(--dlc-z);
    font-family: 'Poppins', Arial, sans-serif;
    font-size: 14px;
}

/* Launcher */
#dlc-launcher {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: var(--dlc-orange);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 4px 20px rgba(217,136,63,.55);
    transition: transform .2s, box-shadow .2s;
    position: relative;
}
#dlc-launcher:hover { transform: scale(1.08); box-shadow: 0 6px 28px rgba(217,136,63,.7); }
#dlc-launcher:after {
    content: '';
    position: absolute;
    width: 58px; height: 58px;
    border-radius: 50%;
    border: 3px solid rgba(217,136,63,.4);
    animation: dlc-pulse 2.2s infinite;
    pointer-events: none;
}
@keyframes dlc-pulse {
    0%   { transform: scale(1);   opacity: 1; }
    70%  { transform: scale(1.4); opacity: 0; }
    100% { transform: scale(1.4); opacity: 0; }
}

/* Chat box */
#dlc-chat-box {
    position: absolute;
    bottom: 72px;
    right: 0;
    width: 360px;
    max-height: 580px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0,0,0,.18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: dlc-up .25s ease;
}
@keyframes dlc-up {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Header */
#dlc-header {
    background: var(--dlc-orange);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.dlc-avatar {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: rgba(255,255,255,.2);
    display: flex; align-items: center; justify-content: center;
    color: #fff; flex-shrink: 0;
}
.dlc-header-info { flex: 1; display: flex; flex-direction: column; }
.dlc-name   { color: #fff; font-weight: 600; font-size: 14px; line-height: 1.2; }
.dlc-status { color: rgba(255,255,255,.85); font-size: 11px; display: flex; align-items: center; gap: 4px; margin-top: 2px; }
.dlc-dot    { width: 7px; height: 7px; border-radius: 50%; background: #4cff91; display: inline-block; animation: dlc-blink 2s infinite; }
@keyframes dlc-blink { 0%,100%{opacity:1} 50%{opacity:.4} }
#dlc-close-btn { background: none; border: none; color: rgba(255,255,255,.85); font-size: 18px; cursor: pointer; padding: 0 4px; flex-shrink: 0; }
#dlc-close-btn:hover { color: #fff; }

/* Messages */
#dlc-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 14px 8px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scroll-behavior: smooth;
}
#dlc-messages::-webkit-scrollbar { width: 4px; }
#dlc-messages::-webkit-scrollbar-thumb { background: #ddd; border-radius: 4px; }

.dlc-msg {
    max-width: 82%;
    padding: 10px 13px;
    border-radius: 14px;
    line-height: 1.55;
    font-size: 13.5px;
    word-wrap: break-word;
    animation: dlc-pop .18s ease;
}
@keyframes dlc-pop { from{opacity:0;transform:scale(.9)} to{opacity:1;transform:scale(1)} }

.dlc-msg.dlc-user { background: var(--dlc-orange); color: #fff; border-bottom-right-radius: 4px; align-self: flex-end; }
.dlc-msg.dlc-bot  { background: #f2f2f2; color: #2d2d2d; border-bottom-left-radius: 4px; align-self: flex-start; }
.dlc-msg.dlc-bot a { color: var(--dlc-orange); }

/* Typing indicator */
.dlc-typing { display: flex; gap: 5px; align-items: center; padding: 12px 14px; background: #f2f2f2; border-radius: 14px; border-bottom-left-radius: 4px; align-self: flex-start; max-width: 72px; }
.dlc-typing span { width: 7px; height: 7px; border-radius: 50%; background: #aaa; animation: dlc-bounce 1.2s infinite; }
.dlc-typing span:nth-child(2) { animation-delay: .2s; }
.dlc-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes dlc-bounce { 0%,60%,100%{transform:translateY(0)} 30%{transform:translateY(-6px)} }

/* Quick replies */
#dlc-quick-replies { padding: 6px 14px 8px; display: flex; flex-wrap: wrap; gap: 6px; flex-shrink: 0; }
.dlc-chip {
    background: #fff;
    border: 1.5px solid var(--dlc-orange);
    color: var(--dlc-orange);
    border-radius: 20px;
    padding: 5px 13px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s, color .15s;
    font-family: inherit;
}
.dlc-chip:hover { background: var(--dlc-orange); color: #fff; }

/* Input row */
#dlc-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px 12px;
    border-top: 1px solid #f0f0f0;
    flex-shrink: 0;
}
#dlc-input {
    flex: 1;
    border: 1.5px solid #e0e0e0;
    border-radius: 22px;
    padding: 8px 14px;
    font-size: 13.5px;
    font-family: inherit;
    color: #2d2d2d;
    outline: none;
    transition: border-color .15s;
    background: #fafafa;
}
#dlc-input:focus { border-color: var(--dlc-orange); background: #fff; }
#dlc-send {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: var(--dlc-orange);
    border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: #fff; flex-shrink: 0;
    transition: background .15s;
}
#dlc-send:hover { background: var(--dlc-dark); }

/* Footer bar */
#dlc-footer-bar { text-align: center; font-size: 10.5px; color: #bbb; padding: 4px 0 8px; flex-shrink: 0; }
#dlc-footer-bar a { color: var(--dlc-orange); text-decoration: none; font-weight: 500; }

/* Lead form */
#dlc-lead-form {
    background: #fffaf5;
    border: 1.5px solid #f0dcc5;
    border-radius: 12px;
    padding: 14px;
    margin: 4px 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-self: stretch;
}
#dlc-lead-form input {
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    padding: 8px 11px;
    font-size: 13px;
    font-family: inherit;
    width: 100%;
    box-sizing: border-box;
    outline: none;
    transition: border-color .15s;
}
#dlc-lead-form input:focus { border-color: var(--dlc-orange); }
#dlc-lead-form button {
    background: var(--dlc-orange);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 9px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background .15s;
}
#dlc-lead-form button:hover { background: var(--dlc-dark); }
#dlc-lead-form .dlc-err { color: #c0392b; font-size: 11.5px; margin: 0; }

/* Responsive */
@media (max-width: 400px) {
    #dlc-chat-wrapper { bottom: 16px; right: 12px; }
    #dlc-chat-box { width: calc(100vw - 24px); right: -12px; max-height: 72vh; }
}
