/* Numeric Partner — Assistant chatbot custom */

.np-chatbot {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9998;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
}

.np-chatbot-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: 9999px;
  background: linear-gradient(135deg, #0d8bcd 0%, #0ea5e9 100%);
  color: #fff;
  font-weight: 700;
  font-size: 0.875rem;
  border: none;
  cursor: pointer;
  box-shadow: 0 10px 25px -5px rgba(13, 139, 205, 0.4), 0 8px 10px -6px rgba(13, 139, 205, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}
.np-chatbot-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 30px -5px rgba(13, 139, 205, 0.5);
}
.np-chatbot-button.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.85);
}

.np-chatbot-panel {
  position: absolute;
  bottom: 0;
  right: 0;
  width: min(380px, calc(100vw - 3rem));
  height: min(580px, calc(100vh - 3rem));
  background: #fff;
  border-radius: 1.25rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform-origin: bottom right;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.np-chatbot-panel.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.85) translateY(20px);
}

.np-chatbot-header {
  background: linear-gradient(135deg, #0d8bcd 0%, #0ea5e9 100%);
  color: #fff;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.np-chatbot-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.np-chatbot-header-info {
  flex: 1;
  min-width: 0;
}
.np-chatbot-header-title {
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.2;
}
.np-chatbot-header-subtitle {
  font-size: 0.75rem;
  opacity: 0.9;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  margin-top: 0.125rem;
}
.np-chatbot-header-subtitle::before {
  content: '';
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  background: #4ade80;
  display: inline-block;
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.3);
}
.np-chatbot-close {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s ease;
}
.np-chatbot-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.np-chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.np-chatbot-msg {
  max-width: 85%;
  padding: 0.625rem 0.875rem;
  border-radius: 1rem;
  font-size: 0.875rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
  animation: np-msg-in 0.25s ease both;
}
@keyframes np-msg-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.np-chatbot-msg.bot {
  background: #fff;
  color: #0f172a;
  border-bottom-left-radius: 0.25rem;
  align-self: flex-start;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
.np-chatbot-msg.user {
  background: #0d8bcd;
  color: #fff;
  border-bottom-right-radius: 0.25rem;
  align-self: flex-end;
}

.np-chatbot-quickreplies {
  padding: 0.75rem 1rem 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  background: #fff;
  border-top: 1px solid #e2e8f0;
  max-height: 45%;
  overflow-y: auto;
}

.np-chatbot-qr {
  background: #fff;
  border: 1px solid #cbd5e1;
  color: #0d8bcd;
  padding: 0.5rem 0.875rem;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}
.np-chatbot-qr:hover {
  background: #0d8bcd;
  color: #fff;
  border-color: #0d8bcd;
  transform: translateY(-1px);
}
.np-chatbot-qr.primary {
  background: #0d8bcd;
  color: #fff;
  border-color: #0d8bcd;
}
.np-chatbot-qr.primary:hover {
  background: #0a6ea3;
  border-color: #0a6ea3;
}

@media (max-width: 480px) {
  .np-chatbot {
    bottom: 5rem;
    right: 1rem;
  }
  .np-chatbot-button span {
    display: none;
  }
  .np-chatbot-button {
    padding: 0.875rem;
  }
  .np-chatbot-panel {
    bottom: 4rem;
    right: 0;
    width: calc(100vw - 2rem);
    height: calc(100vh - 10rem);
    max-height: 600px;
  }
}
