/* Értékesítés előtti lebegő Tovi-chat (resources/views/partials/sales-chat.blade.php) */
.sc-root {
  --sc-accent: #673ab7;
  --sc-accent-dark: #4a2a85;
  --sc-bg: #ffffff;
  --sc-soft: #f4f0fb;
  --sc-text: #1f1d24;
  --sc-muted: #6c6878;
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1045; /* Bootstrap modal (1050+) alatt, navbar (1030) fölött */
  font-family: inherit;
  font-size: 15px;
  line-height: 1.45;
  color: var(--sc-text);
}
.sc-root *, .sc-root *::before, .sc-root *::after { box-sizing: border-box; }

.sc-launcher {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 16px 6px 6px;
  border: 0;
  border-radius: 999px;
  background: var(--sc-accent);
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  box-shadow: 0 8px 24px rgba(74, 42, 133, .35);
  cursor: pointer;
  transition: transform .15s ease, background .15s ease;
}
.sc-launcher:hover { background: var(--sc-accent-dark); transform: translateY(-2px); }
.sc-launcher img { border-radius: 50%; background: #fff; }
.sc-root.sc-open .sc-launcher-wrap,
.sc-root.sc-open .sc-teaser { display: none; }
.sc-root.sc-hidden { display: none; }

/* csak a gomb szélességét veszi fel, így a × a gomb sarkán ül akkor is, ha fölötte szélesebb buborék van */
.sc-launcher-wrap { position: relative; width: fit-content; margin-left: auto; }
/* a gomb elrejtése: kicsi ×, a gomb bal felső sarkán */
.sc-hide {
  position: absolute;
  top: -8px;
  left: -8px;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid #d9d2e8;
  border-radius: 50%;
  background: #fff;
  color: var(--sc-muted);
  font-size: 15px;
  line-height: 18px;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .15);
  opacity: .85;
}
.sc-hide:hover { opacity: 1; color: var(--sc-text); }

/* megszólító buborék a gomb fölött */
.sc-teaser {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 4px;
  max-width: 270px;
  margin: 0 0 12px auto;
  padding: 10px 6px 10px 14px;
  background: #fff;
  border: 1px solid #e6e0f2;
  border-radius: 14px 14px 4px 14px;
  box-shadow: 0 10px 28px rgba(20, 10, 40, .18);
  animation: sc-pop .25s ease-out;
}
.sc-teaser[hidden] { display: none; }
.sc-teaser-text {
  flex: 1;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--sc-text);
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}
.sc-teaser-close {
  flex: none;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--sc-muted);
  font-size: 18px;
  line-height: 20px;
  cursor: pointer;
}
.sc-teaser-close:hover { background: var(--sc-soft); color: var(--sc-text); }
@keyframes sc-pop { from { opacity: 0; transform: translateY(8px) scale(.97); } to { opacity: 1; transform: none; } }

.sc-panel {
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 560px;
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  background: var(--sc-bg);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(20, 10, 40, .28);
}
.sc-panel[hidden] { display: none; }

.sc-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--sc-accent);
  color: #fff;
}
.sc-header img { border-radius: 50%; background: #fff; }
.sc-title { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.sc-title span { font-size: 12px; opacity: .85; }
.sc-close {
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}

.sc-log {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  background: var(--sc-soft);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sc-msg {
  max-width: 85%;
  padding: 9px 13px;
  border-radius: 16px;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}
.sc-msg p { margin: 0 0 6px; }
.sc-msg p:last-child { margin-bottom: 0; }
.sc-msg ul { margin: 4px 0 6px; padding-left: 18px; }
.sc-msg a { color: inherit; text-decoration: underline; }
.sc-msg-model { align-self: flex-start; background: #fff; border: 1px solid #e6e0f2; border-bottom-left-radius: 4px; }
.sc-msg-model a { color: var(--sc-accent); }
.sc-msg-user { align-self: flex-end; background: var(--sc-accent); color: #fff; border-bottom-right-radius: 4px; white-space: pre-wrap; }
.sc-msg-error { border-color: #f1c0c0; background: #fff5f5; }

.sc-typing { display: inline-flex; gap: 4px; }
.sc-typing span {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--sc-muted);
  animation: sc-bounce 1s infinite ease-in-out;
}
.sc-typing span:nth-child(2) { animation-delay: .15s; }
.sc-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes sc-bounce { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-4px); } }

.sc-suggestions { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 10px; background: var(--sc-soft); }
.sc-suggestions:empty { display: none; }
.sc-chip {
  border: 1px solid var(--sc-accent);
  background: #fff;
  color: var(--sc-accent);
  border-radius: 999px;
  padding: 4px 11px;
  font-size: 13px;
  cursor: pointer;
}
.sc-chip:hover { background: var(--sc-accent); color: #fff; }

.sc-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid #ece7f5; background: #fff; }
.sc-input {
  flex: 1;
  resize: none;
  border: 1px solid #d9d2e8;
  border-radius: 12px;
  padding: 8px 12px;
  font: inherit;
  max-height: 110px;
  outline: none;
}
.sc-input:focus { border-color: var(--sc-accent); box-shadow: 0 0 0 3px rgba(103, 58, 183, .15); }
.sc-send {
  width: 42px;
  border: 0;
  border-radius: 12px;
  background: var(--sc-accent);
  color: #fff;
  font-size: 17px;
  cursor: pointer;
}
.sc-send:disabled { opacity: .5; cursor: default; }
.sc-footnote { font-size: 11px; color: var(--sc-muted); text-align: center; padding: 0 10px 8px; background: #fff; }

@media (max-width: 575.98px) {
  .sc-root { right: 12px; bottom: 12px; }
  .sc-launcher-label { display: none; }
  .sc-launcher { padding: 6px; }
  .sc-teaser { max-width: calc(100vw - 24px); }
  .sc-root.sc-open { left: 0; right: 0; bottom: 0; top: 0; }
  .sc-root.sc-open .sc-panel { width: 100%; max-width: none; height: 100%; max-height: none; border-radius: 0; }
}

@media print { .sc-root { display: none; } }
