* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  background: transparent;
}

.chat-widget {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100%;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 4px 24px rgba(20, 20, 43, 0.12);
}

/* Header */
.chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  background: linear-gradient(135deg, #6d5bff 0%, #4f7cff 100%);
  color: #fff;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.avatar svg {
  width: 20px;
  height: 20px;
  color: #fff;
}

.header-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.header-title {
  font-weight: 600;
  font-size: 14.5px;
  letter-spacing: 0.1px;
}

.header-status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #35e08a;
  box-shadow: 0 0 0 2px rgba(53, 224, 138, 0.25);
}

/* Messages */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f6f7fb;
  scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar {
  width: 6px;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: #d7dbe6;
  border-radius: 10px;
}

.msg-row {
  display: flex;
  animation: fadeSlideIn 0.25s ease;
}

.msg-row.user {
  justify-content: flex-end;
}

.msg-row.bot {
  justify-content: flex-start;
}

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.msg {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.45;
  word-wrap: break-word;
}

.msg.user {
  background: linear-gradient(135deg, #6d5bff 0%, #4f7cff 100%);
  color: #fff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 2px 8px rgba(79, 124, 255, 0.25);
}

.msg.bot {
  background: #fff;
  color: #24263a;
  border: 1px solid #e8eaf1;
  border-bottom-left-radius: 4px;
}

.msg.typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 13px 16px;
}

.typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #b7bcd1;
  animation: bounce 1.2s infinite ease-in-out;
}

.typing-dot:nth-child(2) { animation-delay: 0.15s; }
.typing-dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* Input */
.chat-input {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background: #fff;
  border-top: 1px solid #edeef4;
}

.chat-input input {
  flex: 1;
  padding: 11px 16px;
  border: 1px solid #e3e5ef;
  background: #f6f7fb;
  border-radius: 24px;
  outline: none;
  font-size: 14px;
  font-family: inherit;
  color: #24263a;
  transition: border-color 0.15s, background 0.15s;
}

.chat-input input:focus {
  border-color: #6d5bff;
  background: #fff;
}

.chat-input input::placeholder {
  color: #9a9db3;
}

.chat-input button {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, #6d5bff 0%, #4f7cff 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  box-shadow: 0 2px 8px rgba(79, 124, 255, 0.35);
}

.chat-input button svg {
  width: 17px;
  height: 17px;
  margin-left: 1px;
}

.chat-input button:hover {
  transform: translateY(-1px) scale(1.04);
}

.chat-input button:active {
  transform: scale(0.96);
}
