/* Sağ sohbet asistanı */
.site-assistant {
  position: fixed;
  right: 20px;
  bottom: 24px;
  z-index: 9400;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
}

.site-assistant[hidden] { display: none !important; }

.site-assistant-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border: 0;
  border-radius: 999px;
  background: #0b1220;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.28);
  transition: transform 0.2s ease, background 0.2s ease;
}

.site-assistant-toggle:hover {
  background: #1e293b;
  transform: translateY(-2px);
}

.site-assistant-toggle i { font-size: 18px; line-height: 1; }

.site-assistant-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 12px);
  width: min(380px, calc(100vw - 24px));
  height: min(560px, calc(100vh - 120px));
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e8edf4;
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.2);
  overflow: hidden;
}

.site-assistant-panel[hidden] { display: none !important; }

.site-assistant-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #312e81 0%, #4f46e5 55%, #6366f1 100%);
  color: #fff;
}

.site-assistant-header strong {
  display: block;
  font-size: 15px;
}

.site-assistant-header p {
  margin: 4px 0 0;
  font-size: 12px;
  opacity: 0.9;
}

.site-assistant-close {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.site-assistant-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sa-msg {
  max-width: 92%;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.sa-msg p { margin: 0; }

.sa-msg--bot {
  align-self: flex-start;
  background: #fff;
  border: 1px solid #e8edf4;
  color: #0b1220;
  border-bottom-left-radius: 4px;
}

.sa-msg--user {
  align-self: flex-end;
  background: #4f46e5;
  color: #fff;
  border-bottom-right-radius: 4px;
}

.sa-msg--typing {
  color: #64748b;
  font-style: italic;
}

.sa-companies {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.sa-company {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e8edf4;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.sa-company:hover {
  border-color: #c7d2fe;
  background: #eef2ff;
  color: inherit;
}

.sa-company-logo,
.sa-company-logo-fallback {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  flex-shrink: 0;
  background: #eef2ff;
  object-fit: contain;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #4f46e5;
  font-size: 18px;
}

.sa-company-meta { min-width: 0; }
.sa-company-meta strong {
  display: block;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sa-company-meta span {
  display: block;
  font-size: 11.5px;
  color: #64748b;
  margin-top: 2px;
}

.sa-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.sa-link {
  display: inline-flex;
  padding: 5px 10px;
  border-radius: 999px;
  background: #eef2ff;
  color: #4338ca;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

.sa-link:hover { background: #e0e7ff; color: #3730a3; }

.site-assistant-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 12px 10px;
  background: #fff;
  border-top: 1px solid #eef2f7;
}

.site-assistant-quick button {
  border: 1px solid #e8edf4;
  background: #f8fafc;
  color: #334155;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.site-assistant-quick button:hover {
  border-color: #c7d2fe;
  background: #eef2ff;
  color: #4338ca;
}

.site-assistant-form {
  display: flex;
  gap: 8px;
  padding: 10px 12px 12px;
  background: #fff;
  border-top: 1px solid #e8edf4;
}

.site-assistant-input {
  flex: 1;
  min-width: 0;
  border: 1px solid #e8edf4;
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  font-size: 13.5px;
  background: #f8fafc;
}

.site-assistant-input:focus {
  outline: 2px solid rgba(79, 70, 229, 0.25);
  border-color: #a5b4fc;
  background: #fff;
}

.site-assistant-send {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 12px;
  background: #4f46e5;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.site-assistant-send:hover { background: #4338ca; }
.site-assistant-send:disabled { opacity: 0.6; cursor: default; }

@media (max-width: 768px) {
  .site-assistant {
    right: 12px;
    bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  }

  .site-assistant-toggle span { display: none; }
  .site-assistant-toggle {
    width: 52px;
    height: 52px;
    padding: 0;
    justify-content: center;
  }

  .site-assistant-panel {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(76px + env(safe-area-inset-bottom, 0px));
    width: auto;
    height: min(70vh, 560px);
  }
}
