/*--------------------------------------------------------------
# Nucleotech Chatbot Widget
--------------------------------------------------------------*/
:root {
  --nt-chat-navy: #253a57;
  --nt-chat-navy-dark: #192942;
  --nt-chat-amber: #ffc451;
  --nt-chat-amber-hover: #ffcd6b;
  --nt-chat-text: #151515;
  --nt-chat-text-dim: #6f6f6f;
  --nt-chat-bg: #f5f7fa;
  --nt-chat-border: #ececec;
}

#nt-chat-toggle {
  position: fixed;
  right: 22px;
  bottom: 90px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  background: var(--nt-chat-amber);
  color: var(--nt-chat-text);
  box-shadow: 0 8px 24px rgba(21, 21, 21, 0.25);
  cursor: pointer;
  z-index: 99998;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s ease, background 0.25s ease;
}

#nt-chat-toggle:hover {
  background: var(--nt-chat-amber-hover);
  transform: scale(1.06);
}

#nt-chat-toggle i {
  font-size: 28px;
  line-height: 1;
  position: absolute;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

#nt-chat-toggle .bx-x {
  opacity: 0;
  transform: rotate(-90deg) scale(0.6);
}

#nt-chat-toggle .bx-chat {
  opacity: 1;
  transform: rotate(0) scale(1);
}

#nt-chat-toggle.open .bx-x {
  opacity: 1;
  transform: rotate(0) scale(1);
}

#nt-chat-toggle.open .bx-chat {
  opacity: 0;
  transform: rotate(90deg) scale(0.6);
}

#nt-chat-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ff6b6b;
  border: 2px solid #fff;
}

#nt-chat-window {
  position: fixed;
  right: 22px;
  bottom: 162px;
  width: 360px;
  max-width: calc(100vw - 32px);
  height: 520px;
  max-height: calc(100vh - 198px);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 50px -12px rgba(21, 21, 21, 0.35);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  z-index: 99997;
  font-family: "Open Sans", sans-serif;
  transform-origin: bottom right;
  transform: scale(0.9) translateY(12px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.25s ease, opacity 0.25s ease, visibility 0.25s;
}

#nt-chat-window.open {
  transform: scale(1) translateY(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

#nt-chat-header {
  background: linear-gradient(135deg, var(--nt-chat-navy) 0%, var(--nt-chat-navy-dark) 100%);
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

#nt-chat-header .nt-chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--nt-chat-amber);
  color: var(--nt-chat-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex: none;
}

#nt-chat-header .nt-chat-title {
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.3;
}

#nt-chat-header .nt-chat-status {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.75);
  display: flex;
  align-items: center;
  gap: 5px;
}

#nt-chat-header .nt-chat-status .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  display: inline-block;
}

#nt-chat-close {
  margin-left: auto;
  background: none;
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  opacity: 0.8;
  line-height: 1;
  padding: 4px;
}

#nt-chat-close:hover {
  opacity: 1;
}

#nt-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  background: var(--nt-chat-bg);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nt-msg-row {
  display: flex;
  flex-direction: column;
  max-width: 82%;
}

.nt-msg-row.bot {
  align-self: flex-start;
  align-items: flex-start;
}

.nt-msg-row.user {
  align-self: flex-end;
  align-items: flex-end;
}

.nt-msg-bubble {
  padding: 10px 13px;
  border-radius: 15px;
  font-size: 13.5px;
  line-height: 1.5;
  word-wrap: break-word;
}

.nt-msg-row.bot .nt-msg-bubble {
  background: #fff;
  border: 1px solid var(--nt-chat-border);
  color: var(--nt-chat-text);
  border-bottom-left-radius: 4px;
}

.nt-msg-row.user .nt-msg-bubble {
  background: var(--nt-chat-amber);
  color: var(--nt-chat-text);
  border-bottom-right-radius: 4px;
}

.nt-msg-bubble a {
  color: inherit;
  text-decoration: underline;
  font-weight: 600;
}

.nt-msg-time {
  font-size: 10px;
  color: var(--nt-chat-text-dim);
  margin-top: 3px;
  padding: 0 4px;
}

.nt-chat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
  align-self: flex-start;
  max-width: 100%;
}

.nt-chat-chip {
  background: #fff;
  border: 1px solid var(--nt-chat-amber);
  color: var(--nt-chat-text);
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.nt-chat-chip:hover {
  background: var(--nt-chat-amber);
}

.nt-typing .nt-msg-bubble {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 14px;
}

.nt-typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #9aa1ab;
  animation: nt-typing-bounce 1.2s infinite ease-in-out;
}

.nt-typing-dot:nth-child(2) { animation-delay: 0.15s; }
.nt-typing-dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes nt-typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

#nt-chat-form {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--nt-chat-border);
  background: #fff;
}

#nt-chat-input {
  flex: 1;
  border: 1px solid var(--nt-chat-border);
  border-radius: 22px;
  padding: 10px 16px;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--nt-chat-text);
  outline: none;
  transition: border-color 0.2s ease;
}

#nt-chat-input:focus {
  border-color: var(--nt-chat-amber);
}

#nt-chat-send {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--nt-chat-amber);
  color: var(--nt-chat-text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 17px;
  transition: background 0.2s ease, opacity 0.2s ease;
}

#nt-chat-send:hover {
  background: var(--nt-chat-amber-hover);
}

#nt-chat-send:disabled {
  opacity: 0.4;
  cursor: default;
  background: var(--nt-chat-amber);
}

#nt-chat-messages::-webkit-scrollbar {
  width: 6px;
}

#nt-chat-messages::-webkit-scrollbar-thumb {
  background: #d8dce2;
  border-radius: 3px;
}

@media (max-width: 480px) {
  #nt-chat-window {
    right: 16px;
    left: 16px;
    width: auto;
    bottom: 158px;
  }
  #nt-chat-toggle {
    right: 16px;
    bottom: 86px;
  }
}
