* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  font-family: Arial, sans-serif;
  background: transparent;
}

body {
  display: flex;
}

.chat-widget {
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: #f3f3f3;
  overflow: hidden;
  border-radius: 0;
}

.chat-header {
  height: 56px;
  background: linear-gradient(135deg, #a63fe0, #8c2fd4);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  flex-shrink: 0;
}

.chat-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-logo {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  background: #ffffff;
  display: block;
  border: 2px solid rgba(255, 255, 255, 0.55);
}

.chat-header-text {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.header-icon-btn {
  border: none;
  background: transparent;
  color: #ffffff;
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  width: 30px;
  height: 30px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px 18px 10px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #f3f3f3;
}

.message-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  width: 100%;
}

.message-row.bot {
  justify-content: flex-start;
}

.message-row.user {
  justify-content: flex-end;
}

.message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background: #ffffff;
  flex-shrink: 0;
  border: 1px solid #d8d8d8;
}

.message-avatar.hidden {
  visibility: hidden;
}

.message-bubble-wrap {
  max-width: 78%;
  display: flex;
  flex-direction: column;
}

.message {
  padding: 14px 16px;
  border-radius: 14px;
  line-height: 1.45;
  font-size: 13px;
  word-break: break-word;
}

.message.bot {
  background: #e4e4e4;
  color: #111111;
  border-top-left-radius: 8px;
}

.message.user {
  background: #a63fe0;
  color: #ffffff;
  border-top-right-radius: 8px;
  font-weight: 600;
}

.message a {
  display: inline-block;
  margin-top: 8px;
  color: #4f46e5;
  text-decoration: none;
  font-weight: 500;
}

.message.user a {
  color: #ffffff;
  text-decoration: underline;
}

.chat-input-wrap {
  background: #f3f3f3;
  padding: 10px 16px 12px;
  flex-shrink: 0;
}

.chat-input-area {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #ffffff;
  border: 1px solid #dddddd;
  border-radius: 999px;
  padding: 8px 10px 8px 16px;
  min-height: 50px;
}

.chat-input-area input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 15px;
  background: transparent;
  color: #444444;
}

.chat-input-area input::placeholder {
  color: #8b8b8b;
}

.send-btn {
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #ececec;
  color: #5e5e5e;
  font-size: 18px;
  cursor: pointer;
  flex-shrink: 0;
}

.send-btn:hover {
  opacity: 0.92;
}

.chat-footer-note {
  text-align: center;
  font-size: 11px;
  color: #7a7a7a;
  margin-top: 9px;
}

.typing {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.typing span {
  width: 6px;
  height: 6px;
  background: #8f8f8f;
  border-radius: 50%;
  display: inline-block;
  animation: bounce 1.2s infinite ease-in-out;
}

.typing span:nth-child(2) {
  animation-delay: 0.15s;
}

.typing span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes bounce {
  0%, 80%, 100% {
    transform: scale(0.7);
    opacity: 0.6;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}
