/* ─────────────────────────────────────────────────────────────────
   nixo/nixo.css
   OnneTech Solutions — Nixo AI Chatbot Widget
   All classes prefixed with .nixo- to avoid collisions with site CSS
   ───────────────────────────────────────────────────────────────── */

/* ── VARIABLES ── */
.nixo-root {
  --nx-blue: #13a0f1;
  --nx-blue-dark: #0d7bc4;
  --nx-blue-glow: rgba(19, 160, 241, 0.22);
  --nx-blue-light: rgba(19, 160, 241, 0.1);
  --nx-ark: #2e3440;
  --nx-ark-mid: #3b4252;
  --nx-ark-light: #4c566a;
  --nx-ark-pale: #d8dee9;
  --nx-white: #ffffff;
  --nx-off: #f5f7fa;
  --nx-text: #1a1f2e;
  --nx-text-mid: #4a5568;
  --nx-radius: 16px;
  --nx-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
  --nx-t: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: 'DM Sans', 'Segoe UI', sans-serif;
}

/* ── TRIGGER BUBBLE ── */
.nixo-trigger {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9990;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--nx-blue), var(--nx-blue-dark));
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 24px rgba(19, 160, 241, 0.45);
  transition: var(--nx-t);
  outline: none;
}

.nixo-trigger:hover {
  transform: scale(1.08);
  box-shadow: 0 10px 36px rgba(19, 160, 241, 0.55);
}

.nixo-trigger svg {
  width: 26px;
  height: 26px;
  fill: white;
  transition: var(--nx-t);
}

.nixo-trigger.nixo-open svg.nixo-icon-chat { display: none; }
.nixo-trigger:not(.nixo-open) svg.nixo-icon-close { display: none; }

.nixo-trigger-pulse {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: var(--nx-blue);
  opacity: 0;
  animation: nixoPulse 2.5s ease-out infinite;
}

@keyframes nixoPulse {
  0% { transform: scale(1); opacity: 0.4; }
  100% { transform: scale(1.7); opacity: 0; }
}

/* ── UNREAD BADGE ── */
.nixo-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 18px;
  height: 18px;
  background: #ef4444;
  border-radius: 50%;
  border: 2px solid white;
  font-size: 9px;
  font-weight: 700;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Exo 2', sans-serif;
  opacity: 0;
  transform: scale(0);
  transition: var(--nx-t);
}

.nixo-badge.nixo-badge-visible {
  opacity: 1;
  transform: scale(1);
}

/* ── CHAT WINDOW ── */
.nixo-window {
  position: fixed;
  bottom: 100px;
  right: 28px;
  z-index: 9989;
  width: 380px;
  max-height: 580px;
  background: var(--nx-white);
  border-radius: var(--nx-radius);
  box-shadow: var(--nx-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(0.97);
  transform-origin: bottom right;
  transition: var(--nx-t);
  border: 1px solid rgba(19, 160, 241, 0.15);
}

.nixo-window.nixo-window-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* ── HEADER ── */
.nixo-header {
  background: linear-gradient(135deg, var(--nx-ark) 0%, var(--nx-ark-mid) 100%);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.nixo-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(19,160,241,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(19,160,241,0.06) 1px, transparent 1px);
  background-size: 24px 24px;
}

.nixo-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--nx-blue), var(--nx-blue-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Exo 2', sans-serif;
  font-weight: 800;
  font-size: 0.95rem;
  color: white;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  box-shadow: 0 2px 12px rgba(19, 160, 241, 0.4);
}

.nixo-header-info {
  flex: 1;
  position: relative;
  z-index: 1;
}

.nixo-header-name {
  font-family: 'Exo 2', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  color: white;
  display: block;
}

.nixo-header-status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  color: var(--nx-ark-pale);
  margin-top: 2px;
}

.nixo-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  animation: nixoStatusPulse 2s infinite;
}

@keyframes nixoStatusPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.nixo-header-close {
  background: rgba(255,255,255,0.1);
  border: none;
  border-radius: 8px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: white;
  font-size: 1rem;
  transition: var(--nx-t);
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}

.nixo-header-close:hover {
  background: rgba(255,255,255,0.2);
}

/* ── MESSAGES ── */
.nixo-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--nx-off);
  scroll-behavior: smooth;
}

.nixo-messages::-webkit-scrollbar { width: 4px; }
.nixo-messages::-webkit-scrollbar-track { background: transparent; }
.nixo-messages::-webkit-scrollbar-thumb { background: rgba(19,160,241,0.3); border-radius: 2px; }

/* ── MESSAGE BUBBLES ── */
.nixo-msg {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  animation: nixoMsgIn 0.25s ease;
}

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

.nixo-msg-bot { flex-direction: row; }
.nixo-msg-user { flex-direction: row-reverse; }

.nixo-msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--nx-blue), var(--nx-blue-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Exo 2', sans-serif;
  font-weight: 800;
  font-size: 0.6rem;
  color: white;
  flex-shrink: 0;
}

.nixo-msg-bubble {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.875rem;
  line-height: 1.55;
}

.nixo-msg-bot .nixo-msg-bubble {
  background: white;
  color: var(--nx-text);
  border-bottom-left-radius: 4px;
  border: 1px solid rgba(0,0,0,0.06);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.nixo-msg-user .nixo-msg-bubble {
  background: linear-gradient(135deg, var(--nx-blue), var(--nx-blue-dark));
  color: white;
  border-bottom-right-radius: 4px;
}

.nixo-msg-bubble p { margin: 0 0 6px 0; }
.nixo-msg-bubble p:last-child { margin-bottom: 0; }

.nixo-msg-bubble a {
  color: var(--nx-blue);
  text-decoration: underline;
  font-weight: 500;
}

.nixo-msg-user .nixo-msg-bubble a { color: rgba(255,255,255,0.85); }

/* ── QUICK REPLIES ── */
.nixo-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 0 16px 12px;
  background: var(--nx-off);
}

.nixo-qr {
  background: white;
  border: 1.5px solid rgba(19,160,241,0.3);
  border-radius: 100px;
  padding: 6px 14px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--nx-blue);
  cursor: pointer;
  transition: var(--nx-t);
  font-family: 'Exo 2', sans-serif;
  white-space: nowrap;
}

.nixo-qr:hover {
  background: var(--nx-blue);
  color: white;
  border-color: var(--nx-blue);
  transform: translateY(-1px);
}

/* ── TYPING INDICATOR ── */
.nixo-typing {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.nixo-typing-bubble {
  background: white;
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  padding: 12px 16px;
  display: flex;
  gap: 4px;
  align-items: center;
  border: 1px solid rgba(0,0,0,0.06);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.nixo-typing-dot {
  width: 7px;
  height: 7px;
  background: var(--nx-blue);
  border-radius: 50%;
  animation: nixoTyping 1.2s infinite;
}

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

@keyframes nixoTyping {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-5px); opacity: 1; }
}

/* ── PRICING CARD ── */
.nixo-price-card {
  background: var(--nx-off);
  border: 1px solid rgba(19,160,241,0.2);
  border-radius: 10px;
  padding: 10px 12px;
  margin-top: 6px;
}

.nixo-price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  font-size: 0.8rem;
}

.nixo-price-row:last-child { border-bottom: none; }
.nixo-price-name { color: var(--nx-text-mid); }
.nixo-price-val { font-weight: 700; color: var(--nx-blue); font-family: 'Exo 2', sans-serif; }

/* ── INPUT AREA ── */
.nixo-input-area {
  padding: 12px 14px;
  background: white;
  border-top: 1px solid rgba(0,0,0,0.07);
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-shrink: 0;
}

.nixo-input {
  flex: 1;
  border: 1.5px solid rgba(19,160,241,0.2);
  border-radius: 10px;
  padding: 9px 13px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  color: var(--nx-text);
  background: var(--nx-off);
  outline: none;
  resize: none;
  max-height: 100px;
  line-height: 1.4;
  transition: var(--nx-t);
}

.nixo-input:focus {
  border-color: var(--nx-blue);
  background: white;
  box-shadow: 0 0 0 3px var(--nx-blue-glow);
}

.nixo-input::placeholder { color: #a0aec0; }

.nixo-send {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--nx-blue), var(--nx-blue-dark));
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--nx-t);
  box-shadow: 0 2px 10px rgba(19,160,241,0.3);
}

.nixo-send:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(19,160,241,0.4);
}

.nixo-send:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.nixo-send svg {
  width: 16px;
  height: 16px;
  fill: white;
}

/* ── FOOTER BRANDING ── */
.nixo-footer {
  padding: 7px 14px;
  background: white;
  border-top: 1px solid rgba(0,0,0,0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex-shrink: 0;
}

.nixo-footer span {
  font-size: 0.68rem;
  color: #a0aec0;
  font-family: 'Exo 2', sans-serif;
}

.nixo-footer strong {
  font-size: 0.68rem;
  color: var(--nx-blue);
  font-family: 'Exo 2', sans-serif;
}

/* ── ERROR STATE ── */
.nixo-error-bubble {
  background: #fff5f5;
  border: 1px solid #fed7d7;
  color: #c53030;
  font-size: 0.82rem;
  padding: 8px 12px;
  border-radius: 10px;
  max-width: 78%;
}

/* ── MOBILE ── */
@media (max-width: 480px) {
  .nixo-window {
    width: calc(100vw - 24px);
    right: 12px;
    bottom: 90px;
    max-height: 70vh;
  }

  .nixo-trigger {
    right: 16px;
    bottom: 20px;
  }
}
