/* Canlı yardım — kompakt sohbet (Zendesk / modern widget yoğunluğu)
   html kökü 14px; metinlerde px ile okunabilirlik. */

/* Su yüzeyinde yayılma: ince dış halka + hafif büyüyüp solma */
@keyframes sg-help-asst-fab-attn {
  0%,
  100% {
    box-shadow: var(--sg-shadow-lg, 0 10px 40px rgba(15, 23, 42, 0.18));
  }
  50% {
    box-shadow:
      0 12px 36px rgba(28, 130, 255, 0.2),
      0 0 0 1px rgba(255, 255, 255, 0.1) inset;
  }
}

@keyframes sg-help-asst-fab-ripple-a {
  0% {
    transform: scale(1);
    opacity: 0.42;
  }
  65%,
  100% {
    transform: scale(1.48);
    opacity: 0;
  }
}

@keyframes sg-help-asst-fab-ripple-b {
  0% {
    transform: scale(1);
    opacity: 0;
  }
  8% {
    opacity: 0.36;
  }
  70%,
  100% {
    transform: scale(1.62);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sg-help-asst-fab {
    animation: none !important;
  }

  .sg-help-asst-fab::before,
  .sg-help-asst-fab::after {
    animation: none !important;
    opacity: 0 !important;
  }
}

.sg-help-asst-fab {
  position: fixed;
  right: var(--sg-space-5, 20px);
  bottom: var(--sg-space-5, 20px);
  z-index: 1040;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: var(--sg-primary-500, #1c82ff);
  color: var(--sg-neutral-0, #fff);
  box-shadow: var(--sg-shadow-lg, 0 10px 40px rgba(15, 23, 42, 0.18));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  isolation: isolate;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  animation: sg-help-asst-fab-attn 3.2s ease-in-out infinite;
}

.sg-help-asst-fab::before,
.sg-help-asst-fab::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 56px;
  height: 56px;
  margin: -28px 0 0 -28px;
  border-radius: 50%;
  box-sizing: border-box;
  border: 1.5px solid rgba(28, 130, 255, 0.4);
  background: transparent;
  pointer-events: none;
  z-index: 0;
  transform-origin: center;
  will-change: transform, opacity;
}

.sg-help-asst-fab::before {
  animation: sg-help-asst-fab-ripple-a 2.8s ease-out infinite;
}

.sg-help-asst-fab::after {
  border-color: rgba(147, 197, 253, 0.45);
  animation: sg-help-asst-fab-ripple-b 2.8s ease-out infinite;
  animation-delay: 1.4s;
}

.sg-help-asst-fab .fa,
.sg-help-asst-fab .sg-help-asst-fab__icon {
  position: relative;
  z-index: 1;
}

.sg-help-asst-fab:hover,
.sg-help-asst-fab:focus-visible,
.sg-help-asst-fab[aria-expanded='true'] {
  animation: none;
}

.sg-help-asst-fab:hover::before,
.sg-help-asst-fab:hover::after,
.sg-help-asst-fab:focus-visible::before,
.sg-help-asst-fab:focus-visible::after,
.sg-help-asst-fab[aria-expanded='true']::before,
.sg-help-asst-fab[aria-expanded='true']::after {
  animation: none;
  opacity: 0;
}

.sg-help-asst-fab:hover {
  transform: scale(1.04);
  box-shadow: 0 12px 44px rgba(15, 23, 42, 0.22);
}

.sg-help-asst-fab:focus {
  outline: 2px solid var(--sg-primary-200, #93c5fd);
  outline-offset: 2px;
}

.sg-help-asst-fab .fa {
  font-size: 28px;
  line-height: 1;
}

.sg-help-asst-fab__icon {
  display: block;
  width: 26px;
  height: 26px;
}

.sg-help-asst-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1041;
  background: rgba(15, 23, 42, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.sg-help-asst-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.sg-help-asst-panel {
  position: fixed;
  z-index: 1042;
  right: var(--sg-space-4, 16px);
  bottom: var(--sg-space-4, 16px);
  width: 100%;
  max-width: 420px;
  height: min(86vh, 560px);
  max-height: calc(100vh - 72px);
  display: flex;
  flex-direction: column;
  background: var(--sg-neutral-0, #fff);
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.2);
  border: 1px solid var(--sg-neutral-200, #e2e8f0);
  transform: translateY(16px) scale(0.98);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.22s ease, opacity 0.22s ease;
  overflow: hidden;
}

.sg-help-asst-panel.is-open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.sg-help-asst-panel__head {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--sg-neutral-200, #e2e8f0);
  background: var(--sg-neutral-0, #fff);
}

.sg-help-asst-panel__head-text {
  min-width: 0;
}

.sg-help-asst-panel__title {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--sg-neutral-900, #0f172a);
}

.sg-help-asst-panel__subtitle {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
  color: var(--sg-neutral-600, #475569);
  font-weight: 400;
}

.sg-help-asst-panel__close {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: var(--sg-neutral-100, #f1f5f9);
  color: var(--sg-neutral-800, #1e293b);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sg-help-asst-panel__close:hover {
  background: var(--sg-neutral-200, #e2e8f0);
}

.sg-help-asst-chat {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--sg-neutral-50, #f8fafc);
}

.sg-help-asst-stream {
  flex: 1 1 auto;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 12px 12px;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sg-help-asst-live {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.sg-help-asst-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 100%;
}

.sg-help-asst-row--bot {
  justify-content: flex-start;
}

.sg-help-asst-row--user {
  justify-content: flex-end;
}

.sg-help-asst-row--suggestions {
  display: block;
  margin-top: 0;
}

.sg-help-asst-avatar {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--sg-primary-100, #dbeafe);
  color: var(--sg-primary-700, #0b6fe8);
  display: flex;
  align-items: center;
  justify-content: center;
}

.sg-help-asst-avatar__svg {
  display: block;
  width: 16px;
  height: 16px;
}

.sg-help-asst-bubble {
  max-width: calc(100% - 42px);
  padding: 10px 14px;
  font-size: 15px;
  line-height: 1.5;
  font-weight: 400;
}

.sg-help-asst-bubble--bot {
  background: var(--sg-neutral-0, #fff);
  color: var(--sg-neutral-900, #0f172a);
  border: 1px solid var(--sg-neutral-200, #e2e8f0);
  border-radius: 16px 16px 16px 4px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.sg-help-asst-bubble--user {
  background: var(--sg-primary-500, #1c82ff);
  color: var(--sg-neutral-0, #fff);
  border: none;
  border-radius: 16px 16px 4px 16px;
  max-width: 88%;
  font-weight: 500;
}

.sg-help-asst-bubble__lead {
  font-size: 15px;
  font-weight: 700;
  color: var(--sg-neutral-900, #0f172a);
  margin-bottom: 8px;
  line-height: 1.3;
}

.sg-help-asst-bubble p {
  margin: 0 0 8px;
  font-size: 15px;
  line-height: 1.55;
  color: inherit;
}

.sg-help-asst-bubble--bot p {
  color: var(--sg-neutral-900, #0f172a);
}

.sg-help-asst-bubble p:last-child {
  margin-bottom: 0;
}

.sg-help-asst-bubble--typing {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  min-width: 72px;
}

.sg-help-asst-typing__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--sg-neutral-500, #64748b);
  animation: sg-help-asst-dot 1.15s infinite ease-in-out both;
}

.sg-help-asst-typing__dot:nth-child(2) {
  animation-delay: 0.16s;
}

.sg-help-asst-typing__dot:nth-child(3) {
  animation-delay: 0.32s;
}

@keyframes sg-help-asst-dot {
  0%,
  70%,
  100% {
    transform: translateY(0);
    opacity: 0.35;
  }
  35% {
    transform: translateY(-5px);
    opacity: 1;
  }
}

.sg-help-asst__links {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--sg-neutral-200, #e2e8f0);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.sg-help-asst__links a {
  font-size: 15px;
  font-weight: 600;
  color: var(--sg-primary-600, #1c82ff);
  text-decoration: none;
}

.sg-help-asst__links a:hover {
  text-decoration: underline;
}

.sg-help-asst-suggestions {
  margin-left: 40px;
}

.sg-help-asst-suggestions__hint {
  font-size: 14px;
  font-weight: 600;
  color: var(--sg-neutral-700, #334155);
  margin-bottom: 8px;
}

.sg-help-asst__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Tanıtım sitesi: kısa etiketler, iki sütun */
.sg-help-asst--public .sg-help-asst__chips {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

@media (max-width: 360px) {
  .sg-help-asst--public .sg-help-asst__chips {
    grid-template-columns: 1fr;
  }
}

.sg-help-asst__chip {
  display: inline-flex;
  align-items: center;
  text-align: left;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--sg-neutral-900, #0f172a);
  background: var(--sg-neutral-0, #fff);
  border: 1.5px solid var(--sg-neutral-800, #1e293b);
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
  box-shadow: none;
}

.sg-help-asst--public .sg-help-asst__chip {
  justify-content: center;
  text-align: center;
  padding: 6px 10px;
  font-size: 13px;
  line-height: 1.3;
}

.sg-help-asst__chip:hover {
  border-color: var(--sg-primary-500, #1c82ff);
  background: var(--sg-primary-50, #eff6ff);
  color: var(--sg-neutral-900, #0f172a);
}

.sg-help-asst__chip:focus {
  outline: 2px solid var(--sg-primary-300, #60a5fa);
  outline-offset: 2px;
}

.sg-help-asst__chip:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Mesaj alanı — kompakt hap + yuvarlak gönder */
.sg-help-asst-inputbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px 12px;
  border-top: 1px solid var(--sg-neutral-200, #e2e8f0);
  background: var(--sg-neutral-0, #fff);
}

.sg-help-asst-input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 40px;
  max-height: 100px;
  padding: 10px 16px;
  font-size: 15px;
  line-height: 1.4;
  font-family: inherit;
  color: var(--sg-neutral-900, #0f172a);
  background: var(--sg-neutral-0, #fff);
  border: 2px solid var(--sg-neutral-800, #1e293b);
  border-radius: 22px;
  resize: vertical;
  box-sizing: border-box;
  box-shadow: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.sg-help-asst-input::placeholder {
  color: var(--sg-neutral-500, #64748b);
  font-size: 14px;
}

.sg-help-asst-input:focus,
.sg-help-asst-input:focus-visible {
  outline: none;
  border-color: var(--sg-primary-500, #1c82ff);
  box-shadow: none;
  background: var(--sg-neutral-0, #fff);
}

.sg-help-asst-input:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.sg-help-asst-inputbar__send {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0;
  line-height: 0;
  color: var(--sg-neutral-0, #fff);
  background: linear-gradient(145deg, var(--sg-primary-500, #1c82ff) 0%, var(--sg-primary-700, #0b6fe8) 100%);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(28, 130, 255, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.sg-help-asst-inputbar__send-icon {
  display: block;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.sg-help-asst-inputbar__send:focus,
.sg-help-asst-inputbar__send:focus-visible {
  outline: none;
}

.sg-help-asst-inputbar__send:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(28, 130, 255, 0.45);
  filter: brightness(1.02);
}

.sg-help-asst-inputbar__send:active:not(:disabled) {
  transform: scale(0.97);
}

.sg-help-asst-inputbar__send:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  filter: grayscale(0.2);
}

@media (max-width: 520px) {
  .sg-help-asst-panel {
    right: 8px;
    left: 8px;
    max-width: none;
    width: auto;
    height: min(90vh, 100%);
  }

  .sg-help-asst-suggestions {
    margin-left: 0;
  }

  .sg-help-asst-inputbar {
    padding: 8px 10px 10px;
    gap: 8px;
  }

  .sg-help-asst-input {
    min-height: 40px;
    font-size: 16px; /* iOS zoom önleme */
  }

  .sg-help-asst-inputbar__send {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
  }
}
