/* ============================================================
   Hope Therapy Chat Bubble & Screening Panel — chat-widget.css
   Hope Therapy & Counselling Services · hopefulminds.co.uk
   ============================================================ */

* { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Floating bubble button ── */
.htc-chat-bubble {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #2a9d8f;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(72, 81, 105, 0.35);
  z-index: 9999;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.htc-chat-bubble:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(72, 81, 105, 0.45);
}
.htc-chat-bubble svg { fill: white; }

/* ── Slide-up panel ── */
.htc-panel {
  position: fixed;
  bottom: 100px;
  right: 24px;
  width: 400px;
  max-width: calc(100vw - 48px);
  height: 580px;
  max-height: calc(100vh - 140px);
  border-radius: 20px;
  background: #faf8f5;
  box-shadow: 0 12px 48px rgba(0,0,0,0.15), 0 2px 8px rgba(0,0,0,0.08);
  z-index: 9998;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.htc-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* ── Panel header ── */
.htc-panel-header {
  background: #0d4f47;
  color: white;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.htc-panel-header .htc-left { display: flex; align-items: center; gap: 10px; }
.htc-panel-header .htc-title { font-weight: 700; font-size: 15px; }
.htc-panel-header .htc-subtitle { font-size: 11px; opacity: 0.85; }
.htc-panel-header .htc-right { display: flex; gap: 6px; }

.htc-header-btn {
  background: rgba(255,255,255,0.15);
  border: none;
  border-radius: 8px;
  padding: 4px 10px;
  cursor: pointer;
  color: white;
  font-size: 12px;
  font-family: inherit;
}
.htc-header-btn.htc-close { font-size: 18px; padding: 4px 8px; line-height: 1; }
.htc-header-btn.htc-back  { font-size: 16px; padding: 4px 8px; }

/* ── Panel body & footer ── */
.htc-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 16px;
  scroll-behavior: smooth;
}

.htc-panel-footer {
  padding: 10px 16px;
  border-top: 1px solid #ebebeb;
  background: white;
  text-align: center;
  font-size: 11px;
  color: #636E72;
  flex-shrink: 0;
}

/* ── Global link colour ── */
.htc-panel-footer a,
.htc-contact-info a,
.htc-crisis-inner .htc-resource-number a,
.htc-msg-box a,
.htc-panel a {
  color: #1f8f81;
  text-decoration: none;
}

/* ── Message bubbles ── */
.htc-msg-box {
  background: white;
  border-radius: 16px;
  padding: 16px 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
  font-size: 14.5px;
  line-height: 1.65;
}
.htc-msg-box .htc-heading {
  font-size: 17px;
  font-weight: 600;
  color: #1f8f81;
  margin-bottom: 10px;
}
.htc-msg-box .htc-muted { font-size: 13px; color: #3d3d3d; }
.htc-msg-box ul { padding-left: 20px; line-height: 1.8; font-size: 14px; }

/* ── Option buttons ── */
.htc-opt-btn {
  border: 1.5px solid #7a7a7a;
  background: white;
  color: #0d4f47;
  padding: 14px 18px;
  width: 100%;
  margin-bottom: 8px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1.4;
}
.htc-opt-btn:hover {
  border-color: #1f8f81;
  background: #ebebeb;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.htc-opt-btn.htc-crisis-opt {
  border-color: #F5C6C0;
  background: #FDF2F0;
}
.htc-opt-btn.htc-crisis-opt:hover {
  border-color: #C0392B;
  background: #FADBD8;
}
.htc-opt-btn .htc-opt-title { font-weight: 600; margin-bottom: 3px; }
.htc-opt-btn .htc-opt-desc  { font-size: 12.5px; color: #dff0ed; }

/* ── Primary / secondary buttons ── */
.htc-primary-btn {
  background-color: #1f8f81;
  color: white;
  padding: 14px 24px;
  font-size: 15px;
  font-weight: 600;
  width: 100%;
  text-align: center;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s ease;
  margin-top: 8px;
}
.htc-primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(72,81,105,0.3);
  color: white;
}

.htc-secondary-btn {
  background: transparent;
  color: #1f8f81;
  padding: 10px 16px;
  font-size: 13px;
  text-align: center;
  width: 100%;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
}


.htc-cat-btn:hover {background: #dff0ed;}
span.htc-tag:hover {background: #dff0ed;}


/* ── Reassurance cards ── */
.htc-reassurance {
  background: #dff0ed;
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 12px;
  border: 1px solid #2a9d8f;
  font-size: 13px;
  line-height: 1.55;
  animation: htcFadeSlide 0.5s ease forwards;
}
.htc-reassurance .htc-r-title { font-size: 15px; margin-bottom: 6px; }
.htc-reassurance .htc-r-body  { color: #1f8f81; }

/* ── Crisis box ── */
.htc-crisis-box {
  background: #FDF2F0;
  border: 1.5px solid #C0392B;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 12px;
}
.htc-crisis-box .htc-crisis-heading {
  font-size: 17px;
  font-weight: 600;
  color: #C0392B;
  margin-bottom: 12px;
}

.htc-crisis-inner {
  background: white;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 10px;
}
.htc-crisis-inner .htc-danger-label  { font-weight: 700; color: #C0392B; margin-bottom: 12px; font-size: 15px; }
.htc-crisis-inner .htc-big-number    { font-size: 22px; font-weight: 700; color: #C0392B; margin-bottom: 14px; }
.htc-crisis-inner hr                 { border: none; border-top: 1px solid #FADBD8; margin: 14px 0; }
.htc-crisis-inner .htc-resource-name { font-weight: 600; margin-bottom: 4px; font-size: 14px; }
.htc-crisis-inner .htc-resource-desc { font-size: 13px; color: #636E72; margin-bottom: 4px; }
.htc-crisis-inner .htc-resource-number { font-size: 18px; font-weight: 700; color: #485169; }
.htc-crisis-inner .htc-resource-text   { font-size: 16px; font-weight: 700; color: #485169; }

/* ── Category accordion buttons ── */
.htc-cat-btn {
  width: 100%;
  padding: 12px 16px;
  background: white;
  border: 1.5px solid #d4d4d4;
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: #0d4f47;
  cursor: pointer;
  font-family: inherit;
  margin-bottom: 6px;
  transition: all 0.2s ease;
}
.htc-cat-btn.expanded { background: #ebebeb; border-color: #0d4f47; }
.htc-cat-btn .htc-count { color: #0d4f47; font-size: 12px; margin-left: 8px; }
.htc-cat-btn .htc-arrow { font-size: 12px; color: #1f8f81; }

/* ── Tags ── */
.htc-tags { padding: 8px 4px 4px; display: flex; flex-wrap: wrap; }
.htc-tag {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 13px;
  margin: 3px 4px;
  cursor: pointer;
  border: 1.5px solid #7a7a7a;
  background: white;
  color: #1f8f81;
  font-weight: 400;
  transition: all 0.2s ease;
  font-family: inherit;
}
.htc-tag.selected { border-color: #7a7a7a; background: #ebebeb; color: #1f8f81; font-weight: 600; }

/* ── Text inputs ── */
.htc-custom-input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1.5px solid #7a7a7a;
  font-family: inherit;
  font-size: 14px;
  outline: none;
  background: white;
  margin: 8px 0;
  transition: border-color 0.2s;
}
.htc-custom-input:focus { border-color: #1f8f81; }

/* ── FAQ accordion ── */
.htc-faq-btn {
  width: 100%;
  padding: 12px 16px;
  background: white;
  border: 1.5px solid #7a7a7a;
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: #0d4f47;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  margin-bottom: 6px;
  transition: all 0.2s ease;
  text-align: left;
}
.htc-faq-btn.expanded  { background: #ebebeb; border-color: #0d4f47; }
.htc-faq-answer {
  padding: 12px 16px;
  font-size: 13.5px;
  line-height: 1.6;
  color: #7a7a7a;
  background: white;
  border-radius: 0 0 12px 12px;
  margin-top: -6px;
  margin-bottom: 8px;
}

/* ── Typing indicator ── */
.htc-typing { display: flex; gap: 4px; padding: 12px 16px; align-items: center; }
.htc-typing .htc-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #ebebeb;
  animation: htcTypePulse 1.2s infinite;
}
.htc-typing .htc-dot:nth-child(1) { animation-delay: 0s; }
.htc-typing .htc-dot:nth-child(2) { animation-delay: 0.2s; }
.htc-typing .htc-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes htcTypePulse {
  0%, 100% { background: #ebebeb; }
  50%       { background: #0d4f47; }
}

@keyframes htcFadeSlide {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.htc-fade-in       { animation: htcFadeSlide 0.5s ease forwards; }
.htc-fade-in-delay { animation: htcFadeSlide 0.5s ease 0.1s forwards; opacity: 0; }

/* ── Misc ── */
.htc-contact-info {
  text-align: center;
  padding: 10px 0;
  font-size: 13px;
  color: #2a9d8f;
}

.htc-rel-tags { display: flex; flex-wrap: wrap; margin-bottom: 12px; }
