/* ── Digital Jesus Chatbot Widget ── Mid-Hudson Web Brand Colors ── */

:root {
  --dj-primary:    #0a74da;
  --dj-primary-dk: #0558a8;
  --dj-dark:       #f0f2f5;
  --dj-dark2:      #ffffff;
  --dj-white:      #ffffff;
  --dj-light:      #e8f1fb;
  --dj-grey:       #6b7a8d;
  --dj-text:       #1a1a2e;
  --dj-radius:     14px;
  --dj-shadow:     0 8px 32px rgba(10,116,218,0.18), 0 2px 12px rgba(0,0,0,0.12);
}

/* ── Launcher Bubble ── */
#dj-launcher {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--dj-primary), var(--dj-primary-dk));
  box-shadow: 0 4px 18px rgba(10,116,218,0.45);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99998;
  border: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  padding: 0;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
#dj-launcher:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(10,116,218,0.55);
}
#dj-launcher svg {
  width: 28px;
  height: 28px;
  fill: #fff;
  pointer-events: none;
}
#dj-launcher .dj-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 16px;
  height: 16px;
  background: #e74c3c;
  border-radius: 50%;
  border: 2px solid #fff;
  display: none;
  pointer-events: none;
}
#dj-launcher .dj-badge.show { display: block; }

/* ── Chat Window ── */
#dj-window {
  position: fixed;
  bottom: 100px;
  right: 28px;
  width: 370px;
  max-height: 580px;
  background: #f0f2f5;
  border-radius: var(--dj-radius);
  box-shadow: var(--dj-shadow);
  display: flex;
  flex-direction: column;
  z-index: 99999;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px) scale(0.97);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
#dj-window.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* ── Header ── */
#dj-header {
  background: linear-gradient(135deg, var(--dj-primary-dk) 0%, var(--dj-primary) 100%);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.dj-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  border: 2px solid rgba(255,255,255,0.35);
}
.dj-header-info { flex: 1; }
.dj-header-info strong {
  display: block;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
}
.dj-header-info span {
  color: rgba(255,255,255,0.75);
  font-size: 12px;
}
.dj-status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #2ecc71;
  border-radius: 50%;
  margin-right: 5px;
}
#dj-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.8);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  padding: 4px;
  transition: color 0.15s;
}
#dj-close:hover { color: #fff; }

/* ── Messages Area ── */
#dj-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}
#dj-messages::-webkit-scrollbar { width: 4px; }
#dj-messages::-webkit-scrollbar-track { background: transparent; }
#dj-messages::-webkit-scrollbar-thumb { background: #c8d0db; border-radius: 4px; }

/* ── Bubbles ── */
.dj-msg {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  animation: djFadeIn 0.2s ease;
}
@keyframes djFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.dj-msg.dj-bot { justify-content: flex-start; }
.dj-msg.dj-user { justify-content: flex-end; }

.dj-bubble {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
}
.dj-bot .dj-bubble {
  background: #ffffff;
  color: #1a1a2e;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.dj-user .dj-bubble {
  background: var(--dj-primary);
  color: #fff;
  border-bottom-right-radius: 4px;
}

/* ── Quick Buttons ── */
.dj-quick-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 16px 12px;
}
.dj-quick-btn {
  background: transparent;
  border: 1.5px solid var(--dj-primary);
  color: var(--dj-primary);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.dj-quick-btn:hover {
  background: var(--dj-primary);
  color: #fff;
}

/* ── Typing Indicator ── */
.dj-typing {
  display: flex;
  gap: 4px;
  padding: 10px 14px;
  background: #ffffff;
  border-radius: 18px;
  border-bottom-left-radius: 4px;
  width: fit-content;
  align-items: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.dj-typing span {
  width: 7px;
  height: 7px;
  background: #a0aec0;
  border-radius: 50%;
  animation: djBounce 1.2s infinite;
}
.dj-typing span:nth-child(2) { animation-delay: 0.2s; }
.dj-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes djBounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-6px); }
}

/* ── Lead Form ── */
#dj-lead-form {
  padding: 14px 16px;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  flex-shrink: 0;
  display: none;
}
#dj-lead-form.show { display: block; }
#dj-lead-form p {
  color: #6b7a8d;
  font-size: 12px;
  margin: 0 0 10px;
}
.dj-field {
  width: 100%;
  background: #f7f9fc;
  border: 1.5px solid #d1dbe8;
  border-radius: 8px;
  color: #1a1a2e;
  padding: 9px 12px;
  font-size: 13px;
  margin-bottom: 8px;
  box-sizing: border-box;
  transition: border-color 0.15s;
}
.dj-field:focus {
  outline: none;
  border-color: var(--dj-primary);
}
.dj-field::placeholder { color: #a0aec0; }
.dj-submit {
  width: 100%;
  background: linear-gradient(135deg, var(--dj-primary), var(--dj-primary-dk));
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
.dj-submit:hover { opacity: 0.88; }

/* ── Input Bar ── */
#dj-input-bar {
  padding: 12px 14px;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}
#dj-input {
  flex: 1;
  background: #f0f2f5;
  border: 1.5px solid #d1dbe8;
  border-radius: 22px;
  color: #1a1a2e;
  padding: 9px 14px;
  font-size: 14px;
  transition: border-color 0.15s;
  resize: none;
  outline: none;
  font-family: inherit;
}
#dj-input:focus { border-color: var(--dj-primary); }
#dj-input::placeholder { color: #a0aec0; }
#dj-send {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--dj-primary);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}
#dj-send:hover { background: var(--dj-primary-dk); }
#dj-send svg { width: 16px; height: 16px; fill: #fff; }

/* ── Thank You ── */
#dj-thankyou {
  padding: 24px 20px;
  text-align: center;
  display: none;
  background: #ffffff;
}
#dj-thankyou.show { display: block; }
#dj-thankyou .dj-ty-icon { font-size: 36px; margin-bottom: 10px; }
#dj-thankyou h3 { color: #1a1a2e; margin: 0 0 8px; font-size: 17px; }
#dj-thankyou p { color: #6b7a8d; font-size: 14px; margin: 0; line-height: 1.5; }

/* ── Mobile ── */
@media (max-width: 420px) {
  #dj-window {
    width: calc(100vw - 24px);
    right: 12px;
    bottom: 90px;
  }
}
