/* chat-widget.css — MapSurve AI karşılama asistanı */

/* ── Floating trigger button (WhatsApp butonunun yerini alır) ── */
.chat-trigger-btn {
  position: fixed;
  bottom: 1.75rem;
  right: 1.75rem;
  z-index: 999;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, var(--cyan), #C73C30);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(229, 72, 59, 0.45);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  animation: chatPulse 2.4s ease infinite;
}

.chat-trigger-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 24px rgba(229, 72, 59, 0.65);
  animation: none;
}

.chat-trigger-btn.is-hidden {
  transform: scale(0);
  opacity: 0;
  pointer-events: none;
}

.chat-trigger-icon {
  width: 26px;
  height: 26px;
  stroke: #ffffff;
  fill: none;
  flex-shrink: 0;
}

.chat-trigger-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #3ED598;
  border: 2px solid var(--bg-primary);
}

@keyframes chatPulse {
  0%, 100% { box-shadow: 0 4px 16px rgba(229,72,59,0.45); }
  50%       { box-shadow: 0 4px 28px rgba(229,72,59,0.75), 0 0 0 8px rgba(229,72,59,0.12); }
}

/* ── Chat panel ── */
.chat-panel {
  position: fixed;
  bottom: 1.75rem;
  right: 1.75rem;
  z-index: 1001;
  width: 360px;
  max-width: calc(100vw - 2rem);
  height: 520px;
  max-height: calc(100vh - 3.5rem);
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.45);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(16px) scale(0.97);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.chat-panel.is-open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

/* Header */
.chat-panel-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.1rem;
  background: linear-gradient(135deg, var(--cyan), #C73C30);
  flex-shrink: 0;
}

.chat-panel-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chat-panel-avatar svg {
  width: 20px;
  height: 20px;
  stroke: #fff;
  fill: none;
}

.chat-panel-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.chat-panel-status {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.85);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.chat-panel-status::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3ED598;
  display: inline-block;
}

.chat-panel-close {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  color: #fff;
  opacity: 0.85;
  padding: 0.25rem;
  display: flex;
}

.chat-panel-close:hover { opacity: 1; }
.chat-panel-close svg { width: 18px; height: 18px; }

/* Book-a-call action row */
.chat-panel-book {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 0.83rem;
  font-weight: 600;
  text-decoration: none;
  flex-shrink: 0;
  cursor: pointer;
  border-top: none;
  border-left: none;
  border-right: none;
  transition: background 0.2s ease;
}

.chat-panel-book:hover { background: var(--bg-card); }
.chat-panel-book svg { width: 15px; height: 15px; stroke: var(--cyan); flex-shrink: 0; }

/* Messages */
.chat-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.chat-msg {
  max-width: 82%;
  padding: 0.6rem 0.85rem;
  border-radius: 14px;
  font-size: 0.86rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.chat-msg--bot {
  align-self: flex-start;
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-bottom-left-radius: 4px;
}

.chat-msg--user {
  align-self: flex-end;
  background: var(--cyan);
  color: #fff;
  border-bottom-right-radius: 4px;
}

/* Quick-reply suggestion chips */
.chat-quick-replies {
  align-self: flex-start;
  max-width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chat-chip {
  border: 1px solid var(--cyan);
  background: transparent;
  color: var(--cyan);
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.4rem 0.8rem;
  border-radius: 100px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.chat-chip:hover {
  background: var(--cyan);
  color: #fff;
}

/* Prominent "Randevu Planla" button among the quick replies */
.chat-quick-replies:has(.chat-chip--book) {
  width: 100%;
}

.chat-chip--book {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, var(--cyan), #C73C30);
  border-color: transparent;
  color: #fff;
  font-size: 0.85rem;
  padding: 0.65rem 1rem;
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(229, 72, 59, 0.35);
}

.chat-chip--book svg {
  width: 16px;
  height: 16px;
  stroke: #fff;
  flex-shrink: 0;
}

.chat-chip--book:hover {
  background: linear-gradient(135deg, #C73C30, var(--cyan));
  color: #fff;
  transform: translateY(-1px);
}

.chat-msg--error {
  align-self: center;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.78rem;
  text-align: center;
}

.chat-typing {
  align-self: flex-start;
  display: flex;
  gap: 4px;
  padding: 0.7rem 0.9rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  border-bottom-left-radius: 4px;
}

.chat-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: chatTypingBounce 1.1s infinite ease-in-out;
}
.chat-typing span:nth-child(2) { animation-delay: 0.15s; }
.chat-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes chatTypingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* Input row */
.chat-panel-input-row {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  padding: 0.75rem;
  border-top: 1px solid var(--border-color);
  flex-shrink: 0;
}

.chat-panel-input {
  flex: 1;
  resize: none;
  max-height: 90px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--bg-card);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.85rem;
  padding: 0.55rem 0.75rem;
  line-height: 1.4;
}

.chat-panel-input:focus {
  outline: none;
  border-color: var(--cyan);
}

.chat-panel-send {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border: none;
  border-radius: 10px;
  background: var(--cyan);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s ease;
}

.chat-panel-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.chat-panel-send svg { width: 17px; height: 17px; }

@media (max-width: 480px) {
  .chat-panel {
    right: 1rem;
    bottom: 1rem;
    left: 1rem;
    width: auto;
    height: min(70vh, 560px);
  }
  .chat-trigger-btn {
    right: 1.25rem;
    bottom: 1.25rem;
  }
}
