/**
 * Varuna Sentinels BV - AI Chatbot v1.0
 * Theme: #335596 (navy), #74c5b5 (teal), Poppins
 */

/* Launcher wrapper holds tooltip + toggle for hover grouping */
.vs-chat-launcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9998;
  display: flex;
  align-items: center;
}

/* Hover tooltip beside the launcher */
.vs-chat-tooltip {
  position: absolute;
  right: 72px;
  bottom: 4px;
  background: #fff;
  color: #335596;
  border-radius: 14px;
  padding: 10px 16px;
  min-width: 180px;
  box-shadow: 0 8px 28px rgba(51,85,150,0.22), 0 2px 8px rgba(0,0,0,0.08);
  border: 1px solid rgba(116,197,181,0.35);
  opacity: 0;
  visibility: hidden;
  transform: translateX(8px);
  transition: opacity 0.28s ease, transform 0.28s ease, visibility 0s linear 0.28s;
  font-family: 'Poppins', sans-serif;
  pointer-events: none;
}
.vs-chat-tooltip::after {
  content: '';
  position: absolute;
  right: -7px;
  bottom: 16px;
  width: 0; height: 0;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 7px solid #fff;
  filter: drop-shadow(1px 0 0 rgba(116,197,181,0.35));
}
.vs-chat-tooltip-greet {
  font-size: 0.92rem;
  font-weight: 700;
  color: #335596;
  line-height: 1.2;
}
.vs-chat-tooltip-sub {
  font-size: 0.72rem;
  color: #74c5b5;
  margin-top: 2px;
  font-weight: 500;
  letter-spacing: 0.2px;
}
.vs-chat-launcher:hover .vs-chat-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
  transition-delay: 0s;
}
.vs-chat-launcher.open .vs-chat-tooltip {
  opacity: 0 !important;
  visibility: hidden !important;
}

/* Toggle button */
.vs-chat-toggle {
  position: relative;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1d3461, #335596);
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 25px rgba(29,52,97,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}
.vs-chat-toggle:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 30px rgba(29,52,97,0.5);
}
.vs-chat-toggle.active { transform: rotate(90deg) scale(1.05); }
/* White inner circle behind the hand logo */
.vs-chat-toggle::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #fff;
  transform: translate(-50%, -50%);
  z-index: 0;
}
.vs-chat-toggle.active::before { display: none; }
.vs-chat-toggle img {
  position: relative;
  z-index: 1;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: contain;
  filter: brightness(0) saturate(100%) invert(16%) sepia(34%) saturate(900%) hue-rotate(186deg) brightness(92%) contrast(95%);
}
.vs-chat-toggle .vs-chat-close-icon {
  display: none;
  font-size: 24px;
  color: #fff;
  font-weight: 600;
}
.vs-chat-toggle.active img { display: none; }
.vs-chat-toggle.active .vs-chat-close-icon { display: block; }

/* Notification dot */
.vs-chat-toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  background: #e74c3c;
  border-radius: 50%;
  border: 2px solid #fff;
  animation: vs-chat-pulse 2s infinite;
}
.vs-chat-toggle.active::after { display: none; }
@keyframes vs-chat-pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.2); } }

/* Chat window */
.vs-chat-window {
  position: fixed;
  bottom: 96px;
  right: 24px;
  width: 380px;
  max-height: 580px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 15px 60px rgba(0,0,0,0.25);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.95);
  transition: all 0.35s cubic-bezier(0.25,0.46,0.45,0.94);
  font-family: 'Poppins', sans-serif;
}
.vs-chat-window.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Collapsed state */
.vs-chat-window.vs-chat-collapsed {
  max-height: 60px !important;
  overflow: hidden;
}

/* Collapse / Expand buttons */
.vs-chat-collapse-btn,
.vs-chat-expand-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: rgba(255,255,255,0.15);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  transition: background 0.25s;
  flex-shrink: 0;
  margin-left: 6px;
}
.vs-chat-collapse-btn:hover,
.vs-chat-expand-btn:hover {
  background: rgba(255,255,255,0.3);
}

/* Support message — single compact line under the header title */
.vs-chat-support-msg {
  margin-top: 12px;
  padding: 9px 12px;
  background: rgba(255,255,255,0.12);
  border-radius: 10px;
  font-size: 0.78rem;
  line-height: 1.5;
  border-left: 3px solid #74c5b5;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #eaf1fb;
}
.vs-chat-support-msg i {
  color: #74c5b5;
  font-size: 0.9rem;
  flex-shrink: 0;
}
.vs-chat-support-msg strong { color: #fff; font-weight: 600; }

/* Header — unique VS Sentinel branding */
.vs-chat-header {
  background:
    radial-gradient(circle at 12% 18%, rgba(116,197,181,0.35), transparent 55%),
    radial-gradient(circle at 88% 82%, rgba(116,197,181,0.18), transparent 60%),
    linear-gradient(135deg, #335596 0%, #1d3461 100%);
  color: #fff;
  padding: 16px 18px;
  border-bottom: 3px solid #74c5b5;
  position: relative;
}
.vs-chat-header-top {
  display: flex;
  align-items: center;
  gap: 12px;
}
.vs-chat-header-logo {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #fff;
  padding: 3px;
  object-fit: contain;
  box-shadow: 0 3px 10px rgba(0,0,0,0.2);
  flex-shrink: 0;
}
.vs-chat-header-titles {
  flex: 1;
  min-width: 0;
}
.vs-chat-header-name {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  line-height: 1.25;
  display: flex;
  align-items: center;
  gap: 5px;
}
.vs-chat-header-name .vs-chat-verified {
  color: #74c5b5;
  font-size: 0.75rem;
}
.vs-chat-header-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  opacity: 0.9;
  margin-top: 2px;
  font-weight: 500;
}
.vs-chat-status-dot {
  width: 8px;
  height: 8px;
  background: #4ade80;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(74,222,128,0.7);
  animation: vs-chat-ping 2s infinite;
  flex-shrink: 0;
}
@keyframes vs-chat-ping {
  0% { box-shadow: 0 0 0 0 rgba(74,222,128,0.7); }
  70% { box-shadow: 0 0 0 8px rgba(74,222,128,0); }
  100% { box-shadow: 0 0 0 0 rgba(74,222,128,0); }
}

/* Tabs */
.vs-chat-tabs {
  display: flex;
  background: #fff;
  border-bottom: 1px solid #e8eef5;
}
.vs-chat-tab-btn {
  flex: 1;
  padding: 10px 4px;
  border: none;
  background: transparent;
  font-size: 0.72rem;
  font-weight: 600;
  color: #999;
  cursor: pointer;
  font-family: 'Poppins', sans-serif;
  transition: all 0.25s;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 0;
}
.vs-chat-tab-btn i { font-size: 0.95rem; }
.vs-chat-tab-btn span {
  font-size: 0.68rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.vs-chat-tab-btn.active { color: #335596; }
.vs-chat-tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 20%;
  width: 60%;
  height: 2px;
  background: #74c5b5;
  border-radius: 2px;
}
.vs-chat-tab-btn:hover { color: #335596; }

/* Tab content */
.vs-chat-tab-pane { display: none; }
.vs-chat-tab-pane.active { display: flex; flex-direction: column; }

/* Welcome tab */
.vs-chat-welcome {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  background: #f8f9fa;
  max-height: 380px;
}
.vs-chat-quick-q {
  background: #fff;
  border: 1px solid #e8eef5;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.25s;
  display: flex;
  align-items: center;
  gap: 10px;
}
.vs-chat-quick-q:hover {
  border-color: #74c5b5;
  box-shadow: 0 3px 12px rgba(116,197,181,0.15);
  transform: translateY(-1px);
}
.vs-chat-quick-q i {
  color: #74c5b5;
  font-size: 1rem;
  flex-shrink: 0;
}
.vs-chat-quick-q strong {
  display: block;
  font-size: 0.82rem;
  color: #335596;
  margin-bottom: 2px;
}
.vs-chat-quick-q span {
  font-size: 0.72rem;
  color: #888;
  line-height: 1.3;
}
.vs-chat-section-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 12px 0 6px;
  padding-left: 2px;
}
.vs-chat-section-label:first-child { margin-top: 0; }

/* Chat messages */
.vs-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  background: #f8f9fa;
  max-height: 340px;
  min-height: 200px;
}
.vs-chat-msg {
  margin-bottom: 12px;
  display: flex;
  gap: 8px;
  animation: vs-chat-fadeIn 0.3s ease;
}
@keyframes vs-chat-fadeIn { from { opacity:0; transform: translateY(8px); } to { opacity:1; transform:none; } }

.vs-chat-msg.user { flex-direction: row-reverse; }
.vs-chat-msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: contain;
}
.vs-chat-msg.user .vs-chat-msg-avatar {
  background: #335596;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
}
.vs-chat-msg-bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.85rem;
  line-height: 1.55;
  word-wrap: break-word;
}
.vs-chat-msg.bot .vs-chat-msg-bubble {
  background: #fff;
  color: #333;
  border: 1px solid #e8eef5;
  border-top-left-radius: 4px;
}
.vs-chat-msg.user .vs-chat-msg-bubble {
  background: linear-gradient(135deg, #335596, #2a4578);
  color: #fff;
  border-top-right-radius: 4px;
}
.vs-chat-msg-time {
  font-size: 0.62rem;
  color: #bbb;
  margin-top: 3px;
  display: block;
}
.vs-chat-msg.user .vs-chat-msg-time { text-align: right; }

/* Typing indicator */
.vs-chat-typing {
  display: flex;
  gap: 4px;
  padding: 10px 14px;
  align-items: center;
}
.vs-chat-typing-dot {
  width: 7px;
  height: 7px;
  background: #74c5b5;
  border-radius: 50%;
  animation: vs-chat-bounce 1.4s infinite ease-in-out;
}
.vs-chat-typing-dot:nth-child(1) { animation-delay: 0s; }
.vs-chat-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.vs-chat-typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes vs-chat-bounce { 0%,80%,100% { transform: scale(0); } 40% { transform: scale(1); } }

/* Input area */
.vs-chat-input {
  display: flex;
  padding: 12px 14px;
  background: #fff;
  border-top: 1px solid #e8eef5;
  gap: 8px;
  align-items: center;
}
.vs-chat-input input {
  flex: 1;
  border: 1.5px solid #dde3ed;
  border-radius: 20px;
  padding: 9px 16px;
  font-size: 0.85rem;
  font-family: 'Poppins', sans-serif;
  outline: none;
  transition: border-color 0.25s;
  color: #333;
}
.vs-chat-input input:focus { border-color: #74c5b5; }
.vs-chat-input input::placeholder { color: #aaa; }
.vs-chat-input button {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #335596, #74c5b5);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s;
  flex-shrink: 0;
  font-size: 0.9rem;
}
.vs-chat-input button:hover { transform: scale(1.08); box-shadow: 0 4px 12px rgba(51,85,150,0.3); }
.vs-chat-input button:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* Solutions tab */
.vs-chat-solutions {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  background: #f8f9fa;
  max-height: 380px;
}
.vs-chat-sol-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #fff;
  border: 1px solid #e8eef5;
  border-radius: 10px;
  margin-bottom: 8px;
  text-decoration: none;
  color: #335596;
  transition: all 0.25s;
}
.vs-chat-sol-card:hover {
  border-color: #74c5b5;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(116,197,181,0.15);
  text-decoration: none;
  color: #335596;
}
.vs-chat-sol-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(116,197,181,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: #74c5b5;
  flex-shrink: 0;
  transition: all 0.25s;
}
.vs-chat-sol-card:hover .vs-chat-sol-icon {
  background: linear-gradient(135deg, #335596, #74c5b5);
  color: #fff;
}
.vs-chat-sol-info strong { font-size: 0.82rem; display: block; margin-bottom: 2px; }
.vs-chat-sol-info span { font-size: 0.7rem; color: #888; line-height: 1.3; }

/* Contact tab */
.vs-chat-contact {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  background: #f8f9fa;
  max-height: 380px;
}
.vs-chat-contact-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: #fff;
  border: 1px solid #e8eef5;
  border-radius: 10px;
  margin-bottom: 8px;
  text-decoration: none;
  color: #335596;
  transition: all 0.25s;
}
.vs-chat-contact-item:hover {
  border-color: #74c5b5;
  box-shadow: 0 3px 12px rgba(116,197,181,0.15);
  text-decoration: none;
  color: #335596;
}
.vs-chat-contact-item i { font-size: 1.1rem; color: #74c5b5; width: 20px; text-align: center; }
.vs-chat-contact-item strong { font-size: 0.82rem; }
.vs-chat-contact-item span { font-size: 0.72rem; color: #888; }

/* Powered by */
.vs-chat-powered {
  text-align: center;
  padding: 6px;
  background: #fff;
  font-size: 0.62rem;
  color: #ccc;
  border-top: 1px solid #f0f0f0;
}

/* ---------- Feedback tab ---------- */
.vs-chat-feedback {
  flex: 1;
  overflow-y: auto;
  padding: 14px 14px 16px;
  background: #f8f9fa;
  max-height: 380px;
}
.vs-chat-fb-intro {
  font-size: 0.76rem;
  color: #666;
  margin: 0 0 10px;
  line-height: 1.45;
}
.vs-chat-stars {
  display: flex;
  gap: 6px;
  justify-content: center;
  padding: 6px 0 2px;
}
.vs-chat-star {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1.6rem;
  color: #dde3ed;
  padding: 4px;
  transition: transform 0.15s ease, color 0.2s ease;
  line-height: 1;
}
.vs-chat-star:hover { transform: scale(1.12); }
.vs-chat-star.active {
  color: #f5b301;
  text-shadow: 0 2px 6px rgba(245,179,1,0.3);
}
.vs-chat-star-label {
  text-align: center;
  font-size: 0.72rem;
  color: #74c5b5;
  font-weight: 600;
  margin-bottom: 8px;
  min-height: 1em;
  letter-spacing: 0.3px;
}
.vs-chat-fb-field {
  width: 100%;
  display: block;
  border: 1.5px solid #dde3ed;
  border-radius: 10px;
  padding: 9px 12px;
  margin-bottom: 8px;
  font-size: 0.8rem;
  font-family: 'Poppins', sans-serif;
  color: #333;
  background: #fff;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}
.vs-chat-fb-field:focus { border-color: #74c5b5; }
textarea.vs-chat-fb-field { resize: vertical; min-height: 80px; line-height: 1.45; }
select.vs-chat-fb-field {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' stroke='%23335596' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
.vs-chat-fb-submit {
  width: 100%;
  border: none;
  background: linear-gradient(135deg, #335596, #74c5b5);
  color: #fff;
  font-weight: 600;
  font-family: 'Poppins', sans-serif;
  font-size: 0.85rem;
  padding: 11px 16px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.25s;
  box-shadow: 0 4px 14px rgba(51,85,150,0.25);
}
.vs-chat-fb-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(51,85,150,0.35);
}
.vs-chat-fb-submit:disabled { opacity: 0.6; cursor: not-allowed; }
.vs-chat-fb-ok {
  margin-top: 10px;
  padding: 10px 12px;
  background: rgba(116,197,181,0.15);
  border: 1px solid rgba(116,197,181,0.45);
  color: #1d3461;
  border-radius: 10px;
  font-size: 0.78rem;
  font-weight: 500;
  display: none;
  align-items: center;
  gap: 8px;
}
.vs-chat-fb-ok i { color: #2bb673; font-size: 1rem; }
.vs-chat-fb-ok.show {
  display: flex;
  animation: vs-chat-fadeIn 0.35s ease;
}

/* ---------- Mobile responsive ---------- */
@media (max-width: 480px) {
  .vs-chat-window {
    width: calc(100vw - 16px);
    right: 8px;
    bottom: 80px;
    max-height: 78vh;
    border-radius: 14px;
  }
  .vs-chat-launcher { bottom: 16px; right: 16px; }
  .vs-chat-toggle { width: 52px; height: 52px; }
  .vs-chat-toggle::before { width: 43px; height: 43px; }
  .vs-chat-toggle img { width: 27px; height: 27px; }
  .vs-chat-tooltip { right: 66px; min-width: 160px; padding: 9px 12px; }
  .vs-chat-tooltip-greet { font-size: 0.85rem; }
  .vs-chat-tooltip-sub { font-size: 0.68rem; }
  .vs-chat-header { padding: 14px 14px; }
  .vs-chat-header-name { font-size: 0.94rem; }
  .vs-chat-header-status { font-size: 0.68rem; }
  .vs-chat-support-msg { font-size: 0.74rem; padding: 8px 10px; }
  .vs-chat-tab-btn span { display: none; }
  .vs-chat-tab-btn i { font-size: 1.05rem; }
  .vs-chat-tab-btn { padding: 12px 4px; }
  .vs-chat-stars { gap: 4px; }
  .vs-chat-star { font-size: 1.5rem; }
}
@media (max-width: 380px) {
  .vs-chat-window { width: calc(100vw - 10px); right: 5px; bottom: 74px; }
  .vs-chat-launcher { right: 10px; }
  .vs-chat-tooltip { display: none; }
}

/* Dark mode */
body.vs-dark .vs-chat-window { background: #1e2a3a; }
body.vs-dark .vs-chat-welcome,
body.vs-dark .vs-chat-messages,
body.vs-dark .vs-chat-solutions,
body.vs-dark .vs-chat-contact { background: #1a2640; }
body.vs-dark .vs-chat-quick-q,
body.vs-dark .vs-chat-sol-card,
body.vs-dark .vs-chat-contact-item { background: #253550; border-color: #334466; }
body.vs-dark .vs-chat-quick-q strong,
body.vs-dark .vs-chat-sol-card strong { color: #74c5b5; }
body.vs-dark .vs-chat-msg.bot .vs-chat-msg-bubble { background: #253550; color: #e0e6ed; border-color: #334466; }
body.vs-dark .vs-chat-input { background: #1e2a3a; border-color: #334466; }
body.vs-dark .vs-chat-input input { background: #253550; border-color: #334466; color: #e0e6ed; }
body.vs-dark .vs-chat-tabs { background: #1e2a3a; border-color: #334466; }
body.vs-dark .vs-chat-powered { background: #1e2a3a; border-color: #253550; }
body.vs-dark .vs-chat-feedback { background: #1a2640; }
body.vs-dark .vs-chat-fb-field { background: #253550; border-color: #334466; color: #e0e6ed; }
body.vs-dark .vs-chat-fb-intro { color: #aab4c7; }
body.vs-dark .vs-chat-star { color: #334466; }
body.vs-dark .vs-chat-tooltip { background: #253550; border-color: #334466; color: #e0e6ed; }
body.vs-dark .vs-chat-tooltip-greet { color: #e0e6ed; }
body.vs-dark .vs-chat-tooltip::after { border-left-color: #253550; }
