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

/* Toggle button */
.vs-chat-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, #335596, #74c5b5);
  border: none;
  cursor: pointer;
  z-index: 9998;
  box-shadow: 0 6px 25px rgba(51,85,150,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(51,85,150,0.5);
}
.vs-chat-toggle.active { transform: rotate(90deg) scale(1.05); }
.vs-chat-toggle img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: contain;
}
.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 */
.vs-chat-support-msg {
  margin-top: 10px;
  padding: 8px 12px;
  background: rgba(255,255,255,0.1);
  border-radius: 8px;
  font-size: 0.78rem;
  line-height: 1.5;
  opacity: 0.92;
  border-left: 3px solid #74c5b5;
}

/* Header */
.vs-chat-header {
  background: linear-gradient(135deg, #335596 0%, #1d3461 100%);
  color: #fff;
  padding: 18px 20px;
  border-bottom: 3px solid #74c5b5;
}
.vs-chat-header-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.vs-chat-header-logo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #fff;
  padding: 3px;
  object-fit: contain;
}
.vs-chat-header-name {
  font-size: 0.95rem;
  font-weight: 600;
  flex: 1;
}
.vs-chat-header-name .vs-chat-verified {
  color: #74c5b5;
  font-size: 0.7rem;
  margin-left: 4px;
}
.vs-chat-header-status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  opacity: 0.85;
}
.vs-chat-header-status::before {
  content: '';
  width: 8px;
  height: 8px;
  background: #4ade80;
  border-radius: 50%;
}
.vs-chat-greeting {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 2px;
}
.vs-chat-subtitle {
  font-size: 0.82rem;
  opacity: 0.85;
}

/* Tabs */
.vs-chat-tabs {
  display: flex;
  background: #fff;
  border-bottom: 1px solid #e8eef5;
}
.vs-chat-tab-btn {
  flex: 1;
  padding: 10px 8px;
  border: none;
  background: transparent;
  font-size: 0.78rem;
  font-weight: 600;
  color: #999;
  cursor: pointer;
  font-family: 'Poppins', sans-serif;
  transition: all 0.25s;
  position: relative;
}
.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;
}

/* Mobile responsive */
@media (max-width: 480px) {
  .vs-chat-window {
    width: calc(100vw - 16px);
    right: 8px;
    bottom: 80px;
    max-height: 70vh;
    border-radius: 14px;
  }
  .vs-chat-toggle { width: 52px; height: 52px; bottom: 16px; right: 16px; }
  .vs-chat-toggle img { width: 28px; height: 28px; }
}
@media (max-width: 380px) {
  .vs-chat-window { width: calc(100vw - 10px); right: 5px; bottom: 74px; }
}

/* 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; }
