/* ==========================================================================
   ROBLUZ - LUXURY AI ADVISOR CHAT WIDGET
   High-Ticket Consultation & Interactive Knowledge Engine
   ========================================================================== */

#nexus-chat-root {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Floating Teaser Bubble */
.nexus-chat-teaser {
  position: absolute;
  bottom: 76px;
  right: 0;
  background: #111827;
  border: 1px solid var(--border-gold, #eab308);
  border-radius: 16px;
  padding: 12px 18px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
  width: 290px;
  font-size: 0.84rem;
  color: #e2e8f0;
  line-height: 1.45;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  animation: teaserSlideUp 0.4s ease forwards;
  transition: all 0.25s ease;
}

.nexus-chat-teaser:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.75);
}

.nexus-chat-teaser::after {
  content: '';
  position: absolute;
  bottom: -8px;
  right: 28px;
  width: 14px;
  height: 14px;
  background: #111827;
  border-right: 1px solid #eab308;
  border-bottom: 1px solid #eab308;
  transform: rotate(45deg);
}

.nexus-teaser-close {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}

.nexus-teaser-close:hover {
  color: #ffffff;
}

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

/* Floating Trigger Button */
.nexus-chat-trigger {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #111827 0%, #1a233a 100%);
  border: 1.5px solid #eab308;
  border-radius: 999px;
  padding: 8px 18px 8px 8px;
  color: #ffffff;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6), 0 0 18px rgba(234, 179, 8, 0.3);
  cursor: pointer;
  transition: all 0.25s ease;
}

.nexus-chat-trigger:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.8), 0 0 25px rgba(234, 179, 8, 0.45);
}

.nexus-avatar-ring {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  position: relative;
  background: #1e293b;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #eab308;
}

.nexus-avatar-ring svg {
  width: 24px;
  height: 24px;
  color: #eab308;
}

.nexus-online-badge {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #10b981;
  border: 2px solid #111827;
  box-shadow: 0 0 8px #10b981;
}

.nexus-trigger-info {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.nexus-trigger-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: #ffffff;
}

.nexus-trigger-status {
  font-size: 0.72rem;
  color: #eab308;
  font-weight: 600;
}

/* Chat Window Modal / Dialog */
.nexus-chat-window {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 400px;
  height: 600px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 40px);
  background: #111827;
  border: 1.5px solid #eab308;
  border-radius: 20px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85), 0 0 30px rgba(234, 179, 8, 0.25);
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: chatPopUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.nexus-chat-window.active {
  display: flex;
}

@keyframes chatPopUp {
  from { opacity: 0; transform: scale(0.92) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Window Header */
.nexus-chat-header {
  background: linear-gradient(90deg, #0d1320 0%, #162035 100%);
  border-bottom: 1px solid #242f47;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nexus-header-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nexus-header-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #1a253c;
  border: 1.5px solid #eab308;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nexus-header-avatar svg {
  color: #eab308;
}

.nexus-header-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
}

.nexus-header-status {
  font-size: 0.74rem;
  color: #10b981;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nexus-status-dot-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
}

.nexus-close-btn {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.nexus-close-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

/* Chat Messages Container */
.nexus-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: #0b0f17;
  scroll-behavior: smooth;
}

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

.nexus-chat-messages::-webkit-scrollbar-thumb {
  background: #242f47;
  border-radius: 4px;
}

/* Message Bubbles */
.nexus-msg {
  display: flex;
  flex-direction: column;
  max-width: 85%;
  line-height: 1.5;
  font-size: 0.88rem;
  animation: msgFadeIn 0.25s ease forwards;
}

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

.nexus-msg.bot {
  align-self: flex-start;
}

.nexus-msg.user {
  align-self: flex-end;
}

.nexus-msg-bubble {
  padding: 12px 16px;
  border-radius: 14px;
  position: relative;
}

.nexus-msg.bot .nexus-msg-bubble {
  background: #162035;
  border: 1px solid #242f47;
  color: #e2e8f0;
  border-bottom-left-radius: 4px;
}

.nexus-msg.user .nexus-msg-bubble {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #0b0f17;
  font-weight: 600;
  border-bottom-right-radius: 4px;
}

.nexus-msg-time {
  font-size: 0.68rem;
  color: #64748b;
  margin-top: 4px;
  padding: 0 4px;
}

.nexus-msg.user .nexus-msg-time {
  text-align: right;
}

/* Bot Message Action Buttons */
.nexus-action-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.nexus-action-btn {
  background: #0d1320;
  border: 1px solid #eab308;
  color: #fde047;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nexus-action-btn:hover {
  background: #eab308;
  color: #0b0f17;
  transform: translateY(-2px);
}

/* Typing Indicator */
.nexus-typing {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #162035;
  border: 1px solid #242f47;
  padding: 12px 16px;
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  width: fit-content;
}

.nexus-typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #eab308;
  animation: typingBounce 1.2s infinite ease-in-out;
}

.nexus-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.nexus-typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1.1); opacity: 1; }
}

/* Quick Question Chips Bar */
.nexus-quick-chips {
  padding: 10px 14px;
  background: #0d1320;
  border-top: 1px solid #242f47;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  white-space: nowrap;
}

.nexus-quick-chips::-webkit-scrollbar {
  height: 4px;
}

.nexus-quick-chips::-webkit-scrollbar-thumb {
  background: #242f47;
  border-radius: 3px;
}

.nexus-chip {
  background: #162035;
  border: 1px solid #3b4b6e;
  color: #cbd5e1;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.nexus-chip:hover {
  border-color: #eab308;
  color: #ffffff;
  background: #1e2b48;
}

/* Footer / Input Area */
.nexus-chat-footer {
  padding: 14px 16px;
  background: #111827;
  border-top: 1px solid #242f47;
}

.nexus-chat-form {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nexus-chat-input {
  flex: 1;
  background: #162035;
  border: 1px solid #3b4b6e;
  border-radius: 12px;
  padding: 11px 14px;
  color: #ffffff;
  font-size: 0.88rem;
  font-family: inherit;
  transition: all 0.2s ease;
}

.nexus-chat-input:focus {
  outline: none;
  border-color: #eab308;
  background: #1b2742;
  box-shadow: 0 0 10px rgba(234, 179, 8, 0.25);
}

.nexus-send-btn {
  background: var(--gold-gradient, linear-gradient(135deg, #f59e0b 0%, #d97706 100%));
  border: none;
  border-radius: 12px;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0b0f17;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nexus-send-btn:hover {
  transform: scale(1.05);
  filter: brightness(1.1);
}

.nexus-send-btn svg {
  width: 18px;
  height: 18px;
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
  #nexus-chat-root {
    bottom: 16px;
    right: 16px;
  }
  .nexus-chat-window {
    width: calc(100vw - 32px);
    height: calc(100vh - 80px);
    bottom: 0;
    right: 0;
  }
  .nexus-chat-teaser {
    width: calc(100vw - 48px);
    right: 0;
  }
}
