/* Vidhi Vaani — floating legal assistant */

.vv-chat-launcher {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 900;
  width: 60px;
  height: 60px;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, var(--accent, #b0132f), #7c0c20);
  box-shadow: 0 10px 26px rgba(120, 10, 30, .35), 0 2px 6px rgba(0, 0, 0, .15);
  transition: transform .18s ease, box-shadow .18s ease;
}
.vv-chat-launcher:hover { transform: translateY(-2px) scale(1.03); box-shadow: 0 14px 32px rgba(120, 10, 30, .42); }
.vv-chat-launcher:focus-visible { outline: 3px solid #f3c14b; outline-offset: 3px; }
.vv-chat-launcher svg { width: 26px; height: 26px; }
.vv-chat-launcher .vv-chat-dot {
  position: absolute; top: 12px; right: 12px; width: 10px; height: 10px;
  border-radius: 50%; background: #3ddc84; border: 2px solid #fff;
}
.vv-chat-launcher.is-open { transform: scale(.92); }

.vv-chat-panel {
  position: fixed;
  right: 22px;
  bottom: 94px;
  z-index: 901;
  width: 392px;
  max-width: calc(100vw - 32px);
  height: min(590px, calc(100dvh - 130px));
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e7e1d8;
  border-radius: 18px;
  box-shadow: 0 26px 70px rgba(15, 23, 42, .28), 0 4px 14px rgba(15, 23, 42, .12);
  overflow: hidden;
  opacity: 0;
  transform: translateY(14px) scale(.98);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.vv-chat-panel.is-open { opacity: 1; transform: none; pointer-events: auto; }

.vv-chat-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  color: #fff;
  background: linear-gradient(135deg, #1c2536, #0f172a 55%, #3a1020);
}
.vv-chat-badge {
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .22);
  flex: 0 0 auto;
}
.vv-chat-badge svg { width: 21px; height: 21px; }
.vv-chat-head h3 { margin: 0; font-family: Georgia, 'Times New Roman', serif; font-size: 16px; letter-spacing: .2px; }
.vv-chat-head p { margin: 2px 0 0; font-size: 11px; opacity: .72; letter-spacing: .3px; }
.vv-chat-close {
  margin-left: auto; width: 32px; height: 32px; border-radius: 8px;
  border: 0; background: rgba(255, 255, 255, .1); color: #fff; cursor: pointer;
  display: grid; place-items: center; font-size: 18px; line-height: 1;
}
.vv-chat-close:hover { background: rgba(255, 255, 255, .2); }

.vv-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px 10px;
  background:
    radial-gradient(circle at 15% 10%, rgba(176, 19, 47, .045), transparent 45%),
    linear-gradient(#fbfaf7, #f7f5f0);
  scrollbar-width: thin;
}
.vv-chat-msg { display: flex; gap: 8px; margin-bottom: 12px; }
.vv-chat-msg.user { justify-content: flex-end; }
.vv-chat-avatar {
  width: 26px; height: 26px; border-radius: 50%; flex: 0 0 auto;
  display: grid; place-items: center;
  background: var(--accent, #b0132f); color: #fff;
  font-size: 10px; font-weight: 700; letter-spacing: .3px;
  margin-top: 2px;
}
.vv-chat-bubble {
  max-width: 84%;
  padding: 10px 12px;
  border-radius: 14px 14px 14px 4px;
  background: #fff;
  border: 1px solid #e9e3d9;
  color: #232a35;
  font-size: 13.4px;
  line-height: 1.55;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
  overflow-wrap: anywhere;
}
.vv-chat-bubble p { margin: 0 0 8px; }
.vv-chat-bubble p:last-child { margin-bottom: 0; }
.vv-chat-bubble ul, .vv-chat-bubble ol { margin: 6px 0 8px; padding-left: 18px; }
.vv-chat-bubble li { margin-bottom: 4px; }
.vv-chat-bubble strong { color: #111827; }
.vv-chat-bubble a { color: var(--accent, #b0132f); text-decoration: underline; text-underline-offset: 2px; }
.vv-chat-msg.user .vv-chat-bubble {
  background: linear-gradient(145deg, #1f2937, #111827);
  border-color: #111827;
  color: #f8fafc;
  border-radius: 14px 14px 4px 14px;
}
.vv-chat-sections { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.vv-chat-sections span {
  font-size: 10.5px; font-weight: 700; letter-spacing: .4px;
  padding: 4px 8px; border-radius: 6px;
  background: #fdf1f3; color: #9b1029; border: 1px solid #f3d4da;
}
.vv-chat-sources {
  margin-top: 8px; padding-top: 8px; border-top: 1px dashed #e9e3d9;
  font-size: 11.5px; color: #4b5563; line-height: 1.6;
}
.vv-chat-sources strong { font-size: 10.5px; letter-spacing: .4px; text-transform: uppercase; color: #6b7280; }
.vv-chat-sources a { margin-right: 4px; }
.vv-chat-disclaimer { margin-top: 8px !important; font-size: 10.5px; color: #8a8f98; line-height: 1.5; }
.vv-chat-list { margin: 4px 0 8px; padding-left: 16px; }
.vv-chat-list li { margin-bottom: 6px; font-size: 12.5px; }
.vv-chat-list span { color: #8a8f98; font-size: 11px; }
.vv-chat-orders { margin-top: 10px; padding-top: 9px; border-top: 1px dashed #e9e3d9; }
.vv-chat-orders > strong { font-size: 10.5px; letter-spacing: .4px; text-transform: uppercase; color: #6b7280; }
.vv-chat-more { display: inline-block; margin-top: 2px; font-size: 11.5px; font-weight: 600; }
.vv-chat-hint { font-size: 11.5px; color: #6b7280; line-height: 1.6; margin-top: 8px !important; }
.vv-chat-muted { color: #9ca3af; font-weight: 400; }

.vv-chat-typing { display: inline-flex; gap: 4px; align-items: center; padding: 4px 0; }
.vv-chat-typing i {
  width: 6px; height: 6px; border-radius: 50%; background: #b0132f; opacity: .35;
  animation: vv-blink 1.1s infinite ease-in-out;
}
.vv-chat-typing i:nth-child(2) { animation-delay: .15s; }
.vv-chat-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes vv-blink { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-2px); } }

.vv-chat-chips { display: flex; gap: 6px; flex-wrap: wrap; padding: 8px 14px 0; background: #fff; }
.vv-chat-chip {
  border: 1px solid #e3dcd1; background: #fbfaf7; color: #374151;
  font-size: 11.5px; padding: 6px 10px; border-radius: 999px; cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.vv-chat-chip:hover { border-color: var(--accent, #b0132f); color: var(--accent, #b0132f); background: #fff; }

.vv-chat-form { display: flex; gap: 8px; padding: 10px 12px 12px; background: #fff; border-top: 1px solid #f0ebe3; }
.vv-chat-input {
  flex: 1; resize: none; border: 1px solid #ddd5c9; border-radius: 12px;
  padding: 10px 12px; font: inherit; font-size: 13px; color: #111827;
  background: #fbfaf7; max-height: 96px; min-height: 42px; line-height: 1.4;
  overflow-y: auto;
}
.vv-chat-input:focus { outline: 2px solid rgba(176, 19, 47, .25); border-color: var(--accent, #b0132f); background: #fff; }
.vv-chat-send {
  width: 42px; height: 42px; border-radius: 12px; border: 0; cursor: pointer;
  display: grid; place-items: center; color: #fff;
  background: var(--accent, #b0132f);
}
.vv-chat-send:hover { filter: brightness(1.08); }
.vv-chat-send:disabled { opacity: .5; cursor: not-allowed; }
.vv-chat-send svg { width: 19px; height: 19px; }
.vv-chat-foot { padding: 0 14px 8px; font-size: 10px; color: #9ca3af; text-align: center; background: #fff; }

@media (max-width: 640px) {
  .vv-chat-launcher { right: 14px; bottom: 14px; width: 54px; height: 54px; }
  .vv-chat-panel {
    right: 8px; left: 8px; bottom: 8px; top: 8px;
    width: auto; max-width: none; height: auto; max-height: none;
    border-radius: 16px;
  }
  .vv-chat-bubble { max-width: 88%; }
}
@media (prefers-reduced-motion: reduce) {
  .vv-chat-panel, .vv-chat-launcher { transition: none; }
  .vv-chat-typing i { animation: none; }
}

/* Publication logo inside the assistant */
.vv-chat-launcher .vv-chat-logo {
  width: 40px; height: 40px; object-fit: contain;
  background: #fff; border-radius: 50%; padding: 3px;
}
.vv-chat-badge { background: #fff; border-color: rgba(255, 255, 255, .55); overflow: hidden; }
.vv-chat-badge .vv-chat-logo { width: 100%; height: 100%; object-fit: contain; padding: 3px; border-radius: 50%; }
.vv-chat-avatar { background: #fff; overflow: hidden; padding: 0; }
.vv-chat-avatar .vv-chat-logo { width: 100%; height: 100%; object-fit: contain; padding: 1px; border-radius: 50%; }

/* Small proactive bubble near the launcher */
.vv-chat-nudge {
  position: fixed; right: 26px; bottom: 96px; z-index: 900;
  max-width: 240px; padding: 10px 30px 10px 14px;
  background: #fff; color: #232a35; font-size: 12.5px; line-height: 1.45;
  border: 1px solid #e7e1d8; border-radius: 14px 14px 4px 14px;
  box-shadow: 0 10px 26px rgba(15, 23, 42, .16);
  cursor: pointer; opacity: 0; transform: translateY(6px); pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
}
.vv-chat-nudge.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.vv-chat-nudge-close {
  position: absolute; top: 3px; right: 6px; border: 0; background: none;
  color: #9ca3af; font-size: 15px; line-height: 1; cursor: pointer; padding: 2px;
}
.vv-chat-nudge-close:hover { color: #111827; }
@media (max-width: 640px) {
  .vv-chat-nudge { right: 14px; bottom: 80px; max-width: 210px; font-size: 12px; }
}
