/* AI Asistan — sol alt FAB (her zaman görünür) */
.site-chatbot {
  position: fixed;
  left: 1rem;
  bottom: 1.25rem;
  z-index: 99999;
  font-family: var(--font, 'Segoe UI', system-ui, sans-serif);
  pointer-events: none;
}

.site-chatbot * {
  pointer-events: auto;
}

.chatbot-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-width: 58px;
  height: 58px;
  padding: 0 1rem;
  background: linear-gradient(135deg, var(--purple, #8b5cf6) 0%, var(--purple-dark, #6d28d9) 55%, var(--red, #c41e3a) 100%);
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: 50px;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 6px 28px rgba(109, 40, 217, 0.55), 0 0 0 0 rgba(139, 92, 246, 0.5);
  transition: transform .2s, box-shadow .2s;
  animation: chatFabPulse 2.5s ease-in-out infinite;
}

.chatbot-tab:hover,
.chatbot-tab:focus-visible {
  transform: scale(1.06);
  outline: none;
  box-shadow: 0 8px 32px rgba(109, 40, 217, 0.7);
}

@keyframes chatFabPulse {
  0%, 100% { box-shadow: 0 6px 28px rgba(109, 40, 217, 0.55), 0 0 0 0 rgba(139, 92, 246, 0.35); }
  50% { box-shadow: 0 8px 36px rgba(109, 40, 217, 0.75), 0 0 0 10px rgba(139, 92, 246, 0); }
}

.chatbot-tab-icon {
  display: flex;
  flex-shrink: 0;
}

.chatbot-tab-label {
  font-size: .8rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.chatbot-panel {
  position: fixed;
  left: 1rem;
  bottom: 5.5rem;
  width: min(400px, calc(100vw - 2rem));
  max-height: min(72vh, 560px);
  background: linear-gradient(180deg, #1a1528 0%, #0e0c14 100%);
  border: 2px solid var(--purple, #8b5cf6);
  border-radius: 14px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.65), 0 0 40px rgba(109, 40, 217, 0.2);
  display: flex;
  flex-direction: column;
  z-index: 100000;
  animation: chatPopIn .28s ease;
  overflow: hidden;
}

.chatbot-panel[hidden] {
  display: none !important;
}

@keyframes chatPopIn {
  from { transform: translateY(16px) scale(0.96); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.chatbot-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .5rem;
  padding: 1rem 1rem .75rem;
  border-bottom: 1px solid rgba(139, 92, 246, 0.35);
  background: linear-gradient(90deg, rgba(109, 40, 217, 0.35) 0%, rgba(196, 30, 58, 0.15) 100%);
}

.chatbot-header-text strong {
  display: block;
  font-size: 1.05rem;
  color: #fff;
}

.chatbot-header-text span {
  font-size: .75rem;
  color: var(--purple-light, #c4b5fd);
  line-height: 1.4;
}

.chatbot-close {
  background: rgba(0, 0, 0, 0.25);
  border: none;
  border-radius: 6px;
  color: #fff;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  padding: .15rem .45rem;
}

.chatbot-close:hover {
  background: var(--purple, #8b5cf6);
}

.chatbot-messages {
  flex: 1;
  min-height: 200px;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  scroll-behavior: smooth;
}

.chat-msg {
  max-width: 95%;
  padding: .65rem .85rem;
  border-radius: 12px;
  font-size: .88rem;
  line-height: 1.55;
  word-break: break-word;
}

.chat-msg-bot {
  align-self: flex-start;
  background: rgba(30, 24, 48, 0.9);
  border: 1px solid rgba(139, 92, 246, 0.3);
  color: var(--white, #f5f5f5);
}

.chat-msg-user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--purple, #8b5cf6), var(--purple-dark, #6d28d9));
  color: #fff;
}

.chat-msg-bot a {
  color: var(--purple-light, #c4b5fd);
  text-decoration: underline;
}

.chat-msg-typing {
  opacity: .7;
  font-style: italic;
}

.chat-msg-bot strong {
  color: var(--purple-light, #c4b5fd);
}

.chatbot-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  padding: 0 1rem .5rem;
  max-height: 100px;
  overflow-y: auto;
}

.chat-suggest-btn {
  font-size: .72rem;
  padding: .35rem .6rem;
  border-radius: 20px;
  border: 1px solid var(--purple-dark, #6d28d9);
  background: rgba(109, 40, 217, 0.2);
  color: var(--purple-light, #c4b5fd);
  cursor: pointer;
  transition: background .2s;
}

.chat-suggest-btn:hover {
  background: var(--purple, #8b5cf6);
  color: #fff;
}

.chat-wa-row {
  padding: 0 1rem .5rem;
}

.chat-wa-link {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .78rem;
  color: var(--whatsapp, #25d366) !important;
  border: 1px solid rgba(37, 211, 102, 0.35);
  padding: .4rem .65rem;
  border-radius: var(--radius, 6px);
}

.chatbot-form {
  display: flex;
  gap: .5rem;
  padding: .75rem 1rem 1rem;
  border-top: 1px solid rgba(139, 92, 246, 0.25);
  background: rgba(0, 0, 0, 0.3);
}

.chatbot-input {
  flex: 1;
  background: var(--black-soft, #1a1a1a);
  border: 1px solid rgba(139, 92, 246, 0.4);
  border-radius: var(--radius, 6px);
  color: #fff;
  padding: .6rem .75rem;
  font-size: .9rem;
}

.chatbot-input:focus {
  outline: none;
  border-color: var(--purple-light, #c4b5fd);
}

.chatbot-send {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: var(--radius, 6px);
  background: linear-gradient(135deg, var(--purple, #8b5cf6), var(--purple-dark, #6d28d9));
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chatbot-send:hover {
  filter: brightness(1.1);
}

.chatbot-send:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.site-chatbot.is-open .chatbot-tab {
  animation: none;
}

@media (max-width: 768px) {
  .site-chatbot {
    left: .75rem;
    bottom: 1rem;
  }

  .chatbot-tab {
    min-width: 54px;
    height: 54px;
    padding: 0 .85rem;
  }

  .chatbot-tab-label {
    font-size: .72rem;
  }

  .chatbot-panel {
    left: .75rem;
    right: .75rem;
    width: auto;
    bottom: 5rem;
    max-height: 70vh;
  }
}

@media (min-width: 769px) {
  body:has(.fab-whatsapp) .site-chatbot,
  body:has(.fab-support) .site-chatbot {
    bottom: 1.25rem;
  }
}
