/*
 * message-viz-inline.css — styling for live ```viz components rendered inline in
 * the conversation by message-viz-inline.js. Kept minimal and theme-aware (uses
 * LibreChat surface/border tokens) so it blends with chat bubbles in light/dark.
 */

.viz-inline-hidden {
  display: none !important;
}

.viz-inline-card {
  width: 100%;
  margin: 0.5rem 0 0.75rem;
  border: 1px solid var(--border-light, #e5e7eb);
  border-radius: 0.75rem;
  overflow: hidden;
  background: var(--surface-primary, #fff);
}

.viz-inline-frame {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  min-height: 160px;
}

.viz-inline-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 12px;
  border-top: 1px solid var(--border-light, #e5e7eb);
  direction: rtl;
}

/* "הורד" button + "פתח בלשונית חדשה" link share the same subtle, secondary look. */
.viz-inline-actions .viz-inline-newtab,
.viz-inline-actions .viz-inline-download {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  font-family: inherit;
  line-height: 1.4;
  color: var(--text-secondary, #6b7280);
  text-decoration: none;
  background: none;
  border: 0;
  padding: 2px 4px;
  border-radius: 6px;
  cursor: pointer;
}

.viz-inline-actions .viz-inline-newtab:hover,
.viz-inline-actions .viz-inline-download:hover {
  color: var(--text-primary, #111827);
  text-decoration: underline;
}

.viz-inline-actions .viz-inline-download.viz-inline-download-busy {
  cursor: default;
  opacity: 0.7;
  text-decoration: none;
}

.viz-inline-download svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.viz-inline-spin {
  animation: viz-inline-spin 1s linear infinite;
}

@keyframes viz-inline-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* transient feedback toast (errors / auth) */
.viz-inline-toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #25408f;
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  z-index: 99999;
  direction: rtl;
  font-size: 14px;
  font-family: inherit;
  max-width: 320px;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.viz-inline-toast.viz-inline-toast-error {
  background: #b91c1c;
}

.viz-inline-toast.viz-inline-toast-show {
  opacity: 1;
}
