/* ============================================================
   NOVA VISION MEDIATECH — Chatbot Widget Styles
   File: assets/css/chatbot.css
   ============================================================ */

/* ── Variables ── */
:root {
  --cb-primary:     #7c3aed;   /* Nova Vision purple */
  --cb-primary-dk:  #5b21b6;
  --cb-accent:      #a78bfa;
  --cb-bg:          #0f0f1a;   /* dark panel bg */
  --cb-surface:     #1a1a2e;
  --cb-surface2:    #252540;
  --cb-text:        #e2e8f0;
  --cb-text-muted:  #94a3b8;
  --cb-white:       #ffffff;
  --cb-green:       #22c55e;
  --cb-radius:      16px;
  --cb-radius-sm:   10px;
  --cb-shadow:      0 20px 60px rgba(124,58,237,.35), 0 4px 20px rgba(0,0,0,.5);
  --cb-font:        'Inter', 'Segoe UI', sans-serif;
  --cb-width:       360px;
  --cb-height:      540px;
  --cb-z:           99999;
}

/* ── Launcher button ── */
#nv-chat-launcher {
  position: fixed;
  bottom: 90px;
  right: 28px;
  z-index: var(--cb-z);
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cb-primary), var(--cb-primary-dk));
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(124,58,237,.55);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .25s cubic-bezier(.34,1.56,.64,1), box-shadow .25s;
  outline: none;
}
#nv-chat-launcher:hover {
  transform: scale(1.12);
  box-shadow: 0 10px 32px rgba(124,58,237,.7);
}
#nv-chat-launcher svg { width: 28px; height: 28px; fill: #fff; transition: opacity .2s; }
#nv-chat-launcher .nv-icon-close { display: none; }

#nv-chat-launcher.is-open .nv-icon-chat  { display: none; }
#nv-chat-launcher.is-open .nv-icon-close { display: block; }

/* Notification dot */
#nv-chat-launcher .nv-badge {
  position: absolute;
  top: 2px; right: 2px;
  width: 14px; height: 14px;
  background: #ef4444;
  border-radius: 50%;
  border: 2px solid #fff;
  animation: nv-pulse 2s infinite;
  display: none;
}
#nv-chat-launcher.has-notif .nv-badge { display: block; }

@keyframes nv-pulse {
  0%,100% { transform: scale(1); }
  50%      { transform: scale(1.3); }
}

/* ── Chat window ── */
#nv-chatbot {
  position: fixed;
  bottom: 100px;
  right: 28px;
  z-index: var(--cb-z);
  width: var(--cb-width);
  max-height: var(--cb-height);
  display: flex;
  flex-direction: column;
  background: var(--cb-bg);
  border-radius: var(--cb-radius);
  box-shadow: var(--cb-shadow);
  font-family: var(--cb-font);
  font-size: 14px;
  color: var(--cb-text);
  overflow: hidden;
  border: 1px solid rgba(124,58,237,.25);
  /* hidden by default */
  opacity: 0;
  transform: translateY(20px) scale(.96);
  pointer-events: none;
  transition: opacity .3s ease, transform .3s cubic-bezier(.34,1.56,.64,1);
}
#nv-chatbot.is-open {
  opacity: 1;
  transform: none;
  pointer-events: all;
}

/* ── Header ── */
.nv-cb-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(135deg, var(--cb-primary-dk), var(--cb-primary));
  flex-shrink: 0;
}
.nv-cb-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.nv-cb-header-info { flex: 1; min-width: 0; }
.nv-cb-header-info h4 {
  margin: 0; font-size: 15px; font-weight: 600; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nv-cb-header-info small {
  font-size: 11px; color: rgba(255,255,255,.75);
  display: flex; align-items: center; gap: 4px;
}
.nv-cb-online-dot {
  width: 7px; height: 7px;
  background: var(--cb-green);
  border-radius: 50%;
  display: inline-block;
}

/* ── Messages area ── */
.nv-cb-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(124,58,237,.4) transparent;
}
.nv-cb-messages::-webkit-scrollbar { width: 4px; }
.nv-cb-messages::-webkit-scrollbar-thumb {
  background: rgba(124,58,237,.4);
  border-radius: 4px;
}

/* ── Bubbles ── */
.nv-msg {
  display: flex;
  flex-direction: column;
  max-width: 85%;
  animation: nv-pop .2s ease;
}
@keyframes nv-pop {
  from { opacity:0; transform: translateY(6px); }
  to   { opacity:1; transform: none; }
}
.nv-msg.bot  { align-self: flex-start; }
.nv-msg.user { align-self: flex-end; }

.nv-bubble {
  padding: 10px 14px;
  border-radius: 18px;
  line-height: 1.5;
  word-break: break-word;
}
.nv-msg.bot  .nv-bubble {
  background: var(--cb-surface2);
  border-bottom-left-radius: 4px;
  color: var(--cb-text);
}
.nv-msg.user .nv-bubble {
  background: linear-gradient(135deg, var(--cb-primary), var(--cb-primary-dk));
  border-bottom-right-radius: 4px;
  color: #fff;
}
.nv-msg-time {
  font-size: 10px;
  color: var(--cb-text-muted);
  margin-top: 3px;
  padding: 0 4px;
}
.nv-msg.user .nv-msg-time { text-align: right; }

/* ── Typing indicator ── */
.nv-typing .nv-bubble {
  display: flex; gap: 4px; padding: 12px 16px;
}
.nv-typing .nv-bubble span {
  width: 7px; height: 7px;
  background: var(--cb-accent);
  border-radius: 50%;
  animation: nv-bounce .9s infinite;
}
.nv-typing .nv-bubble span:nth-child(2) { animation-delay: .15s; }
.nv-typing .nv-bubble span:nth-child(3) { animation-delay: .30s; }
@keyframes nv-bounce {
  0%,60%,100% { transform: translateY(0); }
  30%          { transform: translateY(-7px); }
}

/* ── Quick-reply chips / service buttons ── */
.nv-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
  padding: 0 14px 8px;
}
.nv-chip {
  background: var(--cb-surface2);
  border: 1px solid rgba(124,58,237,.4);
  color: var(--cb-accent);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: background .2s, border-color .2s, color .2s;
  font-family: var(--cb-font);
}
.nv-chip:hover {
  background: var(--cb-primary);
  border-color: var(--cb-primary);
  color: #fff;
}
.nv-chip.service {
  display: flex; align-items: center; gap: 6px;
  text-align: left;
  border-radius: var(--cb-radius-sm);
  width: 100%;
  padding: 9px 14px;
  font-size: 13px;
}
.nv-chip.service .nv-svc-icon { font-size: 18px; flex-shrink:0; }
.nv-chip.service .nv-svc-title { font-weight: 500; }

/* ── Lead form ── */
.nv-lead-form {
  padding: 12px 14px;
  background: var(--cb-surface);
  border-top: 1px solid rgba(255,255,255,.07);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.nv-lead-form label {
  font-size: 11px;
  color: var(--cb-text-muted);
  margin-bottom: 2px;
  display: block;
}
.nv-lead-form input {
  width: 100%;
  background: var(--cb-surface2);
  border: 1px solid rgba(124,58,237,.3);
  border-radius: var(--cb-radius-sm);
  padding: 9px 12px;
  color: var(--cb-text);
  font-size: 13px;
  font-family: var(--cb-font);
  outline: none;
  transition: border-color .2s;
  box-sizing: border-box;
}
.nv-lead-form input::placeholder { color: var(--cb-text-muted); }
.nv-lead-form input:focus { border-color: var(--cb-primary); }
.nv-lead-form .nv-error {
  color: #f87171;
  font-size: 11px;
  margin-top: -4px;
}
.nv-btn-submit {
  width: 100%;
  padding: 11px;
  background: linear-gradient(135deg, var(--cb-primary), var(--cb-primary-dk));
  color: #fff;
  border: none;
  border-radius: var(--cb-radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--cb-font);
  transition: opacity .2s;
  margin-top: 2px;
}
.nv-btn-submit:hover { opacity: .88; }
.nv-btn-submit:disabled { opacity: .55; cursor: default; }

/* ── WhatsApp CTA ── */
.nv-wa-cta {
  padding: 14px;
  background: var(--cb-surface);
  border-top: 1px solid rgba(255,255,255,.07);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.nv-wa-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px;
  background: #25d366;
  color: #fff;
  border-radius: var(--cb-radius-sm);
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
  font-family: var(--cb-font);
  transition: background .2s, transform .15s;
}
.nv-wa-btn:hover { background: #1ebe5a; transform: translateY(-1px); }
.nv-wa-btn svg   { width: 22px; height: 22px; fill: #fff; flex-shrink: 0; }
.nv-wa-note {
  font-size: 11px;
  color: var(--cb-text-muted);
  text-align: center;
  line-height: 1.4;
}

/* ── Input bar at bottom ── */
.nv-cb-input-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--cb-surface);
  border-top: 1px solid rgba(255,255,255,.07);
  flex-shrink: 0;
}
.nv-cb-input-bar input {
  flex: 1;
  background: var(--cb-surface2);
  border: 1px solid rgba(124,58,237,.3);
  border-radius: 24px;
  padding: 9px 16px;
  color: var(--cb-text);
  font-size: 13px;
  font-family: var(--cb-font);
  outline: none;
}
.nv-cb-input-bar input::placeholder { color: var(--cb-text-muted); }
.nv-cb-input-bar input:focus { border-color: var(--cb-primary); }
.nv-cb-send {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--cb-primary);
  border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background .2s;
}
.nv-cb-send:hover { background: var(--cb-primary-dk); }
.nv-cb-send svg { width: 18px; height: 18px; fill: #fff; }

/* ── Powered-by footer ── */
.nv-cb-footer {
  text-align: center;
  padding: 6px;
  font-size: 10px;
  color: var(--cb-text-muted);
  background: var(--cb-bg);
  flex-shrink: 0;
}
.nv-cb-footer a { color: var(--cb-accent); text-decoration: none; }

/* ── Mobile adjustments ── */
@media (max-width: 420px) {
  :root {
    --cb-width: calc(100vw - 32px);
    --cb-height: 85vh;
  }
  #nv-chatbot  { right: 16px; bottom: 90px; }
  #nv-chat-launcher { right: 10px; bottom: 90px; }
}
