/* Rtribe FAQ chat widget — self-contained, matches site's dark/purple theme. */
#rt-chat-bubble {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #9b5cff;
  box-shadow: 0 4px 20px rgba(155, 92, 255, .5);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 99998;
  border: none;
  font-family: 'Poppins', sans-serif;
  transition: transform .15s ease;
}
#rt-chat-bubble:hover { transform: scale(1.06); }
#rt-chat-bubble svg { width: 26px; height: 26px; fill: #fff; }

#rt-chat-window {
  position: fixed;
  right: 20px;
  bottom: 90px;
  width: 340px;
  max-width: calc(100vw - 32px);
  height: 480px;
  max-height: calc(100vh - 140px);
  background: #0d0512;
  border: 1px solid rgba(155, 92, 255, .3);
  border-radius: 18px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .5);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 99999;
  font-family: 'Poppins', sans-serif;
  color: #fff;
}
#rt-chat-window.open { display: flex; }

#rt-chat-header {
  background: linear-gradient(135deg, #9b5cff, #6b2fd6);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
#rt-chat-header .rt-title { font-weight: 700; font-size: 15px; }
#rt-chat-header .rt-sub { font-size: 11px; opacity: .85; margin-top: 2px; }
#rt-chat-close { background: none; border: none; color: #fff; font-size: 20px; cursor: pointer; line-height: 1; opacity: .8; }
#rt-chat-close:hover { opacity: 1; }

#rt-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
#rt-chat-body::-webkit-scrollbar { width: 4px; }
#rt-chat-body::-webkit-scrollbar-thumb { background: rgba(155, 92, 255, .4); border-radius: 4px; }

.rt-msg { max-width: 85%; font-size: 13px; line-height: 1.5; padding: 9px 12px; border-radius: 12px; word-wrap: break-word; white-space: pre-wrap; }
.rt-msg.bot, .rt-msg.admin { align-self: flex-start; background: rgba(155, 92, 255, .12); border: 1px solid rgba(155, 92, 255, .25); border-bottom-left-radius: 3px; }
.rt-msg.visitor { align-self: flex-end; background: #9b5cff; color: #fff; border-bottom-right-radius: 3px; }
.rt-msg.system { align-self: center; background: transparent; color: rgba(255,255,255,.45); font-size: 11px; text-align: center; max-width: 100%; }
.rt-msg a { color: #c9a8ff; text-decoration: underline; word-break: break-word; }
.rt-msg.visitor a { color: #fff; }

#rt-chat-topics { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 10px; flex-shrink: 0; }
.rt-topic-btn {
  background: rgba(155, 92, 255, .1);
  border: 1px solid rgba(155, 92, 255, .35);
  color: #fff;
  font-size: 11px;
  padding: 6px 10px;
  border-radius: 100px;
  cursor: pointer;
  font-family: inherit;
}
.rt-topic-btn:hover { background: rgba(155, 92, 255, .22); }

#rt-chat-status-chip {
  margin: 0 14px 8px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, .05);
  border-radius: 10px;
  font-size: 11.5px;
  color: rgba(255, 255, 255, .7);
  line-height: 1.5;
  display: none;
}
#rt-chat-status-chip.show { display: block; }

#rt-chat-input-row {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  flex-shrink: 0;
}
#rt-chat-input {
  flex: 1;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 10px;
  color: #fff;
  padding: 9px 12px;
  font-size: 13px;
  font-family: inherit;
  resize: none;
  outline: none;
}
#rt-chat-input:disabled { opacity: .4; cursor: not-allowed; }
#rt-chat-send {
  background: #9b5cff;
  border: none;
  color: #fff;
  width: 38px;
  border-radius: 10px;
  cursor: pointer;
  flex-shrink: 0;
  font-size: 15px;
}
#rt-chat-send:disabled { opacity: .4; cursor: not-allowed; }

#rt-chat-contact-form { padding: 4px 14px 14px; display: flex; flex-direction: column; gap: 8px; flex-shrink: 0; }
#rt-chat-contact-form input, #rt-chat-contact-form select {
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 10px;
  color: #fff;
  padding: 9px 12px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
}
#rt-chat-contact-form select option { background: #0d0512; }
#rt-chat-contact-form button {
  background: #9b5cff;
  border: none;
  color: #fff;
  padding: 10px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
#rt-chat-contact-form .rt-form-error { color: #ff8080; font-size: 11.5px; }
#rt-cf-email-suggestion { margin-top: -4px; font-size: 11.5px; color: rgba(255, 255, 255, .55); }
#rt-cf-email-suggestion button {
  background: none; border: none; padding: 0; margin: 0;
  color: #c9a8ff; text-decoration: underline; font-size: 11.5px; cursor: pointer; font-family: inherit;
}

#rt-chat-rating { padding: 10px 14px 14px; display: flex; flex-direction: column; gap: 8px; align-items: center; flex-shrink: 0; }
#rt-chat-rating .rt-stars { display: flex; gap: 4px; }
#rt-chat-rating .rt-star { font-size: 22px; cursor: pointer; color: rgba(255,255,255,.25); }
#rt-chat-rating .rt-star.active { color: #ffcf4d; }
#rt-chat-rating textarea {
  width: 100%;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 10px;
  color: #fff;
  padding: 8px 10px;
  font-size: 12px;
  font-family: inherit;
  resize: none;
  outline: none;
}
#rt-chat-rating button { background: #9b5cff; border: none; color: #fff; padding: 8px 16px; border-radius: 10px; font-size: 12px; cursor: pointer; font-family: inherit; }
#rt-chat-rating .rt-skip { background: none; color: rgba(255,255,255,.5); text-decoration: underline; }

@media (max-width: 420px) {
  #rt-chat-window { right: 10px; bottom: 82px; width: calc(100vw - 20px); }
  #rt-chat-bubble { right: 14px; bottom: 14px; }
}
