/* =====================================================
   Site Chat Assistant — Diablo Electrical
   Version: 2.0.2
   Brand: Dark navy #0f1923, Red accent #c0392b, White
===================================================== */

#site-chat-container {
  position: fixed;
  bottom: 60px;
  right: 24px;
  z-index: 9999;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ── Launch button ── */
#site-chat-launch {
  background: #c0392b;
  color: #ffffff;
  border: none;
  border-radius: 999px;
  padding: 13px 22px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(192, 57, 43, 0.45);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.3px;
  transition: background 0.2s, box-shadow 0.2s;
}
#site-chat-launch:hover {
  background: #a93226;
  box-shadow: 0 8px 24px rgba(192, 57, 43, 0.55);
}

/* ── Chat box ── */
#site-chat-box {
  display: none;
  flex-direction: column;
  width: 370px;
  height: 540px;
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  overflow: hidden;
  margin-bottom: 10px;
}

/* ── Header ── */
#site-chat-header {
  background: #0f1923;
  color: #ffffff;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  flex-shrink: 0;
  border-bottom: 3px solid #c0392b;
}

#site-chat-header strong {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.site-chat-subtitle {
  font-size: 11px;
  opacity: 0.7;
  margin-top: 3px;
  font-weight: 400;
}

.site-chat-close {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
  opacity: 0.8;
  transition: opacity 0.15s;
}
.site-chat-close:hover {
  opacity: 1;
}

/* ── Message body ── */
#site-chat-body {
  padding: 14px 12px;
  background: #f4f5f7;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

/* ── Message bubbles ── */
.site-chat-msg {
  max-width: 85%;
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.5;
  word-break: break-word;
}

.site-chat-msg.user {
  align-self: flex-end;
  background: #c0392b;
  color: #ffffff;
  border-bottom-right-radius: 3px;
}

.site-chat-msg.bot {
  align-self: flex-start;
  background: #ffffff;
  color: #1a1a2e;
  border-bottom-left-radius: 3px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.09);
}

/* ── Bot hint text (description beneath first question) ── */
.site-chat-hint {
  font-size: 11.5px;
  color: #6b7280;
  margin-top: 5px;
  line-height: 1.4;
}

/* ── Typing indicator (three bouncing dots) ── */
.site-chat-typing {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 11px 14px;
  background: #ffffff;
  align-self: flex-start;
  border-radius: 14px;
  border-bottom-left-radius: 3px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.09);
}

.site-chat-typing span {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #c0392b;
  animation: site-chat-bounce 1.2s infinite ease-in-out;
}
.site-chat-typing span:nth-child(1) { animation-delay: 0s;   }
.site-chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.site-chat-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes site-chat-bounce {
  0%, 80%, 100% { transform: scale(0.65); opacity: 0.45; }
  40%           { transform: scale(1.1);  opacity: 1;    }
}

/* ── Footer / input row ── */
#site-chat-footer {
  display: flex;
  border-top: 1px solid #e2e4e8;
  background: #ffffff;
  flex-shrink: 0;
}

#site-chat-input {
  flex: 1;
  border: none;
  padding: 12px 14px;
  font-size: 13.5px;
  outline: none;
  background: #ffffff;
  color: #1a1a2e;
  font-family: inherit;
}

#site-chat-input::placeholder {
  color: #aab0ba;
}

#site-chat-input:disabled {
  background: #f4f5f7;
  color: #aab0ba;
  cursor: not-allowed;
}

#site-chat-send {
  background: #c0392b;
  color: #ffffff;
  border: none;
  padding: 0 18px;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  transition: background 0.2s;
  flex-shrink: 0;
}
#site-chat-send:hover:not(:disabled) {
  background: #a93226;
}
#site-chat-send:disabled {
  background: #5a6170;
  cursor: not-allowed;
}

/* ── Scrollbar (subtle) ── */
#site-chat-body::-webkit-scrollbar {
  width: 4px;
}
#site-chat-body::-webkit-scrollbar-track {
  background: transparent;
}
#site-chat-body::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 4px;
}

/* ── Mobile ── */
@media (max-width: 420px) {
  #site-chat-box {
    width: calc(100vw - 24px);
    height: 480px;
    border-radius: 14px;
  }
  #site-chat-container {
    right: 12px;
    bottom: 60px;
  }
}
