@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;700&display=swap');

#nexora-widget-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 999999;
  font-family: 'DM Sans', sans-serif;
  box-sizing: border-box;
}

#nexora-widget-container * {
  box-sizing: border-box;
}

/* ─── Floating chat button ─── */

#nexora-widget-button {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: #C9A84C;
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: none;
  outline: none;
  animation: nexora-pulse 3s ease-in-out infinite;
}

#nexora-widget-button:hover {
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(201, 168, 76, 0.5);
}

@keyframes nexora-pulse {
  0%, 100% {
    box-shadow: 0 4px 12px rgba(0,0,0,0.3), 0 0 0 0 rgba(201, 168, 76, 0.4);
  }
  50% {
    box-shadow: 0 4px 12px rgba(0,0,0,0.3), 0 0 0 12px rgba(201, 168, 76, 0);
  }
}

#nexora-widget-button svg {
  width: 30px;
  height: 30px;
  fill: currentColor;
}

/* ─── Notification bubble ─── */

#nexora-notification-bubble {
  position: absolute;
  bottom: 75px;
  right: 0;
  background: #1a1a1a;
  border: 1px solid #C9A84C;
  border-radius: 10px;
  padding: 12px 16px;
  max-width: 240px;
  font-size: 13px;
  color: #F5F0E8;
  line-height: 1.4;
  box-shadow: 0 6px 20px rgba(0,0,0,0.5);
  cursor: pointer;
  z-index: 10;
  transform: translateX(30px);
  opacity: 0;
  transition: transform 0.4s ease, opacity 0.4s ease;
  pointer-events: none;
}

#nexora-notification-bubble.show {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

#nexora-notification-bubble::after {
  content: '';
  position: absolute;
  bottom: -8px;
  right: 24px;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid #1a1a1a;
}

/* ─── Chat window ─── */

#nexora-widget-window {
  display: none;
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 350px;
  height: 500px;
  background-color: #111;
  border: 1px solid #333;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  flex-direction: column;
  overflow: hidden;
  color: #fff;
  transition: opacity 0.3s ease;
  opacity: 0;
}

#nexora-widget-window.open {
  display: flex;
  opacity: 1;
}

#nexora-widget-header {
  background-color: #000;
  padding: 16px;
  border-bottom: 1px solid #333;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#nexora-widget-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #C9A84C;
}

#nexora-widget-close {
  background: none;
  border: none;
  color: #888;
  cursor: pointer;
  padding: 4px;
  font-size: 24px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

#nexora-widget-close:hover {
  color: #fff;
}

#nexora-widget-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background-color: #111;
}

.nexora-msg {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.4;
  word-wrap: break-word;
}

.nexora-msg.user {
  align-self: flex-end;
  background-color: #C9A84C;
  color: #000;
  border-bottom-right-radius: 4px;
}

.nexora-msg.bot {
  align-self: flex-start;
  background-color: #222;
  color: #fff;
  border-bottom-left-radius: 4px;
}

.nexora-msg.bot.streaming {
  border-right: 2px solid #C9A84C;
  animation: nexora-blink-cursor 0.6s step-end infinite;
}

@keyframes nexora-blink-cursor {
  50% { border-right-color: transparent; }
}

.nexora-msg.error {
  align-self: center;
  background-color: transparent;
  color: #ff6b6b;
  font-size: 12px;
  text-align: center;
}

#nexora-widget-input-area {
  display: flex;
  padding: 12px;
  background-color: #000;
  border-top: 1px solid #333;
  gap: 8px;
}

#nexora-widget-input {
  flex: 1;
  background-color: #222;
  border: 1px solid #333;
  border-radius: 20px;
  padding: 10px 16px;
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

#nexora-widget-input:focus {
  border-color: #C9A84C;
}

#nexora-widget-send {
  background: none;
  border: none;
  color: #C9A84C;
  cursor: pointer;
  padding: 0 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

#nexora-widget-send:hover {
  color: #e6c565;
}

#nexora-widget-send svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

#nexora-widget-send:disabled {
  color: #555;
  cursor: not-allowed;
}

/* ─── Quick-action suggestion buttons ─── */

.nexora-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 0 8px;
  align-self: flex-start;
}

.nexora-suggestion-btn {
  background: transparent;
  border: 1px solid #C9A84C;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 12px;
  color: #F5F0E8;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}

.nexora-suggestion-btn:hover {
  background: #C9A84C;
  color: #000;
}

/* ─── Typing Indicator ─── */

.nexora-typing {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 14px;
}

.nexora-dot {
  width: 6px;
  height: 6px;
  background-color: #888;
  border-radius: 50%;
  animation: nexora-bounce 1.4s infinite ease-in-out both;
}

.nexora-dot:nth-child(1) { animation-delay: -0.32s; }
.nexora-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes nexora-bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

/* ─── Custom Scrollbar ─── */

#nexora-widget-messages::-webkit-scrollbar {
  width: 6px;
}
#nexora-widget-messages::-webkit-scrollbar-track {
  background: #111;
}
#nexora-widget-messages::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 3px;
}
#nexora-widget-messages::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* ─── Mobile Responsiveness ─── */

@media (max-width: 480px) {
  #nexora-widget-window.open {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
    border: none;
  }
}
