/* ════════════════════════════════════════════════════════
   LIVE CHAT WIDGET (Guest + Logged-in Customer support chat)
   ════════════════════════════════════════════════════════ */

.lc-widget {
  position: fixed;
  /* sits above the .back-to-top button, which also docks at bottom:28px */
  bottom: 92px;
  z-index: 9998;
}

.lc-toggle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 32px rgba(34,197,94,0.4);
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
  position: relative;
}
.lc-toggle:hover { transform: scale(1.08); box-shadow: 0 12px 40px rgba(34,197,94,0.5); }
.lc-toggle--open .lc-toggle-open  { display: none !important; }
.lc-toggle--open .lc-toggle-close { display: flex !important; }
.lc-toggle-open  { display: flex; align-items: center; justify-content: center; color: #fff; font-size: 1.3rem; }
.lc-toggle-close { display: none; align-items: center; justify-content: center; color: #fff; font-size: 1.1rem; }

.lc-toggle-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  background: #ef4444;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

.lc-window {
  position: absolute;
  bottom: 70px;
  right: 0;
  width: 340px;
  background: #0d1322;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 480px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(0.97);
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
  pointer-events: none;
}
.lc-window--open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

.lc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  background: linear-gradient(135deg, rgba(34,197,94,0.15), rgba(22,163,74,0.12));
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}
.lc-header-info { display: flex; align-items: center; gap: 10px; }
.lc-header-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(34,197,94,0.15);
  display: flex; align-items: center; justify-content: center;
  color: #22c55e; font-size: 1.1rem;
}
.lc-name { color: #fff; font-weight: 600; font-size: 0.9rem; }
.lc-status { display: flex; align-items: center; gap: 5px; font-size: 0.75rem; color: rgba(255,255,255,0.6); }
.lc-status-dot { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; }
.lc-status-dot--offline { background: #94a3b8; }
.lc-close { background: none; border: none; color: rgba(255,255,255,0.6); font-size: 1rem; cursor: pointer; }
.lc-close:hover { color: #fff; }

.lc-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 260px;
}

.lc-msg { display: flex; }
.lc-msg--mine { justify-content: flex-end; }
.lc-msg--bot { justify-content: flex-start; }
.lc-msg-bubble {
  max-width: 78%;
  padding: 9px 13px;
  border-radius: 14px;
  font-size: 0.85rem;
  line-height: 1.4;
  word-wrap: break-word;
}
.lc-msg--bot .lc-msg-bubble { background: rgba(255,255,255,0.06); color: #e2e8f0; border-bottom-left-radius: 4px; }
.lc-msg--mine .lc-msg-bubble { background: linear-gradient(135deg, #22c55e, #16a34a); color: #fff; border-bottom-right-radius: 4px; }
.lc-msg-bubble .lc-status-icon { font-size: 0.7rem; opacity: 0.85; margin-left: 2px; }
.lc-msg-system {
  text-align: center;
  font-size: 0.72rem;
  color: rgba(255,255,255,0.45);
  padding: 2px 10px;
}

.lc-typing-indicator { padding: 0 16px 6px; color: rgba(255,255,255,0.5); font-size: 0.75rem; font-style: italic; }

.lc-name-prompt { padding: 0 16px 10px; }
.lc-name-input {
  width: 100%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 8px 12px;
  color: #fff;
  font-size: 0.8rem;
}

/* ── Attachments ── */
.lc-attachment-img {
  display: block;
  max-width: 100%;
  max-height: 180px;
  border-radius: 10px;
  margin-bottom: 4px;
  object-fit: cover;
}
.lc-attachment-pdf {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  color: inherit;
  text-decoration: underline;
  font-size: 0.82rem;
}
.lc-file-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 16px 8px;
  padding: 6px 10px;
  background: rgba(255,255,255,0.06);
  border-radius: 10px;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.75);
}
.lc-file-preview span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lc-file-preview button { background: none; border: none; color: rgba(255,255,255,0.5); cursor: pointer; }
.lc-file-preview button:hover { color: #fff; }

.lc-footer { padding: 12px 14px; border-top: 1px solid rgba(255,255,255,0.07); flex-shrink: 0; }
.lc-input-wrap { display: flex; align-items: center; gap: 8px; }
.lc-attach {
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.lc-attach:hover { color: #fff; border-color: rgba(255,255,255,0.2); }
.lc-input {
  flex: 1;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  padding: 9px 15px;
  color: #fff;
  font-size: 0.85rem;
}
.lc-input:focus { outline: none; border-color: #22c55e; }
.lc-send {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  border: none; color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.lc-send:hover { opacity: 0.9; }

@media (max-width: 480px) {
  .lc-window { width: calc(100vw - 40px); right: -8px; }
}
