/* WhatsApp-style guest support widget */

.wa-guest-root {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 99990;
  font-family: "Segoe UI", "Helvetica Neue", system-ui, sans-serif;
}

.wa-guest-fab {
  width: 3.75rem;
  height: 3.75rem;
  border: none;
  border-radius: 50%;
  background: #25d366;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.wa-guest-fab:hover {
  transform: scale(1.04);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.32);
}

.wa-guest-fab svg {
  width: 1.75rem;
  height: 1.75rem;
  fill: currentColor;
}

.wa-guest-fab__badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
}

.wa-guest-fab__badge.is-visible {
  display: flex;
}

.wa-guest-panel {
  position: absolute;
  right: 0;
  bottom: 4.5rem;
  width: min(380px, calc(100vw - 2rem));
  height: min(560px, calc(100vh - 6rem));
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  display: none;
  flex-direction: column;
  background: #efeae2;
}

.wa-guest-panel.is-open {
  display: flex;
}

.wa-guest-header {
  background: #008069;
  color: #fff;
  padding: 0.65rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

.wa-guest-header__avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.wa-guest-header__text {
  flex: 1;
  min-width: 0;
}

.wa-guest-header__title {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.25;
}

.wa-guest-header__sub {
  font-size: 0.72rem;
  opacity: 0.9;
  margin: 0.1rem 0 0;
}

.wa-guest-header__close {
  border: none;
  background: transparent;
  color: #fff;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem;
  opacity: 0.9;
}

.wa-guest-header__clear {
  border: none;
  background: transparent;
  color: #fff;
  cursor: pointer;
  padding: 0.35rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.9;
  flex-shrink: 0;
}

.wa-guest-header__clear:hover {
  background: rgba(255, 255, 255, 0.15);
}

.wa-guest-header__clear svg {
  width: 1.15rem;
  height: 1.15rem;
  fill: currentColor;
}

.wa-guest-body {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.wa-guest-onboard {
  flex: 1;
  padding: 1.25rem 1rem;
  background: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.75rem;
}

.wa-guest-onboard h3 {
  margin: 0;
  font-size: 1.05rem;
  color: #111827;
}

.wa-guest-onboard p {
  margin: 0;
  font-size: 0.82rem;
  color: #667781;
  line-height: 1.45;
}

.wa-guest-field label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: #008069;
  margin-bottom: 0.25rem;
}

.wa-guest-field input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #d1d7db;
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
  font: inherit;
  font-size: 0.9rem;
  background: #fff;
  color: #111b21;
  -webkit-text-fill-color: #111b21;
}

.wa-guest-field input::placeholder {
  color: #8696a0;
  opacity: 1;
}

.wa-guest-field input:focus {
  outline: none;
  border-color: #008069;
}

.wa-guest-onboard__error {
  font-size: 0.78rem;
  color: #dc2626;
  min-height: 1.1rem;
}

.wa-guest-onboard__btn {
  border: none;
  border-radius: 8px;
  background: #008069;
  color: #fff;
  font-weight: 600;
  padding: 0.65rem;
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
}

.wa-guest-onboard__btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.wa-guest-messages {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 0.65rem;
  width: 100%;
  box-sizing: border-box;
  background-color: #efeae2;
  background-image: url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23d9d0c3' fill-opacity='0.35'%3E%3Cpath d='M0 0h40v40H0V0zm40 40h40v40H40V40z'/%3E%3C/g%3E%3C/svg%3E");
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.wa-guest-day {
  align-self: center;
  background: rgba(255, 255, 255, 0.92);
  color: #54656f;
  font-size: 0.72rem;
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  margin: 0.35rem 0;
}

.wa-guest-bubble-row {
  display: flex;
  width: 100%;
}

.wa-guest-bubble-row--out {
  justify-content: flex-end;
}

.wa-guest-bubble-row--in {
  justify-content: flex-start;
}

.wa-guest-bubble {
  max-width: 82%;
  padding: 0.35rem 0.5rem 0.25rem 0.65rem;
  border-radius: 8px;
  font-size: 0.875rem;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.08);
}

.wa-guest-bubble--out {
  background: #d9fdd3;
  border-top-right-radius: 2px;
  color: #111b21;
}

.wa-guest-bubble--in {
  background: #fff;
  border-top-left-radius: 2px;
  color: #111b21;
}

.wa-guest-bubble__time {
  display: block;
  text-align: right;
  font-size: 0.65rem;
  color: #667781;
  margin-top: 0.15rem;
}

.wa-guest-compose {
  display: flex;
  align-items: flex-end;
  gap: 0.45rem;
  padding: 0.45rem 0.55rem;
  background: #f0f2f5;
  border-top: 1px solid #d1d7db;
  flex-shrink: 0;
}

.wa-guest-compose textarea {
  flex: 1;
  min-height: 2.35rem;
  max-height: 100px;
  resize: none;
  border: none;
  border-radius: 20px;
  padding: 0.55rem 0.85rem;
  font: inherit;
  font-size: 0.875rem;
  background: #fff;
  color: #111b21;
  -webkit-text-fill-color: #111b21;
}

.wa-guest-compose textarea::placeholder {
  color: #8696a0;
  opacity: 1;
}

.wa-guest-compose textarea:focus {
  outline: none;
}

.wa-guest-send {
  width: 2.35rem;
  height: 2.35rem;
  border: none;
  border-radius: 50%;
  background: #008069;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.wa-guest-send:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.wa-guest-send svg {
  width: 1.1rem;
  height: 1.1rem;
  fill: currentColor;
}

.wa-guest-empty {
  margin: auto;
  text-align: center;
  color: #667781;
  font-size: 0.85rem;
  padding: 1rem;
}

@media (max-width: 480px) {
  .wa-guest-root {
    right: 0.75rem;
    bottom: 0.75rem;
  }

  .wa-guest-panel {
    width: calc(100vw - 1.5rem);
    height: min(520px, calc(100vh - 5.5rem));
    bottom: 4.25rem;
  }
}
