/* ==========================================================================
   Nexora Real-Time Live Chat Widget Styling
   ========================================================================== */

#hedgeinv-livechat-root {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999999;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #f1f5f9;
  font-size: 14px;
}

/* Floating Launcher Button */
.hinv-chat-launcher {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  user-select: none;
}
.hinv-chat-launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}
.hinv-chat-launcher:active {
  transform: translateY(0);
}
.hinv-chat-launcher svg {
  width: 26px;
  height: 26px;
  fill: #ffffff;
  transition: transform 0.2s ease;
}
.hinv-chat-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: #ef4444;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Chat Popover Window */
.hinv-chat-window {
  position: fixed;
  bottom: 96px;
  right: 24px;
  width: 380px;
  height: 560px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 120px);
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 999999;
}
.hinv-chat-window.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Header */
.hinv-chat-header {
  padding: 14px 16px;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.hinv-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
}
.hinv-avatar-stack {
  position: relative;
  width: 36px;
  height: 36px;
  background: #3b82f6;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.2);
}
.hinv-online-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 9px;
  height: 9px;
  background: #10b981;
  border-radius: 50%;
  border: 2px solid #0f172a;
}
.hinv-header-title {
  font-size: 14px;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.2;
}
.hinv-header-status {
  font-size: 11px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 4px;
}
.hinv-header-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}
.hinv-btn-icon {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.hinv-btn-icon:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #f1f5f9;
}

/* Quick Action Chips */
.hinv-chips-bar {
  padding: 8px 12px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.hinv-chips-bar::-webkit-scrollbar {
  display: none;
}
.hinv-chip {
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  padding: 5px 10px;
  border-radius: 12px;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.hinv-chip:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: #3b82f6;
  color: #60a5fa;
}

/* Messages Stream */
.hinv-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}
.hinv-msg-row {
  display: flex;
  flex-direction: column;
  max-width: 82%;
  animation: hinvMsgFadeIn 0.2s ease-out;
}
@keyframes hinvMsgFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.hinv-msg-row.user {
  align-self: flex-end;
}
.hinv-msg-row.bot,
.hinv-msg-row.admin {
  align-self: flex-start;
}
.hinv-msg-tag {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 3px;
  color: #94a3b8;
}
.hinv-msg-row.bot .hinv-msg-tag {
  color: #a5b4fc;
}
.hinv-msg-row.admin .hinv-msg-tag {
  color: #6ee7b7;
}
.hinv-msg-bubble {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.48;
  word-break: break-word;
  white-space: pre-wrap;
}
.hinv-msg-row.user .hinv-msg-bubble {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  border-bottom-right-radius: 3px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}
.hinv-msg-row.bot .hinv-msg-bubble {
  background: #1e1b4b;
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #e0e7ff;
  border-bottom-left-radius: 3px;
}
.hinv-msg-row.admin .hinv-msg-bubble {
  background: #064e3b;
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #ecfdf5;
  border-bottom-left-radius: 3px;
}
.hinv-msg-time {
  font-size: 10px;
  color: #64748b;
  margin-top: 3px;
  text-align: right;
}

/* Typing Indicator */
.hinv-typing-bubble {
  align-self: flex-start;
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 8px 14px;
  border-radius: 12px;
  display: none;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #94a3b8;
  border-bottom-left-radius: 3px;
}
.hinv-typing-dots {
  display: flex;
  gap: 3px;
}
.hinv-typing-dots span {
  width: 5px;
  height: 5px;
  background: #38bdf8;
  border-radius: 50%;
  animation: hinvDotBounce 1.4s infinite ease-in-out both;
}
.hinv-typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.hinv-typing-dots span:nth-child(2) { animation-delay: -0.16s; }
@keyframes hinvDotBounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

/* Footer / Input Bar */
.hinv-chat-footer {
  padding: 12px;
  background: rgba(15, 23, 42, 0.9);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  gap: 8px;
  align-items: center;
}
.hinv-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 10px 14px;
  font-size: 13.5px;
  color: #f1f5f9;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s, background 0.2s;
}
.hinv-input:focus {
  border-color: #3b82f6;
  background: rgba(255, 255, 255, 0.08);
}
.hinv-send-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #3b82f6;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s, transform 0.15s;
}
.hinv-send-btn:hover {
  background: #2563eb;
  transform: scale(1.05);
}
.hinv-send-btn svg {
  width: 16px;
  height: 16px;
  fill: #ffffff;
}


/* ==========================================================================
   Nexora look: dark glass + gold (overrides the defaults above)
   ========================================================================== */
#hedgeinv-livechat-root { font-family: 'Inter', 'Segoe UI', -apple-system, sans-serif; }
#hedgeinv-livechat-root .hinv-chat-launcher {
  background: linear-gradient(135deg, #182644 0%, #0e1729 100%);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(212,175,106,.25);
  border: 1px solid rgba(212,175,106,.4);
}
#hedgeinv-livechat-root .hinv-chat-launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(212,175,106,.45);
}
#hedgeinv-livechat-root .hinv-chat-launcher svg { fill: #e8c988; }
#hedgeinv-livechat-root .hinv-chat-window {
  background: rgba(11,18,32,.97); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(212,175,106,.22); box-shadow: 0 24px 70px rgba(0,0,0,.65);
}
#hedgeinv-livechat-root .hinv-chat-header {
  background: linear-gradient(135deg, #121b2e 0%, #0e1729 100%);
  border-bottom: 1px solid rgba(212,175,106,.18);
}
#hedgeinv-livechat-root .hinv-avatar-stack {
  background: #0e1729; border: 1px solid rgba(212,175,106,.5); color: #e8c988;
}
#hedgeinv-livechat-root .hinv-avatar-stack svg { width: 70%; height: 70%; }
#hedgeinv-livechat-root .hinv-header-title { font-family: 'Chakra Petch', 'Segoe UI', sans-serif; letter-spacing: .3px; color: #f1e3bf; }
#hedgeinv-livechat-root .hinv-header-status { color: #8fa0c2; display: flex; align-items: center; gap: 6px; }
#hedgeinv-livechat-root .hinv-live-dot {
  width: 7px; height: 7px; border-radius: 50%; background: #34d399; display: inline-block;
  box-shadow: 0 0 0 3px rgba(52,211,153,.18);
}
#hedgeinv-livechat-root .hinv-chips-bar { border-bottom: 1px solid rgba(255,255,255,.05); }
#hedgeinv-livechat-root .hinv-chip {
  background: transparent; border: 1px solid rgba(212,175,106,.35); color: #e8c988; font-weight: 500;
}
#hedgeinv-livechat-root .hinv-chip:hover { background: rgba(212,175,106,.12); border-color: rgba(232,201,136,.7); color: #fff3d6; }
#hedgeinv-livechat-root .hinv-send-btn { background: linear-gradient(135deg, #e8c988, #b8904a); }
#hedgeinv-livechat-root .hinv-send-btn svg { fill: #0b1220; }
#hedgeinv-livechat-root .hinv-input:focus { border-color: rgba(212,175,106,.6); box-shadow: 0 0 0 3px rgba(212,175,106,.12); }
#hedgeinv-livechat-root .hinv-chat-badge { background: #34d399; color: #04120a; }
#hedgeinv-livechat-root .hinv-msg-row.user .hinv-msg-bubble {
  background: linear-gradient(135deg, #e8c988, #c49a52); color: #0b1220; font-weight: 500;
  box-shadow: 0 4px 14px rgba(212,175,106,.22);
}
#hedgeinv-livechat-root .hinv-msg-row.bot .hinv-msg-bubble { background: #121b2e; border: 1px solid #223252; color: #e8edf7; }
#hedgeinv-livechat-root .hinv-msg-row.bot .hinv-msg-tag { color: #d4af6a; }
#hedgeinv-livechat-root .hinv-msg-row.admin .hinv-msg-bubble { background: #0d2a24; border: 1px solid rgba(52,211,153,.3); color: #e7fbf3; }
