/* ═══════════════════════════════════════════════════════════════
   Blessings Digital Photocopy and BookBinding Services Inc. — Chatbot & Branch Messaging Styles
   Add these to your theme's style.css (after existing chatbot styles)
   ═══════════════════════════════════════════════════════════════ */

/* ── Typing indicator ─────────────────────────────────────────── */
.bcc-typing {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  padding: 2px 0;
}
.bcc-typing span {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #056920;
  opacity: 0.4;
  animation: bcc-bounce 1.2s infinite ease-in-out;
}
.bcc-typing span:nth-child(2) { animation-delay: 0.2s; }
.bcc-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bcc-bounce {
  0%, 80%, 100% { transform: scale(0.8); opacity: 0.4; }
  40%           { transform: scale(1.2); opacity: 1; }
}

/* ── Branch action bubble ─────────────────────────────────────── */
.bcc-action-bubble {
  background: #f0f7f3;
  border: 1px solid #c3dece;
  padding: 12px 14px;
}

.bcc-action-label {
  margin: 0 0 10px;
  font-size: 13px;
  color: #555;
}

.bcc-action-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.bcc-msg-branch-toggle {
  padding: 7px 16px;
  background: #056920;
  color: #fff;
  border: none;
  border-radius: 20px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}
.bcc-msg-branch-toggle:hover  { background: #245f3f; }
.bcc-msg-branch-toggle:active { transform: scale(0.97); }

.bcc-branch-picker { animation: bcc-fade-in 0.15s ease; }
@keyframes bcc-fade-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.bcc-branch-msg-btn {
  padding: 6px 12px;
  background: #fff;
  color: #056920;
  border: 1px solid #056920;
  border-radius: 20px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.1s;
  white-space: nowrap;
}
.bcc-branch-msg-btn:hover  { background: #056920; color: #fff; }
.bcc-branch-msg-btn:active { transform: scale(0.97); }

/* ── Contact form bubble ──────────────────────────────────────── */
.bcc-form-bubble {
  min-width: 260px;
  max-width: 320px;
  padding: 14px 16px;
}

.bcc-form-title {
  margin: 0 0 14px;
  font-size: 14px;
  font-weight: 500;
  color: #056920;
}

.bcc-form-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  margin: 10px 0 4px;
  color: #555;
}

.bcc-required {
  color: #e53e3e;
  margin-left: 2px;
}

.bcc-form-input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
  background: #fff;
  color: #333;
}
.bcc-form-input:focus {
  outline: none;
  border-color: #056920;
  box-shadow: 0 0 0 3px rgba(46, 125, 82, 0.12);
}

.bcc-form-textarea {
  resize: vertical;
  min-height: 76px;
}

.bcc-form-error {
  display: none;
  font-size: 11px;
  color: #e53e3e;
  margin-top: 3px;
}

.bcc-form-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.bcc-form-submit {
  padding: 8px 18px;
  background: #056920;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s;
}
.bcc-form-submit:hover:not(:disabled) { background: #245f3f; }
.bcc-form-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.bcc-form-cancel {
  padding: 8px 14px;
  background: transparent;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  color: #666;
  transition: background 0.15s;
}
.bcc-form-cancel:hover { background: #f5f5f5; }

.bcc-form-status {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.5;
}

/* ═══════════════════════════════════════════════════════════════
   WIDGET SHELL — FAB + chat window
   ═══════════════════════════════════════════════════════════════ */

/* FAB toggle button */
#bcc-chat-toggle {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9999;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #056920;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(5,105,32,0.35);
  transition: background 0.2s, transform 0.15s;
}
#bcc-chat-toggle:hover { background: #034A16; transform: scale(1.06); }

/* Chat widget window */
#bcc-chat-widget {
  display: none;
  position: fixed;
  bottom: 94px;
  right: 28px;
  z-index: 9998;
  width: 360px;
  max-height: 560px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.18);
  flex-direction: column;
  overflow: hidden;
  font-family: 'DM Sans', sans-serif;
}
#bcc-chat-widget.bcc-open {
  display: flex;
}

/* Header */
.bcc-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: #056920;
  color: #fff;
  flex-shrink: 0;
}
.bcc-avatar {
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.bcc-header-info { flex: 1; }
.bcc-header-name   { margin: 0; font-size: 13.5px; font-weight: 600; }
.bcc-header-status { margin: 0; font-size: 11px; opacity: 0.8; }
#bcc-chat-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  opacity: 0.8;
  transition: opacity 0.15s;
}
#bcc-chat-close:hover { opacity: 1; }

/* Branch bar */
.bcc-branch-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: #f0f7f3;
  border-bottom: 1px solid #d4e6d9;
  flex-shrink: 0;
}
.bcc-branch-label {
  font-size: 11.5px;
  color: #555;
  white-space: nowrap;
}
#bcc-branch-select {
  flex: 1;
  font-size: 12px;
  font-family: inherit;
  padding: 4px 8px;
  border: 1px solid #c3dece;
  border-radius: 6px;
  background: #fff;
  color: #0b1e0f;
  cursor: pointer;
}

/* Messages area */
#bcc-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}

/* Message bubbles */
.bcc-message {
  display: flex;
  gap: 8px;
  max-width: 88%;
}
.bcc-assistant { align-self: flex-start; }
.bcc-user      { align-self: flex-end; flex-direction: row-reverse; }

.bcc-bubble {
  padding: 9px 13px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.55;
  word-break: break-word;
}
.bcc-assistant .bcc-bubble {
  background: #f0f7f3;
  border: 1px solid #d4e6d9;
  color: #0b1e0f;
  border-bottom-left-radius: 4px;
}
.bcc-user .bcc-bubble {
  background: #056920;
  color: #fff;
  border-bottom-right-radius: 4px;
}

/* Input row */
.bcc-input-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid #e8f0ea;
  flex-shrink: 0;
  background: #fff;
}
#bcc-user-input {
  flex: 1;
  resize: none;
  border: 1px solid #d4e6d9;
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 13.5px;
  font-family: inherit;
  line-height: 1.4;
  max-height: 120px;
  overflow-y: auto;
  outline: none;
  background: #f9fdf9;
  color: #0b1e0f;
  transition: border-color 0.15s;
}
#bcc-user-input:focus { border-color: #056920; background: #fff; }
#bcc-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #056920;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}
#bcc-send-btn:hover { background: #034A16; }

/* ── Header actions (Message dropdown + close button) ─────────── */
.bcc-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex-shrink: 0;
}

.bcc-msg-dropdown-wrap {
  position: relative;
}

#bcc-msg-branch-btn {
  padding: 5px 11px;
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 20px;
  color: #fff;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
#bcc-msg-branch-btn:hover { background: rgba(255,255,255,0.28); }

#bcc-msg-branch-list {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 220px;
  max-height: 260px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #d4e6d9;
  border-radius: 10px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.13);
  list-style: none;
  margin: 0;
  padding: 4px 0;
  z-index: 10001;
  animation: bcc-fade-in 0.15s ease;
}
#bcc-msg-branch-list.bcc-open { display: block; }

#bcc-msg-branch-list li {
  padding: 7px 14px;
  font-size: 12px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #0b1e0f;
  cursor: pointer;
  transition: background 0.12s;
}
#bcc-msg-branch-list li:hover { background: #f0f7f3; color: #056920; }

/* Mobile */
@media (max-width: 480px) {
  #bcc-chat-widget {
    width: calc(100vw - 24px);
    right: 12px;
    bottom: 82px;
    max-height: 70vh;
  }
  #bcc-chat-toggle {
    right: 16px;
    bottom: 20px;
  }
}
