/* ── Chatbot Widget Stileri ── */

/* Tüm chatbot elemanlarında dokunma zoom engeli */
.chatbot-window,
.chatbot-fab,
.chatbot-close-btn,
.chatbot-send-btn,
.chatbot-quick-reply-btn,
.chatbot-messages,
.chatbot-bubble,
.chatbot-input-area,
.chatbot-live-btn {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.chatbot-fab {
  position: fixed;
  bottom: 48px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 24px;
  box-shadow: 0 4px 20px rgba(79, 70, 229, 0.35);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 999;
  font-family: var(--font-sans);
}

.chatbot-fab:hover {
  transform: scale(1.12) translateY(-4px);
  box-shadow: 0 8px 32px rgba(79, 70, 229, 0.45);
}

.chatbot-fab:active {
  transform: scale(1.08) translateY(-2px);
}

.chatbot-fab--hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.8);
}

/* ── Chat Window Container ── */
.chatbot-window {
  position: fixed;
  bottom: 100px;
  right: 24px;
  width: 420px;
  height: 580px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 998;
  opacity: 0;
  transform: translateY(20px) translateX(12px);
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.chatbot-window--open {
  opacity: 1;
  transform: translateY(0) translateX(0);
  pointer-events: auto;
}

/* ── Header ── */
.chatbot-header {
  background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
  color: white;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 16px 16px 0 0;
  flex-shrink: 0;
}

.chatbot-header-title {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chatbot-header-title h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  line-height: 1.4;
  letter-spacing: -0.3px;
}

.chatbot-header-title p {
  font-size: 12px;
  opacity: 0.88;
  margin: 0;
  font-weight: 500;
}

.chatbot-close-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.chatbot-close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

/* ── Messages Container ── */
.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #fafbfc;
}

.chatbot-messages::-webkit-scrollbar {
  width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chatbot-messages::-webkit-scrollbar-thumb {
  background: rgba(79, 70, 229, 0.2);
  border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(79, 70, 229, 0.35);
}

/* ── Messages ── */
.chatbot-message {
  display: flex;
  animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  gap: 8px;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chatbot-message--bot {
  justify-content: flex-start;
}

.chatbot-message--user {
  justify-content: flex-end;
}

.chatbot-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
}

.chatbot-bubble {
  max-width: 75%;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
  animation: messageAppear 0.3s ease 0.1s backwards;
  -webkit-user-select: text;
  user-select: text;
}

@keyframes messageAppear {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.chatbot-bubble--bot {
  background: white;
  color: #0f172a;
  border: 1px solid #e2e8f0;
  text-align: left;
}

.chatbot-bubble--user {
  background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
  color: white;
  text-align: right;
}

/* ── Quick Replies ── */
.chatbot-quick-replies {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.chatbot-quick-reply-btn {
  background: white;
  border: 1.5px solid #e2e8f0;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  color: #0f172a;
  transition: all 0.2s ease;
  font-weight: 500;
  text-align: left;
}

.chatbot-quick-reply-btn:hover {
  border-color: #4f46e5;
  background: rgba(79, 70, 229, 0.05);
  transform: translateX(2px);
}

.chatbot-quick-reply-btn:active {
  background: rgba(79, 70, 229, 0.12);
  border-color: #4f46e5;
}

/* ── Input Area ── */
.chatbot-input-area {
  padding: 14px;
  background: white;
  border-top: 1px solid #e2e8f0;
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.chatbot-input {
  flex: 1;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 16px; /* 16px+ → iOS zoom olmaz */
  font-family: var(--font-sans);
  color: #0f172a;
  transition: all 0.2s ease;
  outline: none;
}

.chatbot-input::placeholder {
  color: #64748b;
}

.chatbot-input:focus {
  border-color: #4f46e5;
  background: rgba(79, 70, 229, 0.03);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.chatbot-send-btn {
  background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
  border: none;
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.chatbot-send-btn:hover:not(:disabled) {
  transform: scale(1.08);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
}

.chatbot-send-btn:active:not(:disabled) {
  transform: scale(0.96);
}

.chatbot-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── Typing Indicator ── */
.chatbot-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 14px;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}

.chatbot-typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #64748b;
  animation: typingDot 1.4s infinite;
}

.chatbot-typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.chatbot-typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typingDot {
  0%, 60%, 100% {
    opacity: 0.3;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-6px);
  }
}

/* ── Status Badge ── */
.chatbot-status-badge {
  display: none;
}

.chatbot-status-dot {
  display: none;
}


/* ── Canlı Destek Butonu ── */
.chatbot-live-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 11px 16px;
  background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
  color: white;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
  animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.chatbot-live-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(79, 70, 229, 0.4);
  color: white;
}

.chatbot-live-btn i {
  font-size: 15px;
}

/* ── Privacy Note ── */
.chatbot-privacy-note {
  text-align: center;
  font-size: 11px;
  color: #94a3b8;
  padding: 6px 14px 10px;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex-shrink: 0;
}

.chatbot-privacy-note i {
  font-size: 10px;
  color: #94a3b8;
}

/* ── Responsive Design ── */
@media (max-width: 768px) {
  .chatbot-window {
    left: 8px;
    right: 8px;
    bottom: 72px;
    width: auto;
    height: 60vh;
    max-height: 520px;
    min-height: 360px;
    border-radius: 16px;
    transform: translateY(20px) scale(0.97);
    opacity: 0;
    pointer-events: none;
    /* JS will override bottom when keyboard is open */
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), bottom 0.15s ease;
  }

  .chatbot-window--open {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
  }

  .chatbot-header {
    border-radius: 16px 16px 0 0;
    padding: 10px 14px;
  }

  .chatbot-header-title h3 {
    font-size: 13px;
  }

  .chatbot-messages {
    padding: 10px;
    gap: 8px;
  }

  .chatbot-quick-replies {
    display: none !important;
  }

  .chatbot-bubble {
    max-width: 85%;
    font-size: 13px;
    padding: 9px 11px;
  }

  .chatbot-input-area {
    padding: 8px 10px;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
  }

  .chatbot-input {
    font-size: 16px;
    padding: 8px 10px;
  }

  .chatbot-send-btn {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }

  .chatbot-fab {
    bottom: 16px;
    right: 14px;
    width: 48px;
    height: 48px;
    font-size: 19px;
  }

  .chatbot-close-btn {
    width: 28px;
    height: 28px;
    font-size: 15px;
  }
}
