.dex-chat-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  font-family: Inter, system-ui, sans-serif;
}

/* Toggle Button */
.dex-chat-toggle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #1F4E79;
  border: none;
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(140, 46, 71, 0.3);
  transition: transform 0.3s;
}

.dex-chat-toggle:hover {
  transform: scale(1.05);
}

/* Chat Box */
.dex-chat-box {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 380px;
  height: 600px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(140, 46, 71, 0.15);
  border: 1px solid rgba(140, 46, 71, 0.2);
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.dex-chat-box.open {
  display: flex;
}

/* Header */
.dex-chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  color: #1f2937;
  border-bottom: 1px solid rgba(140, 46, 71, 0.1);
}

.dex-chat-header img {
  width: 32px;
  height: 32px;
}

.dex-chat-header div {
  display: flex;
  flex-direction: column;
}

.dex-chat-header strong {
  font-size: 16px;
  color: #1f2937;
}

.dex-chat-header span {
  font-size: 12px;
  color: #6b7280;
}

.dex-close {
  margin-left: auto;
  background: none;
  border: none;
  color: #1f2937;
  font-size: 22px;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.dex-close:hover {
  opacity: 1;
}

/* Welcome Screen */
.dex-welcome-screen {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 20px;
  text-align: center;
  width: 100%;
  max-width: 300px;
}

.dex-welcome-text {
  font-size: 24px;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 24px;
  line-height: 1.3;
}

.dex-new-chat-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 16px 24px;
  background: #1F4E79;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  transition: transform 0.3s;
  margin-bottom: 12px;
  font-family: inherit;
}

.dex-new-chat-btn:hover {
  transform: scale(1.02);
}

.dex-response-text {
  font-size: 14px;
  color: #6b7280;
  margin: 0;
}

/* Chat Interface */
.dex-chat-interface {
  display: none;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.dex-chat-interface.active {
  display: flex;
}

/* Messages */
.dex-chat-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.dex-bot {
  background: #f3f4f6;
  border: 1px solid rgba(140, 46, 71, 0.2);
  color: #1f2937;
  padding: 12px 16px;
  border-radius: 12px;
  margin-bottom: 10px;
  max-width: 80%;
  align-self: flex-start;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
}

.dex-bot a {
  color: #1F4E79;
  text-decoration: underline;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.dex-bot p {
  margin: 8px 0;
  padding: 0;
}

.dex-bot p:first-child {
  margin-top: 0;
}

.dex-bot p:last-child {
  margin-bottom: 0;
}

.dex-bot ul,
.dex-chat-box .dex-bot ul {
  padding-left: 20px !important;
  margin: 6px 0 !important;
  list-style: disc outside !important;
  list-style-type: disc !important;
}

.dex-bot li,
.dex-chat-box .dex-bot li {
  margin-bottom: 6px !important;
  display: list-item !important;
  list-style: disc outside !important;
  list-style-type: disc !important;
  list-style-position: outside !important;
}

.dex-user {
  background: #1F4E79;
  color: #ffffff;
  padding: 12px 16px;
  border-radius: 12px;
  margin-bottom: 10px;
  max-width: 80%;
  align-self: flex-end;
  font-size: 14px;
  line-height: 1.5;
  box-shadow: 0 4px 12px rgba(140, 46, 71, 0.2);
  word-wrap: break-word;
}

/* Typing Indicator */
.dex-typing {
  display: inline-flex;
  gap: 5px;
  padding: 14px 18px;
}

.dex-typing span {
  width: 6px;
  height: 6px;
  background: #1F4E79;
  border-radius: 50%;
  animation: dex-blink 1.4s infinite both;
}

.dex-typing span:nth-child(2) {
  animation-delay: 0.2s;
}

.dex-typing span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes dex-blink {
  0% { opacity: 0.2; }
  20% { opacity: 1; }
  100% { opacity: 0.2; }
}

/* Input Area */
.dex-chat-input {
  display: flex;
  padding: 12px;
  gap: 8px;
  border-top: 1px solid rgba(140, 46, 71, 0.1);
}

.dex-chat-input textarea {
  flex: 1;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid rgba(140, 46, 71, 0.2);
  outline: none;
  background: #f9fafb;
  color: #1f2937;
  font-size: 14px;
  font-family: inherit;
  resize: none;
}

.dex-chat-input textarea::placeholder {
  color: #9ca3af;
}

.dex-chat-input button {
  background: #1F4E79;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 0 20px;
  cursor: pointer;
  font-weight: 500;
  font-family: inherit;
  transition: transform 0.2s;
}

.dex-chat-input button:hover {
  transform: scale(1.05);
}

/* Footer */
.dex-chat-footer {
  padding: 8px;
  text-align: center;
  font-size: 12px;
  color: #1F4E79;
  opacity: 0.6;
  border-top: 1px solid rgba(140, 46, 71, 0.1);
}
