/* Chatbot widget — Apple-flavoured floating chat, Ryan voice */
.chatbot {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9000;
  font-family: inherit;
}

.chatbot-launcher {
  position: relative;
  width: 64px;
  height: 64px;
  padding: 0;
  border-radius: 50%;
  border: 3px solid #ffffff;
  background: #2d7cf1;
  color: #fff;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(45, 124, 241, 0.38),
              0 4px 10px rgba(0, 0, 0, 0.16);
  transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 220ms cubic-bezier(0.22, 1, 0.36, 1);
}
.chatbot-launcher:hover {
  transform: scale(1.06);
  box-shadow: 0 16px 36px rgba(45, 124, 241, 0.46),
              0 6px 14px rgba(0, 0, 0, 0.18);
}
.chatbot-launcher:active { transform: scale(0.97); }
.chatbot-launcher-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 25%;
  display: block;
  transition: opacity 180ms ease, transform 180ms ease;
}
.chatbot-launcher-close {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-90deg);
  opacity: 0;
  color: #fff;
  transition: opacity 180ms ease, transform 180ms ease;
}
.chatbot[data-open="true"] .chatbot-launcher {
  background: #1d1d1f;
}
.chatbot[data-open="true"] .chatbot-launcher-photo {
  opacity: 0;
  transform: scale(0.6);
}
.chatbot[data-open="true"] .chatbot-launcher-close {
  opacity: 1;
  transform: translate(-50%, -50%) rotate(0deg);
}

.chatbot-panel {
  position: absolute;
  right: 0;
  bottom: 72px;
  width: 380px;
  max-width: calc(100vw - 40px);
  height: 560px;
  max-height: calc(100vh - 120px);
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.24),
              0 8px 20px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  pointer-events: none;
  transition: opacity 220ms cubic-bezier(0.22, 1, 0.36, 1),
              transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}
.chatbot[data-open="true"] .chatbot-panel {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.chatbot-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  background: #1d1d1f;
  color: #fff;
}
.chatbot-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: #333;
}
.chatbot-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.chatbot-name { font-weight: 600; font-size: 15px; letter-spacing: -0.01em; }
.chatbot-status {
  font-size: 12px;
  opacity: 0.72;
  display: flex;
  align-items: center;
  gap: 6px;
}
.chatbot-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 2px rgba(52, 211, 153, 0.25);
}

.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f5f5f7;
}
.chatbot-bubble {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.chatbot-bubble--bot {
  background: #fff;
  color: #1d1d1f;
  align-self: flex-start;
  border-bottom-left-radius: 6px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
.chatbot-bubble--user {
  background: #2d7cf1;
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 6px;
}
.chatbot-bubble--typing {
  background: #fff;
  color: #86868b;
  font-style: italic;
  align-self: flex-start;
  border-bottom-left-radius: 6px;
}

.chatbot-composer {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid #e5e5ea;
  background: #fff;
}
.chatbot-input {
  flex: 1;
  border: 1px solid #e5e5ea;
  border-radius: 20px;
  padding: 10px 16px;
  font-size: 14px;
  font-family: inherit;
  background: #f5f5f7;
  outline: none;
  transition: border-color 180ms ease, background 180ms ease;
}
.chatbot-input:focus {
  border-color: #2d7cf1;
  background: #fff;
}
.chatbot-send {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: #2d7cf1;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 180ms ease, transform 180ms ease;
  flex-shrink: 0;
}
.chatbot-send:hover { background: #1d6fe8; }
.chatbot-send:active { transform: scale(0.95); }
.chatbot-send:disabled { opacity: 0.5; cursor: not-allowed; }

@media (max-width: 480px) {
  .chatbot { right: 12px; bottom: 12px; }
  .chatbot-panel {
    width: calc(100vw - 24px);
    height: calc(100vh - 96px);
    bottom: 68px;
  }
}
