/* Yapay destek asistanı — Faz 1 (SSS tabanlı) */
.app-fab-stack {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 10040;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
}

.app-fab-stack:not(:has(.cookie-prefs-fab:not(.hidden), .support-assistant-fab:not(.hidden))) {
  display: none;
}

.support-assistant-fab {
  position: static;
  right: auto;
  bottom: auto;
  z-index: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.75rem;
  padding: 0.45rem 0.95rem 0.45rem 0.7rem;
  border: 1px solid rgba(42, 63, 84, 0.18);
  border-radius: 999px;
  background: linear-gradient(145deg, #2a3f54 0%, #384f6c 100%);
  color: #f8fafc;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.22);
  transition: transform 0.15s, box-shadow 0.15s;
}

.support-assistant-fab:hover,
.support-assistant-fab:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.28);
}

.support-assistant-fab.hidden {
  display: none !important;
}

.support-assistant-fab-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  font-size: 1rem;
  line-height: 1;
}

.support-assistant-panel {
  position: fixed;
  right: 1rem;
  bottom: 4.25rem;
  z-index: 10045;
  display: flex;
  flex-direction: column;
  width: min(22rem, calc(100vw - 1.5rem));
  max-height: min(32rem, calc(100dvh - 6rem));
  border: 1px solid rgba(42, 63, 84, 0.14);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.2);
  overflow: hidden;
}

.support-assistant-panel.hidden {
  display: none !important;
}

.support-assistant-head {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.85rem 0.95rem 0.75rem;
  background: linear-gradient(145deg, #2a3f54 0%, #3f5874 100%);
  color: #f1f5f9;
}

.support-assistant-avatar {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.12);
  font-size: 1.15rem;
}

.support-assistant-head-text {
  flex: 1;
  min-width: 0;
}

.support-assistant-head-text strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.25;
}

.support-assistant-head-text span {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.72rem;
  line-height: 1.35;
  opacity: 0.88;
}

.support-assistant-close {
  flex-shrink: 0;
  width: 1.85rem;
  height: 1.85rem;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
}

.support-assistant-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.support-assistant-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0.75rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  background: #f8fafc;
}

.support-assistant-msg {
  max-width: 92%;
  padding: 0.55rem 0.7rem;
  border-radius: 12px;
  font-size: 0.8125rem;
  line-height: 1.45;
}

.support-assistant-msg--bot {
  align-self: flex-start;
  background: #fff;
  border: 1px solid rgba(42, 63, 84, 0.1);
  color: #1e293b;
}

.support-assistant-msg--user {
  align-self: flex-end;
  background: #2a3f54;
  color: #f8fafc;
}

.support-assistant-msg-meta {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.68rem;
  font-weight: 700;
  opacity: 0.75;
}

.support-assistant-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0 0.85rem 0.55rem;
  background: #f8fafc;
}

.support-assistant-chip {
  border: 1px solid rgba(42, 63, 84, 0.16);
  border-radius: 999px;
  background: #fff;
  color: #334155;
  font: inherit;
  font-size: 0.72rem;
  line-height: 1.3;
  padding: 0.3rem 0.55rem;
  cursor: pointer;
}

.support-assistant-chip:hover {
  border-color: #2a3f54;
  color: #2a3f54;
}

.support-assistant-form {
  display: flex;
  gap: 0.45rem;
  padding: 0.65rem 0.75rem;
  border-top: 1px solid rgba(42, 63, 84, 0.1);
  background: #fff;
}

.support-assistant-input {
  flex: 1;
  min-width: 0;
  border: 1px solid rgba(42, 63, 84, 0.18);
  border-radius: 10px;
  padding: 0.45rem 0.6rem;
  font: inherit;
  font-size: 0.8125rem;
}

.support-assistant-send {
  flex-shrink: 0;
  border: none;
  border-radius: 10px;
  background: #2a3f54;
  color: #fff;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.45rem 0.75rem;
  cursor: pointer;
}

.support-assistant-send:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.support-assistant-foot {
  padding: 0.45rem 0.75rem 0.65rem;
  font-size: 0.68rem;
  line-height: 1.35;
  color: #64748b;
  background: #fff;
  border-top: 1px solid rgba(42, 63, 84, 0.06);
}

.support-assistant-typing {
  font-size: 0.75rem;
  color: #64748b;
  font-style: italic;
  padding: 0 0.85rem 0.35rem;
  background: #f8fafc;
}

.support-assistant-typing.hidden {
  display: none;
}

.support-assistant-teach {
  margin: 0;
  padding: 0.65rem 0.75rem 0.75rem;
  background: #f1f5f9;
  border-top: 1px solid rgba(42, 63, 84, 0.08);
}

.support-assistant-teach.hidden {
  display: none;
}

.support-assistant-teach-title {
  margin: 0 0 0.25rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #1e293b;
}

.support-assistant-teach-hint {
  margin: 0 0 0.55rem;
  font-size: 0.72rem;
  line-height: 1.35;
  color: #64748b;
}

.support-assistant-teach-field {
  display: block;
  margin-bottom: 0.5rem;
}

.support-assistant-teach-field span {
  display: block;
  font-size: 0.72rem;
  color: #475569;
  margin-bottom: 0.2rem;
}

.support-assistant-teach-field input,
.support-assistant-teach-field textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(42, 63, 84, 0.15);
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
  font: inherit;
  font-size: 0.82rem;
  background: #fff;
}

.support-assistant-teach-actions {
  margin-top: 0.35rem;
}

.support-assistant-teach-save {
  border: none;
  border-radius: 8px;
  padding: 0.45rem 0.75rem;
  background: #2a3f54;
  color: #fff;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.support-assistant-teach-save:disabled {
  opacity: 0.55;
}

.support-assistant-teach-msg {
  margin: 0.45rem 0 0;
  font-size: 0.72rem;
  color: #166534;
}

.support-assistant-teach-msg.hidden {
  display: none;
}

.support-assistant-teach-link {
  display: inline-block;
  margin-top: 0.45rem;
  padding: 0;
  border: none;
  background: none;
  color: #2a3f54;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

@media (max-width: 720px) {
  .app-fab-stack {
    display: none !important;
  }

  .support-assistant-panel {
    right: 0.65rem;
    left: 0.65rem;
    width: auto;
    bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
  }
}
