/* Technovole AI — floating chat widget for the public marketing site.
   Self-contained (doesn't depend on dashboard.css) so it can load on every marketing page. */
.tnv-bubble {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  width: 60px;
  height: 60px;
  border-radius: var(--radius-full);
  background: var(--gradient-brand);
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: var(--shadow-brand);
  cursor: pointer;
  z-index: 1050;
  transition: transform var(--dur-fast) ease;
}
.tnv-bubble:hover { transform: scale(1.06); }
.tnv-bubble .tnv-close-icon { display: none; }
.tnv-bubble.tnv-open .tnv-chat-icon { display: none; }
.tnv-bubble.tnv-open .tnv-close-icon { display: block; }

.tnv-panel {
  position: fixed;
  bottom: calc(var(--space-6) + 76px);
  right: var(--space-6);
  width: 360px;
  max-width: calc(100vw - 2 * var(--space-4));
  height: 500px;
  max-height: calc(100vh - 160px);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 1049;
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  pointer-events: none;
  transition: opacity var(--dur-base) ease, transform var(--dur-base) ease;
}
.tnv-panel.tnv-open { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }

.tnv-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  background: var(--gradient-brand);
  color: #fff;
  flex-shrink: 0;
}
.tnv-header i { font-size: 1.1rem; }
.tnv-header .tnv-title { font-weight: 700; font-size: var(--fs-base); line-height: 1.2; }
.tnv-header .tnv-subtitle { font-size: var(--fs-xs); opacity: 0.85; }

.tnv-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  background: var(--bg-canvas);
}
.tnv-bubble-msg { max-width: 82%; padding: 10px 14px; border-radius: var(--radius-lg); font-size: var(--fs-sm); line-height: 1.4; white-space: pre-wrap; }
.tnv-bubble-msg.tnv-user { align-self: flex-end; background: var(--gradient-brand); color: #fff; border-bottom-right-radius: 4px; }
.tnv-bubble-msg.tnv-agent { align-self: flex-start; background: var(--bg-surface); border: 1px solid var(--border-subtle); color: var(--text-primary); border-bottom-left-radius: 4px; }
.tnv-bubble-msg .tnv-actions { margin-top: var(--space-2); display: flex; gap: var(--space-2); flex-wrap: wrap; }
.tnv-bubble-msg .tnv-actions a { font-size: var(--fs-xs); font-weight: 700; color: var(--text-brand); text-decoration: none; }
.tnv-bubble-msg .tnv-actions a:hover { text-decoration: underline; }

.tnv-typing { align-self: flex-start; display: flex; gap: 4px; padding: 10px 14px; background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); border-bottom-left-radius: 4px; }
.tnv-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--text-tertiary); animation: tnvPulse 1s ease-in-out infinite; }
.tnv-typing span:nth-child(2) { animation-delay: 0.15s; }
.tnv-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes tnvPulse { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }

.tnv-input-row { display: flex; gap: var(--space-2); padding: var(--space-3); border-top: 1px solid var(--border-subtle); background: var(--bg-surface); flex-shrink: 0; }
.tnv-input-row input {
  flex: 1;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: var(--fs-sm);
  background: var(--bg-canvas);
  color: var(--text-primary);
}
.tnv-input-row input:focus { outline: none; border-color: var(--brand-500); }
.tnv-input-row button {
  width: 40px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--gradient-brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.tnv-input-row button:disabled { opacity: 0.6; cursor: default; }

@media (max-width: 480px) {
  .tnv-panel { right: var(--space-4); left: var(--space-4); width: auto; bottom: calc(var(--space-4) + 76px); }
  .tnv-bubble { right: var(--space-4); bottom: var(--space-4); }
}
