/* ============================================================
   Lumion Support Chatbot – lumion-chatbot.css
   Posizionamento: /wp-content/plugins/lumion-chatbot/assets/
   ============================================================ */

:root {
  --lc-accent:       #ff6b2b;
  --lc-accent2:      #ff8c54;
  --lc-accent-light: #fff1eb;
  --lc-bg:           #ffffff;
  --lc-surface:      #faf9f6;
  --lc-border:       #e8e4db;
  --lc-text:         #1a1714;
  --lc-muted:        #8c7f72;
  --lc-shadow:       0 24px 60px rgba(0,0,0,0.13), 0 4px 16px rgba(0,0,0,0.07);
  --lc-radius:       18px;
}

/* ── Widget container ── */
#lumion-chat-widget {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 99999;
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Google Font (caricato solo se non già presente) */
#lumion-chat-widget * { box-sizing: border-box; }

/* ── Toggle button ── */
#lumion-chat-toggle {
  width: 62px;
  height: 62px;
  background: var(--lc-accent);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 28px rgba(255,107,43,0.42);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  z-index: 2;
  overflow: hidden;
}
#lumion-chat-toggle::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.2), transparent 60%);
}
#lumion-chat-toggle:hover {
  transform: scale(1.07);
  box-shadow: 0 12px 36px rgba(255,107,43,0.55);
}
#lumion-chat-toggle svg {
  transition: transform 0.3s ease, opacity 0.3s ease;
  position: relative;
  z-index: 1;
}
#lumion-chat-toggle .lc-icon-close {
  position: absolute;
  opacity: 0;
  transform: rotate(-80deg) scale(0.7);
  z-index: 1;
}
#lumion-chat-toggle.lc-open .lc-icon-chat  { opacity: 0; transform: rotate(80deg) scale(0.7); }
#lumion-chat-toggle.lc-open .lc-icon-close { opacity: 1; transform: rotate(0deg) scale(1); }

/* Notification dot */
#lumion-notif-dot {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 15px;
  height: 15px;
  background: #22c55e;
  border: 2.5px solid #fff;
  border-radius: 50%;
  animation: lc-pop 0.3s ease 0.8s both;
}
@keyframes lc-pop { from { transform: scale(0); } to { transform: scale(1); } }

/* Tooltip badge */
#lumion-chat-badge {
  position: absolute;
  bottom: 76px;
  right: 0;
  background: var(--lc-text);
  color: #fff;
  border-radius: 12px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: var(--lc-shadow);
  opacity: 0;
  transform: translateY(8px) scale(0.95);
  animation: lc-badge-in 0.4s ease 1.6s forwards;
  pointer-events: none;
  line-height: 1;
}
#lumion-chat-badge::after {
  content: '';
  position: absolute;
  bottom: -5px;
  right: 22px;
  border: 6px solid transparent;
  border-bottom: none;
  border-top-color: var(--lc-text);
}
@keyframes lc-badge-in { to { opacity: 1; transform: translateY(0) scale(1); } }

/* ── Chat panel ── */
#lumion-chat-panel {
  position: absolute;
  bottom: 78px;
  right: 0;
  width: 385px;
  height: 560px;
  background: var(--lc-bg);
  border: 1.5px solid var(--lc-border);
  border-radius: var(--lc-radius);
  box-shadow: var(--lc-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform-origin: bottom right;
  transform: scale(0.88) translateY(12px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275),
              opacity 0.25s ease;
}
#lumion-chat-panel.lc-open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: all;
}

/* ── Header ── */
.lc-header {
  padding: 16px 20px;
  background: var(--lc-accent);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
.lc-header::before {
  content: '';
  position: absolute;
  top: -20px; right: -20px;
  width: 100px; height: 100px;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
}
.lc-header-avatar {
  width: 42px; height: 42px;
  background: rgba(255,255,255,0.2);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.lc-header-info { flex: 1; position: relative; z-index: 1; }
.lc-header-name   { font-size: 15px; font-weight: 700; color: #fff; line-height: 1.2; }
.lc-header-status { font-size: 11px; color: rgba(255,255,255,0.75); font-family: monospace; }
.lc-kb-badge {
  background: rgba(255,255,255,0.18);
  color: #fff;
  font-size: 9px;
  font-family: monospace;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.25);
  position: relative;
  z-index: 1;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

/* ── Searching banner ── */
.lc-searching {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  font-size: 11px;
  font-family: monospace;
  color: var(--lc-accent);
  background: var(--lc-accent-light);
  border-bottom: 1px solid rgba(255,107,43,0.15);
  flex-shrink: 0;
}
.lc-searching.lc-hidden { display: none; }
.lc-search-dot {
  width: 6px; height: 6px;
  background: var(--lc-accent);
  border-radius: 50%;
  animation: lc-pulse 1s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes lc-pulse { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }

/* ── Messages ── */
#lumion-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}
#lumion-chat-messages::-webkit-scrollbar { width: 4px; }
#lumion-chat-messages::-webkit-scrollbar-thumb {
  background: var(--lc-border);
  border-radius: 2px;
}

.lc-msg {
  display: flex;
  flex-direction: column;
  max-width: 88%;
  animation: lc-msg-in 0.28s ease;
}
@keyframes lc-msg-in {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.lc-msg.lc-user { align-self: flex-end; align-items: flex-end; }
.lc-msg.lc-bot  { align-self: flex-start; }

.lc-bubble {
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.55;
}
.lc-msg.lc-user .lc-bubble {
  background: var(--lc-accent);
  color: #fff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 12px rgba(255,107,43,0.22);
}
.lc-msg.lc-bot .lc-bubble {
  background: #fff;
  border: 1.5px solid var(--lc-border);
  color: var(--lc-text);
  border-bottom-left-radius: 4px;
  font-size: 13px;
  line-height: 1.6;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.lc-bubble code {
  background: rgba(255,107,43,0.1);
  color: #c0440f;
  padding: 1px 5px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 11px;
}
.lc-time {
  font-size: 10px;
  color: var(--lc-muted);
  margin-top: 4px;
  font-family: monospace;
}

/* Source chip */
.lc-source-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--lc-accent-light);
  border: 1px solid rgba(255,107,43,0.2);
  color: var(--lc-accent);
  font-family: monospace;
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 6px;
  margin-top: 5px;
  text-decoration: none;
  transition: background 0.2s;
}
.lc-source-chip:hover { background: rgba(255,107,43,0.15); }

/* Typing indicator */
.lc-typing {
  display: flex;
  gap: 5px;
  align-items: center;
  padding: 12px 14px;
}
.lc-typing span {
  width: 7px; height: 7px;
  background: var(--lc-accent);
  border-radius: 50%;
  animation: lc-bounce 1.2s ease-in-out infinite;
  opacity: 0.5;
}
.lc-typing span:nth-child(2) { animation-delay: 0.2s; }
.lc-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes lc-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30%           { transform: translateY(-7px); opacity: 1; }
}

/* Quick replies */
.lc-quick-replies { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 0; }
.lc-quick-btn {
  font-size: 11.5px;
  background: #fff;
  border: 1.5px solid var(--lc-border);
  color: var(--lc-text);
  padding: 5px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.18s ease;
  font-family: inherit;
  font-weight: 500;
  line-height: 1.3;
}
.lc-quick-btn:hover {
  border-color: var(--lc-accent);
  color: var(--lc-accent);
  background: var(--lc-accent-light);
}

/* ── Input area ── */
.lc-input-area {
  padding: 12px 14px;
  border-top: 1.5px solid var(--lc-border);
  background: var(--lc-surface);
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-shrink: 0;
}
#lumion-chat-input {
  flex: 1;
  background: #fff;
  border: 1.5px solid var(--lc-border);
  border-radius: 12px;
  color: var(--lc-text);
  font-family: inherit;
  font-size: 13px;
  padding: 10px 14px;
  resize: none;
  min-height: 42px;
  max-height: 110px;
  outline: none;
  transition: border-color 0.2s;
  line-height: 1.4;
}
#lumion-chat-input:focus { border-color: var(--lc-accent); }
#lumion-chat-input::placeholder { color: var(--lc-muted); }

#lumion-send-btn {
  width: 42px; height: 42px;
  background: var(--lc-accent);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
  box-shadow: 0 4px 12px rgba(255,107,43,0.3);
}
#lumion-send-btn:hover  { transform: scale(1.06); box-shadow: 0 6px 18px rgba(255,107,43,0.4); }
#lumion-send-btn:active { transform: scale(0.94); }
#lumion-send-btn:disabled { opacity: 0.35; cursor: not-allowed; transform: none; box-shadow: none; }

/* ── Responsive ── */
@media (max-width: 480px) {
  #lumion-chat-panel {
    width: calc(100vw - 24px);
    right: 0;
    bottom: 78px;
    height: 70vh;
  }
  #lumion-chat-widget {
    bottom: 16px;
    right: 12px;
  }
}
