/* ================================================================
   ELECTRO LIVE TECH — ElectroAI CHATBOT WIDGET
   Clean, premium corporate styling matching #0f172a / #0284c7 theme.
   Minimalist typography, crisp borders, subtle elevation.
   ================================================================ */

/* ── Root Container ── */
#elt-chatbot-root {
  position: fixed;
  bottom: 82px; /* Above the mobile sticky action bar */
  right: 20px;
  z-index: 9999;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ── Floating Bubble Button ── */
.elt-chat-bubble {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #0f172a;
  border: 1px solid #1e293b;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.25), 0 2px 6px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
  color: #ffffff;
}
.elt-chat-bubble:hover {
  background: #0284c7;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(2, 132, 199, 0.35);
}
.elt-chat-bubble:active {
  transform: translateY(0);
}

.elt-chat-bubble-icon,
.elt-chat-bubble-close {
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

/* Subtle online status ring */
.elt-chat-bubble-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 10px;
  height: 10px;
  background: #10b981;
  border: 2px solid #0f172a;
  border-radius: 50%;
}

/* ── Chat Panel ── */
.elt-chat-panel {
  position: absolute;
  bottom: 66px;
  right: 0;
  width: 370px;
  max-width: calc(100vw - 24px);
  height: 540px;
  max-height: calc(100vh - 150px);
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 16px 36px -4px rgba(15, 23, 42, 0.16), 0 4px 12px rgba(15, 23, 42, 0.06);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform-origin: bottom right;
  transform: scale(0.96) translateY(8px);
  opacity: 0;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.18s ease;
  pointer-events: none;
}
.elt-chat-panel.elt-panel-visible {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: all;
}

/* ── Panel Header ── */
.elt-chat-header {
  background: #0f172a;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  border-bottom: 1px solid #1e293b;
}
.elt-chat-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.elt-chat-avatar {
  width: 32px;
  height: 32px;
  background: #1e293b;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.elt-chat-title {
  font-size: 0.94rem;
  font-weight: 600;
  color: #f8fafc;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.elt-chat-subtitle {
  font-size: 0.72rem;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
  font-weight: 500;
}
.elt-chat-subtitle::before {
  content: '';
  width: 6px;
  height: 6px;
  background: #10b981;
  border-radius: 50%;
  display: inline-block;
}
.elt-chat-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* Clean Language Selector */
.elt-lang-select {
  background: #1e293b;
  border: 1px solid #334155;
  color: #f1f5f9;
  border-radius: 6px;
  padding: 4px 6px;
  font-size: 0.72rem;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}
.elt-lang-select:hover {
  background: #334155;
}
.elt-lang-select option {
  background: #0f172a;
  color: #ffffff;
}

/* Close Button */
.elt-chat-close-btn {
  background: transparent;
  border: none;
  border-radius: 6px;
  color: #94a3b8;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
}
.elt-chat-close-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

/* ── Messages Area ── */
.elt-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #f8fafc;
  scroll-behavior: smooth;
}
.elt-chat-messages::-webkit-scrollbar {
  width: 4px;
}
.elt-chat-messages::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

/* Message Wrapper */
.elt-msg-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 90%;
  animation: elt-msg-fade 0.18s ease-out;
}
@keyframes elt-msg-fade {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.elt-msg-bot {
  align-items: flex-start;
  align-self: flex-start;
}
.elt-msg-user {
  align-items: flex-end;
  align-self: flex-end;
}

/* Message Bubble */
.elt-msg-bubble {
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.84rem;
  line-height: 1.5;
  color: #0f172a;
  word-break: break-word;
}
.elt-msg-bot .elt-msg-bubble {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-top-left-radius: 2px;
  color: #1e293b;
}
.elt-msg-user .elt-msg-bubble {
  background: #0284c7;
  color: #ffffff;
  border-top-right-radius: 2px;
}
.elt-msg-bubble strong {
  font-weight: 600;
  color: #0f172a;
}
.elt-msg-user .elt-msg-bubble strong {
  color: #ffffff;
}
.elt-chat-link {
  color: #0284c7;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Quick Action Buttons (clean pills) */
.elt-msg-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 100%;
  margin-top: 2px;
}
.elt-msg-btn {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #1e293b;
  border-radius: 6px;
  padding: 6px 11px;
  font-size: 0.77rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1.3;
  text-align: left;
}
.elt-msg-btn:hover {
  background: #0f172a;
  border-color: #0f172a;
  color: #ffffff;
}
.elt-msg-btn:active {
  transform: scale(0.98);
}

/* Clean Typing Indicator */
.elt-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
}
.elt-typing span {
  width: 5px;
  height: 5px;
  background: #94a3b8;
  border-radius: 50%;
  animation: elt-dot-jump 1.2s infinite ease-in-out;
  display: inline-block;
}
.elt-typing span:nth-child(2) { animation-delay: 0.15s; }
.elt-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes elt-dot-jump {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40%           { transform: translateY(-4px); opacity: 1; }
}

/* Tracking Input Box */
.elt-track-form {
  display: flex;
  gap: 6px;
  width: 100%;
}
.elt-track-input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.8rem;
  color: #0f172a;
  outline: none;
  background: #ffffff;
  font-family: inherit;
  transition: border-color 0.15s;
}
.elt-track-input:focus {
  border-color: #0284c7;
}
.elt-track-submit-btn {
  background: #0f172a;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 0.76rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.elt-track-submit-btn:hover {
  background: #0284c7;
}

/* ── Input Bar ── */
.elt-chat-input-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid #e2e8f0;
  background: #ffffff;
  flex-shrink: 0;
}
.elt-chat-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.82rem;
  color: #0f172a;
  outline: none;
  background: #ffffff;
  font-family: inherit;
  transition: border-color 0.15s;
}
.elt-chat-input:focus {
  border-color: #0284c7;
}
.elt-chat-input::placeholder {
  color: #94a3b8;
}
.elt-chat-send-btn {
  width: 34px;
  height: 34px;
  background: #0f172a;
  border: none;
  border-radius: 6px;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
}
.elt-chat-send-btn:hover {
  background: #0284c7;
}

/* ── Mobile Responsive Adaptations ── */
@media (max-width: 480px) {
  #elt-chatbot-root {
    bottom: 74px;
    right: 12px;
  }
  .elt-chat-panel {
    width: calc(100vw - 24px);
    right: -4px;
    height: calc(100vh - 160px);
    border-radius: 10px;
  }
  .elt-chat-bubble {
    width: 48px;
    height: 48px;
  }
}
