#ys-nanotrix-ai-chat-container {
  margin-bottom: 2rem;
  font-family: inherit;
  /* Inherit theme font */
}

.ys-nanotrix-chat-box {
  background-color: #f4f6f8;
  border-radius: 8px;
  padding: 24px;
  position: relative;
  border: 1px solid #e0e5eb;
  overflow: hidden;
}

.ys-nanotrix-chat-header {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
  z-index: 1;
  position: relative;
}

.ys-nanotrix-chat-avatar {
  width: 32px;
  height: 32px;
  background-color: #1c3d5a;
  border-radius: 50%;
  margin-right: 12px;
}

.ys-nanotrix-chat-title {
  font-weight: 600;
  color: #1c3d5a;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
}

.ys-nanotrix-chat-badge {
  background-color: #a3d977;
  color: #fff;
  font-size: 0.75rem;
  font-weight: bold;
  padding: 2px 8px;
  border-radius: 12px;
  margin-left: 8px;
  text-transform: uppercase;
}

.ys-nanotrix-chat-content {
  display: flex;
  flex-direction: column;
  color: #4a5568;
  font-size: 0.95rem;
  z-index: 1;
  position: relative;
  min-height: 50px;
  max-height: 600px;
  overflow-y: auto;
  padding-right: 10px;
}

/* Chat Bubbles */
.ys-nanotrix-msg {
  margin-bottom: 16px;
  line-height: 1.6;
  word-break: break-word;
}

.ys-nanotrix-msg-user {
  background-color: #e2e8f0;
  color: #2d3748;
  padding: 12px 16px;
  border-radius: 12px;
  border-bottom-right-radius: 4px;
  align-self: flex-end;
  max-width: 80%;
  font-weight: 500;
}

.ys-nanotrix-msg-ai {
  background-color: transparent;
  color: #4a5568;
  align-self: flex-start;
  max-width: 100%;
}

.ys-nanotrix-msg-ai p {
  margin-bottom: 1em;
}

.ys-nanotrix-msg-ai p:last-child {
  margin-bottom: 0;
}

.ys-nanotrix-msg-ai ul,
.ys-nanotrix-msg-ai ol {
  margin-left: 1.5rem;
  margin-bottom: 1em;
}

/* Loader */
.ys-nanotrix-loader {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  padding: 8px 0;
}

.ys-nanotrix-loader span {
  width: 8px;
  height: 8px;
  background-color: #a0aec0;
  border-radius: 50%;
  animation: ys-nanotrix-bounce 1.4s infinite ease-in-out both;
}

.ys-nanotrix-loader span:nth-child(1) {
  animation-delay: -0.32s;
}

.ys-nanotrix-loader span:nth-child(2) {
  animation-delay: -0.16s;
}

.ys-nanotrix-loader span:nth-child(3) {
  animation-delay: 0s;
}

@keyframes ys-nanotrix-bounce {
  0%,
  80%,
  100% {
    transform: scale(0);
  }

  40% {
    transform: scale(1);
  }
}

.ys-nanotrix-chat-footer {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  margin-top: 16px;
  z-index: 1;
  position: relative;
  gap: 12px;
  border-top: 1px solid #e0e5eb;
  padding-top: 16px;
}

.ys-nanotrix-chat-controls {
  display: flex;
  gap: 12px;
  width: 100%;
  align-items: flex-end;
}

.ys-nanotrix-action-bar {
  display: flex;
  justify-content: flex-start;
  margin-top: 8px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.ys-nanotrix-msg-ai:hover .ys-nanotrix-action-bar,
.ys-nanotrix-action-bar.ys-nanotrix-action-bar-visible {
  opacity: 1;
}

.ys-nanotrix-copy-msg-btn {
  background: transparent;
  border: none;
  color: #718096;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s, color 0.2s;
}

.ys-nanotrix-copy-msg-btn:hover {
  background-color: #e2e8f0;
  color: #2d3748;
}

.ys-nanotrix-copy-msg-btn svg {
  width: 16px;
  height: 16px;
}

.ys-nanotrix-chat-input-wrapper {
  display: flex;
  gap: 8px;
  width: 100%;
}

.ys-nanotrix-chat-input-wrapper textarea {
  flex-grow: 1;
  padding: 10px 14px;
  border: 1px solid #cbd5e0;
  border-radius: 6px;
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
  resize: none;
  line-height: 1.5;
  min-height: 42px;
  max-height: 150px;
  overflow-y: auto;
  box-sizing: border-box;
}

.ys-nanotrix-chat-input-wrapper textarea:focus {
  border-color: #1c3d5a;
}

.ys-nanotrix-chat-input-wrapper button {
  padding: 10px;
  background: #1c3d5a;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
  flex-shrink: 0;
  height: 42px;
  width: 42px;
}

.ys-nanotrix-chat-input-wrapper button:hover {
  background: #2a5278;
}

.ys-nanotrix-chat-input-wrapper button:disabled {
  background: #a0aec0;
  cursor: not-allowed;
}

/* Custom Tooltip */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::before,
[data-tooltip]::after {
  position: absolute;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
  bottom: 100%;
  pointer-events: none;
  z-index: 9999;
}

[data-tooltip]::before {
  content: attr(data-tooltip);
  background-color: #1a202c;
  color: #fff;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 0.75rem;
  white-space: nowrap;
  margin-bottom: 6px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  left: 0;
  transform: translate(0, 5px);
}

[data-tooltip]::after {
  content: "";
  border-style: solid;
  border-width: 6px 6px 0 6px;
  border-color: #1a202c transparent transparent transparent;
  margin-bottom: 0px;
  left: 50%;
  transform: translate(-50%, 5px);
}

[data-tooltip]:hover::before {
  visibility: visible;
  opacity: 1;
  transform: translate(0, 0);
}

[data-tooltip]:hover::after {
  visibility: visible;
  opacity: 1;
  transform: translate(-50%, 0);
}

[data-tooltip-pos="right"]::before {
  left: auto;
  right: 0;
}

.ys-nanotrix-watermark {
  position: absolute;
  top: 10px;
  right: 20px;
  width: 100px;
  height: 100px;
  opacity: 0.05;
  z-index: 0;
  pointer-events: none;
}

.ys-nanotrix-cursor {
  display: inline-block;
  width: 8px;
  height: 16px;
  background-color: #1c3d5a;
  animation: ys-blink 1s step-end infinite;
  vertical-align: middle;
  margin-left: 2px;
}

@keyframes ys-blink {
  50% {
    opacity: 0;
  }
}

.ys-nanotrix-hidden {
  display: none !important;
}

.ys-nanotrix-disclaimer {
  flex-basis: 100%;
  text-align: center;
  font-size: 0.75rem;
  color: #1c3d5a;
  font-style: italic;
  margin: 0;
  line-height: 1.4;
  border-top: 1px solid #e0e5eb;
  padding-top: 10px;
}
