/* ── OrchiBot Widget ─────────────────────────────────── */

:root {
  --ohb-green:   #13612e;
  --ohb-pink:    #C4507A;
  --ohb-charcoal:#1A202C;
  --ohb-bg:      #faf9f7;
  --ohb-white:   #ffffff;
  --ohb-grey:    #718096;
  --ohb-lite:    #E2E8F0;
  --ohb-shadow:  0 8px 40px rgba(0,0,0,.18), 0 2px 8px rgba(0,0,0,.12);
}

/* Toggle Button */
#ohb-toggle {
  position: fixed;
  bottom: 28px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--ohb-green);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(19,97,46,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99998;
  transition: transform .25s cubic-bezier(.4,0,.2,1),
              background .22s,
              box-shadow .22s;
  outline: none;
}
#ohb-toggle.pos-right { right: 28px; }
#ohb-toggle.pos-left  { left:  28px; }
#ohb-toggle:hover {
  background: #0f4d24;
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(19,97,46,.55);
}
#ohb-toggle.open {
  background: var(--ohb-pink);
  box-shadow: 0 4px 20px rgba(196,80,122,.4);
}
#ohb-toggle svg { transition: opacity .2s, transform .2s; }
#ohb-toggle .icon-chat  { position:absolute; }
#ohb-toggle .icon-close { position:absolute; opacity:0; transform:rotate(-90deg); }
#ohb-toggle.open .icon-chat  { opacity:0; transform:rotate(90deg); }
#ohb-toggle.open .icon-close { opacity:1; transform:rotate(0); }

/* Notification dot */
#ohb-toggle .ohb-dot {
  position: absolute;
  top: 4px; right: 4px;
  width: 12px; height: 12px;
  background: var(--ohb-pink);
  border-radius: 50%;
  border: 2px solid var(--ohb-white);
  animation: ohb-pulse 2s infinite;
}
@keyframes ohb-pulse {
  0%,100% { transform: scale(1); opacity:1; }
  50%      { transform: scale(1.3); opacity:.7; }
}

/* Chat Window */
#ohb-window {
  position: fixed;
  bottom: 100px;
  width: 370px;
  max-height: 560px;
  background: var(--ohb-white);
  border: 1px solid var(--ohb-lite);
  box-shadow: var(--ohb-shadow);
  display: flex;
  flex-direction: column;
  z-index: 99997;
  transform: translateY(20px) scale(.97);
  opacity: 0;
  pointer-events: none;
  transition: transform .28s cubic-bezier(.4,0,.2,1),
              opacity .28s cubic-bezier(.4,0,.2,1);
  font-family: 'Cormorant Garamond', 'Georgia', serif;
}
#ohb-window.pos-right { right: 28px; }
#ohb-window.pos-left  { left:  28px; }
#ohb-window.open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: all;
}

/* Header */
#ohb-header {
  background: var(--ohb-green);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.ohb-avatar {
  width: 36px; height: 36px;
  background: rgba(255,255,255,.15);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.ohb-header-text { flex: 1; }
.ohb-header-name {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  line-height: 1.1;
}
.ohb-header-sub {
  font-size: 12px;
  color: rgba(255,255,255,.6);
  font-style: italic;
  margin-top: 1px;
}
.ohb-status-dot {
  width: 8px; height: 8px;
  background: #4ade80;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Messages area */
#ohb-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 200px;
  max-height: 360px;
  scroll-behavior: smooth;
}
#ohb-messages::-webkit-scrollbar { width: 4px; }
#ohb-messages::-webkit-scrollbar-track { background: transparent; }
#ohb-messages::-webkit-scrollbar-thumb { background: var(--ohb-lite); border-radius: 2px; }

/* Bubbles */
.ohb-msg {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  animation: ohb-fadein .3s ease both;
}
@keyframes ohb-fadein {
  from { opacity:0; transform:translateY(8px); }
  to   { opacity:1; transform:none; }
}
.ohb-msg.user { flex-direction: row-reverse; }

.ohb-bubble {
  max-width: 82%;
  padding: 10px 14px;
  font-size: 15.5px;
  line-height: 1.6;
  border-radius: 2px;
}
.ohb-msg.bot .ohb-bubble {
  background: var(--ohb-bg);
  color: var(--ohb-charcoal);
  border-left: 3px solid var(--ohb-green);
}
.ohb-msg.user .ohb-bubble {
  background: var(--ohb-green);
  color: #fff;
  font-style: italic;
}

.ohb-bubble a {
  color: var(--ohb-pink);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.ohb-bubble a:hover { color: #a83d67; }

.ohb-msg-avatar {
  width: 26px; height: 26px;
  background: var(--ohb-green);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
  margin-bottom: 2px;
}
.ohb-msg.user .ohb-msg-avatar { background: var(--ohb-pink); }

/* Typing indicator */
.ohb-typing .ohb-bubble {
  background: var(--ohb-bg);
  border-left: 3px solid var(--ohb-green);
  padding: 12px 16px;
}
.ohb-dots { display: flex; gap: 4px; align-items: center; }
.ohb-dots span {
  width: 6px; height: 6px;
  background: var(--ohb-green);
  border-radius: 50%;
  animation: ohb-bounce .9s ease-in-out infinite;
  opacity: .5;
}
.ohb-dots span:nth-child(2) { animation-delay: .15s; }
.ohb-dots span:nth-child(3) { animation-delay: .30s; }
@keyframes ohb-bounce {
  0%,80%,100% { transform:translateY(0); opacity:.5; }
  40%          { transform:translateY(-5px); opacity:1; }
}

/* Suggested questions */
#ohb-suggestions {
  padding: 0 16px 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex-shrink: 0;
}
.ohb-suggestion {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 13px;
  font-style: italic;
  padding: 5px 12px;
  background: var(--ohb-bg);
  border: 1px solid var(--ohb-lite);
  color: var(--ohb-green);
  cursor: pointer;
  transition: background .18s, border-color .18s;
  white-space: nowrap;
}
.ohb-suggestion:hover {
  background: #e8f5ed;
  border-color: var(--ohb-green);
}

/* Input area */
#ohb-input-area {
  border-top: 1px solid var(--ohb-lite);
  padding: 12px 14px;
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex-shrink: 0;
  background: var(--ohb-white);
}
#ohb-input {
  flex: 1;
  border: 1px solid var(--ohb-lite);
  padding: 9px 12px;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 16px;
  color: var(--ohb-charcoal);
  outline: none;
  resize: none;
  min-height: 40px;
  max-height: 100px;
  transition: border-color .2s;
  background: var(--ohb-bg);
  line-height: 1.4;
}
#ohb-input::placeholder { color: #a0aec0; font-style: italic; }
#ohb-input:focus { border-color: var(--ohb-green); background: #fff; }

#ohb-send {
  width: 40px; height: 40px;
  background: var(--ohb-green);
  border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background .2s, transform .18s;
}
#ohb-send:hover { background: #0f4d24; transform: scale(1.05); }
#ohb-send:disabled { background: var(--ohb-lite); cursor: not-allowed; transform: none; }
#ohb-send svg { color: #fff; }

/* Footer branding */
#ohb-footer {
  padding: 6px 16px 8px;
  border-top: 1px solid var(--ohb-lite);
  text-align: center;
  font-size: 11px;
  color: #a0aec0;
  font-family: 'DM Mono', monospace;
  letter-spacing: .06em;
  flex-shrink: 0;
}
#ohb-footer a { color: var(--ohb-green); text-decoration: none; }

/* Mobile */
@media (max-width: 480px) {
  #ohb-window {
    width: calc(100vw - 24px);
    bottom: 90px;
    max-height: 70vh;
  }
  #ohb-window.pos-right,
  #ohb-window.pos-left { right: 12px; left: 12px; }
  #ohb-toggle.pos-right { right: 16px; }
  #ohb-toggle.pos-left  { left:  16px; }
}
