/* Widget container */
#unikixsupportbot-widget {
  width: 300px;
  min-width: 220px;
  min-height: 260px;
  height: 400px; /* Explicit height for flexbox to work */
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 9999;
  border: 1px solid #ccc;
  padding: 10px;
  border-radius: 8px;
  background: #fafafa;
  font-family: sans-serif;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

/* Resizer */
#unikixsupportbot-resizer {
  position: absolute;
  top: 0;
  left: 0;
  width: 16px;
  height: 16px;
  cursor: nwse-resize;
  z-index: 10000;
}
#unikixsupportbot-resizer svg {
  display: block;
}

/* Header */
.unikixsupportbot-header {
  font-weight: bold;
  font-size: 16px;
  background: #006699;
  color: #fff;
  padding: 8px 0 8px 10px;
  border-radius: 6px 6px 0 0;
  margin: -10px -10px 10px -10px;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Minimize button */
#unikixsupportbot-minimize {
  background: none;
  border: none;
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0 10px 0 10px;
}

/* Chat history */
#unikixsupportbot-history {
  flex: 1 1 auto;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #eee;
  padding: 8px;
  border-radius: 4px;
  min-height: 60px;
  /* Ensure it grows/shrinks with flex */
  box-sizing: border-box;
}

/* Input row */
.unikixsupportbot-input-row {
  display: flex;
  flex: 0 0 auto;
}

/* Input */
#unikixsupportbot-input {
  flex: 1;
  padding: 6px;
  border-radius: 4px;
  border: 1px solid #ccc;
  box-sizing: border-box;
}

/* Send button */
#unikixsupportbot-send {
  margin-left: 6px;
  padding: 6px 12px;
  border-radius: 4px;
  border: none;
  background: #006699;
  color: #fff;
  cursor: pointer;
}

/* Footer */
.unikixsupportbot-footer {
  font-size: 11px;
  color: #888;
  text-align: center;
  margin-top: 4px;
  flex: 0 0 auto;
}

/* Typing indicator */
.unikixsupportbot-typing {
  display: inline-block;
  vertical-align: middle;
}
.unikixsupportbot-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin: 0 1px;
  background: #bbb;
  border-radius: 50%;
  opacity: 0.5;
  animation: unikix-bounce 1.2s infinite both;
}
.unikixsupportbot-dot:nth-child(1) { animation-delay: 0s; }
.unikixsupportbot-dot:nth-child(2) { animation-delay: 0.2s; }
.unikixsupportbot-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes unikix-bounce {
  0%, 80%, 100% { opacity: 0.5; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-6px); }
}

/* Minimized state */
#unikixsupportbot-widget.minimized {
  height: 48px !important;
  min-height: 48px !important;
  width: 48px !important;
  min-width: 48px !important;
  max-width: 48px !important;
  box-sizing: border-box;
  overflow: visible;
  position: fixed !important;
  right: 24px;
  bottom: 24px;
  z-index: 9999;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
}
#unikixsupportbot-widget.minimized > :not(.unikix-speech-bubble) {
  display: none !important;
}

/* Message bubble spacing (matches original) */
.unikixsupportbot-message {
  margin-bottom: 6px;
}
.unikixsupportbot-message .unikixsupportbot-user {
  color: #007bff;
}
.unikixsupportbot-message .unikixsupportbot-bot {
  color: #333;
}

/* Bot message flex alignment */
.unikixsupportbot-message-bot {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 8px;
}

/* Message content (left side) */
.unikixsupportbot-message-content {
  flex: 1;
  min-width: 0;
  word-break: break-word;
  width: 100%;
  display: block;
}

/* Copy to clipboard icon styles */
.unikixsupportbot-copy-btn {
  cursor: pointer;
  vertical-align: middle;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  margin-left: 8px;
  margin-right: 0;
  width: 20px;
  height: 20px;
  opacity: 0.7;
  transition: opacity 0.2s, transform 0.15s;
}
.unikixsupportbot-copy-btn:hover {
  opacity: 1;
}

/* SVG speech bubble for minimized icon */
#unikixsupportbot-widget.minimized .unikix-speech-bubble {
  display: block;
  position: absolute;
  right: -12px;
  bottom: -8px;
  width: 96px;
  height: 64px;
  cursor: pointer;
  z-index: 10002;
  animation: unikix-svg-bubble-pop 1.2s cubic-bezier(.68,-0.55,.27,1.55) 0s 1, unikix-svg-bubble-talk 1.8s infinite;
  transform-origin: right bottom;
}
#unikixsupportbot-widget:not(.minimized) .unikix-speech-bubble {
  display: none !important;
}
@keyframes unikix-svg-bubble-pop {
  0%   { opacity: 0; transform: scale(0.7) translateY(20px); }
  60%  { opacity: 1; transform: scale(1.08) translateY(-6px); }
  80%  { opacity: 1; transform: scale(0.97) translateY(2px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes unikix-svg-bubble-talk {
  0%, 100% { transform: scale(1) translateY(0); }
  10% { transform: scale(1.04,0.96) translateY(-2px); }
  20% { transform: scale(0.98,1.04) translateY(2px); }
  30% { transform: scale(1.03,0.97) translateY(-1px); }
  40% { transform: scale(0.97,1.03) translateY(1px); }
  50% { transform: scale(1.01,0.99) translateY(0); }
  60% { transform: scale(1) translateY(0); }
}


.unikixsupportbot-timestamp {
  font-size: 11px;
  color: #888;
  text-align: right;
  margin-top: 2px;
}

/* Format the chat messages */
.unikixsupportbot-message-pre {
  background: #f4f4f4;   
  padding: 8px;           
  border-radius: 4px;     
  overflow-x: auto;       
  line-height: 1.5;       
  margin: 0;
}

/* spacing for markdown elements */
.unikixsupportbot-message-pre p,
.unikixsupportbot-message-pre ul,
.unikixsupportbot-message-pre ol,
.unikixsupportbot-message-pre li {
  margin-top: 0;
  margin-bottom: 0;
  line-height: 1.5;
}

/* separation between paragraphs if needed */
.unikixsupportbot-message-pre p + p {
  margin-top: 2px;
}

/* compact code blocks generated by marked (```...```text) */
.unikixsupportbot-message-pre pre {
  background: #eee;
  padding: 4px;
  border-radius: 3px;
  overflow-x: auto;
  line-height: 1.5;
  margin: 2px 0;
}

.unikixsupportbot-message-pre code {
  font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
  line-height: 1.0;
}

