/* ===== StaySafer Chat Widget ===== */
#ss-chat-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #028468;
  color: #fff;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  border: none;
  cursor: pointer;
  font-size: 28px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
  z-index: 9999;
}

/* closed by default */
#ss-chat {
  display: none; /* JS toggles this */
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 340px;
  height: 460px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
  z-index: 9999;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

.ss-chat__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #028468;
  color: #fff;
  padding: 10px 12px;
  font-weight: 600;
}

.ss-chat__messages {
  flex: 1;
  padding: 10px;
  overflow-y: auto;
  background: #fafafa;
}

.ss-msg {
  max-width: 78%;
  margin: 8px 0;
  padding: 8px 12px;
  border-radius: 12px;
  line-height: 1.4;
  font-size: 14px;
  word-wrap: break-word;
  white-space: pre-wrap;
}
.ss-msg--user {
  margin-left: auto;
  background: #e6f4f1;
  border: 1px solid #cdeae4;
}
.ss-msg--bot {
  margin-right: auto;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
}

.ss-chat__input {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid #e5e7eb;
  background: #fff;
}
#ss-chat-text {
  flex: 1;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px;
  font-size: 14px;
  outline: none;
}
#ss-chat-send {
  background: #028468;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 0 14px;
  cursor: pointer;
}

/* loader overlay */
.ss-chat__loader {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(2px);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
}
.ss-chat__loader.is-active {
  display: flex;
}
.ss-loader-text {
  font-size: 13px;
  color: #374151;
}

.ss-spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid #e5e7eb;
  border-top-color: #028468;
  animation: spin 0.9s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.ss-typing span {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin: 0 2px;
  border-radius: 50%;
  background: #028468;
  opacity: 0.3;
  animation: bounce 1.2s infinite ease-in-out;
}
.ss-typing span:nth-child(2) {
  animation-delay: 0.2s;
}
.ss-typing span:nth-child(3) {
  animation-delay: 0.4s;
}
@keyframes bounce {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.3;
  }
  40% {
    transform: translateY(-6px);
    opacity: 1;
  }
}

/* mobile */
@media (max-width: 420px) {
  #ss-chat {
    right: 12px;
    left: 12px;
    width: auto;
  }
}
/* ===== /StaySafer Chat Widget ===== */
