/* ==========================================================================
   HİSGE — Yardım / ilk kullanım katmanı
   --------------------------------------------------------------------------
   * Küçük "?" düğmeleri, açıklama popup'ı ve minik animasyonlu gösterimler.
   * Harici varlık (GIF/Lottie) yoktur: animasyonlar satır içi SVG + CSS'tir.
   * CSP uyumludur; satır içi olay bağlayıcısı içermez.
   * Tema değişkenleri tokens.css'ten gelir; yoksa güvenli varsayılan kullanılır.
   ========================================================================== */

.isg-help-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  min-width: 20px;
  margin-left: 6px;
  padding: 0;
  border: 1px solid var(--isg-border, #e2e8f0);
  border-radius: 999px;
  background: var(--isg-surface, #fff);
  color: var(--isg-text-muted, #64748b);
  font: 700 11px/1 var(--isg-font-sans, system-ui, sans-serif);
  cursor: pointer;
  vertical-align: middle;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}

.isg-help-btn:hover,
.isg-help-btn:focus-visible {
  border-color: var(--isg-brand, #ff6600);
  color: var(--isg-brand, #ff6600);
  background: var(--isg-brand-soft, #fff4ec);
}

.isg-help-btn:focus-visible {
  outline: 2px solid var(--isg-brand, #ff6600);
  outline-offset: 2px;
}

html.dark .isg-help-btn {
  background: #1e293b;
  border-color: #334155;
  color: #94a3b8;
}

html.dark .isg-help-btn:hover {
  color: #ff8c42;
  border-color: #ff8c42;
  background: #2a1a0f;
}

/* --- Popup ---------------------------------------------------------------- */
.isg-help-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.66);
  backdrop-filter: blur(2px);
}

.isg-help-modal[hidden] {
  display: none;
}

.isg-help-dialog {
  width: min(560px, 100%);
  max-height: 92vh;
  overflow-y: auto;
  padding: 20px;
  border: 1px solid var(--isg-border, #e2e8f0);
  border-radius: 16px;
  background: var(--isg-surface, #fff);
  color: var(--isg-text, #334155);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.35);
}

html.dark .isg-help-dialog {
  background: #0f172a;
  border-color: #1e293b;
  color: #cbd5e1;
}

.isg-help-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--isg-border, #e2e8f0);
}

html.dark .isg-help-head {
  border-color: #1e293b;
}

.isg-help-head h2 {
  flex: 1;
  margin: 0;
  font-size: 0.98rem;
  font-weight: 800;
  line-height: 1.35;
  color: var(--isg-text-strong, #0f172a);
}

html.dark .isg-help-head h2 {
  color: #f1f5f9;
}

.isg-help-close {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border: 1px solid var(--isg-border, #e2e8f0);
  border-radius: 9px;
  background: transparent;
  color: inherit;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.isg-help-close:hover,
.isg-help-close:focus-visible {
  border-color: var(--isg-brand, #ff6600);
  color: var(--isg-brand, #ff6600);
}

.isg-help-lead {
  margin: 0 0 12px;
  font-size: 0.82rem;
  line-height: 1.7;
  color: var(--isg-text-muted, #64748b);
}

.isg-help-steps {
  margin: 0 0 14px;
  padding-left: 20px;
  font-size: 0.82rem;
  line-height: 1.75;
}

.isg-help-steps li {
  margin-bottom: 6px;
}

.isg-help-note {
  margin: 12px 0 0;
  padding: 9px 11px;
  border: 1px solid var(--isg-border, #e2e8f0);
  border-radius: 10px;
  background: var(--isg-surface-2, #f8fafc);
  font-size: 0.74rem;
  line-height: 1.65;
  color: var(--isg-text-muted, #64748b);
}

html.dark .isg-help-note {
  background: #111c2f;
  border-color: #1e293b;
}

.isg-help-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
}

.isg-help-check {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.74rem;
  color: var(--isg-text-muted, #64748b);
  cursor: pointer;
}

.isg-help-primary {
  min-height: 36px;
  padding: 8px 16px;
  border: 0;
  border-radius: 10px;
  background: var(--isg-brand, #ff6600);
  color: #1a1208;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}

.isg-help-primary:hover {
  filter: brightness(0.94);
}

/* --- Minik animasyonlu gösterimler ---------------------------------------- */
.isg-help-demo {
  display: block;
  width: 100%;
  max-width: 360px;
  margin: 0 auto 12px;
  border: 1px solid var(--isg-border, #e2e8f0);
  border-radius: 12px;
  background: var(--isg-surface-2, #f8fafc);
}

html.dark .isg-help-demo {
  background: #0b1322;
  border-color: #1e293b;
}

.isg-help-demo .hd-tap {
  transform-origin: center;
  animation: isg-help-tap 1.6s ease-in-out infinite;
}

.isg-help-demo .hd-cursor {
  animation: isg-help-cursor 3.2s ease-in-out infinite;
}

.isg-help-demo .hd-typing circle {
  animation: isg-help-dot 1.2s ease-in-out infinite;
}

.isg-help-demo .hd-typing circle:nth-child(2) { animation-delay: 0.16s; }
.isg-help-demo .hd-typing circle:nth-child(3) { animation-delay: 0.32s; }

.isg-help-demo .hd-sync {
  transform-origin: center;
  animation: isg-help-spin 2.4s linear infinite;
}

.isg-help-demo .hd-sweep {
  animation: isg-help-sweep 2.6s ease-in-out infinite;
}

.isg-help-demo .hd-check {
  stroke-dasharray: 24;
  stroke-dashoffset: 24;
  animation: isg-help-check 2.6s ease-in-out infinite;
}

@keyframes isg-help-tap {
  0%, 100% { transform: scale(1); opacity: 0.35; }
  50% { transform: scale(1.55); opacity: 0.05; }
}

@keyframes isg-help-cursor {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(28px, -14px); }
}

@keyframes isg-help-dot {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 1; }
}

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

@keyframes isg-help-sweep {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(52px); }
}

@keyframes isg-help-check {
  0%, 15% { stroke-dashoffset: 24; }
  45%, 85% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 24; }
}

@media (prefers-reduced-motion: reduce) {
  .isg-help-demo * {
    animation: none !important;
  }
  .isg-help-demo .hd-check {
    stroke-dashoffset: 0;
  }
}

@media (max-width: 640px) {
  .isg-help-dialog {
    padding: 16px;
    border-radius: 14px;
  }
}
