/* Sidre Grup AI Asistan — Rafine, siteyle uyumlu tasarım (logo amblemi avatar) */
/* Ana renkler: #2f50e2 (mavi) → #1c2e86 (lacivert), beyaz, açık zemin */

.yildiz-chatbot {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10000;
  font-family: 'League Spartan', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ---- Aç butonu (logo amblemi) ---- */
.chat-toggle-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #eaf0ff;
  box-shadow: 0 8px 26px rgba(47, 80, 226, 0.40);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.chat-toggle-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 34px rgba(47, 80, 226, 0.5);
}
.chat-toggle-btn:active { transform: translateY(-1px); }
.chat-toggle-btn img {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: block;
}

/* ---- Pencere ---- */
.chat-container {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 384px;
  max-height: 560px;
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 18px 60px rgba(17, 24, 52, 0.28);
  display: none;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.3s ease;
}
.chat-container.active {
  display: flex;
  transform: translateY(0);
  opacity: 1;
}

/* ---- Başlık (degrade) ---- */
.chat-header {
  background: linear-gradient(135deg, #2f50e2 0%, #1c2e86 100%);
  color: #fff;
  padding: 15px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.chat-header-info { display: flex; align-items: center; gap: 12px; }
.chat-header-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}
.chat-header-avatar img { width: 38px; height: 38px; border-radius: 50%; display: block; }
.chat-header-text h3 { margin: 0; font-size: 16px; font-weight: 600; color: #fff; letter-spacing: .2px; }
.chat-header-text p { margin: 3px 0 0 0; font-size: 12px; color: #cdd6ff; }
.chat-header-text .status-indicator { display: inline-flex; align-items: center; gap: 6px; }
.chat-header-text .status-indicator::before {
  content: '';
  width: 7px; height: 7px;
  background: #34d399;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.25);
}
.chat-close-btn {
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: #fff;
  cursor: pointer;
  width: 30px; height: 30px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s ease;
}
.chat-close-btn:hover { background: rgba(255, 255, 255, 0.22); }
.chat-close-btn svg { width: 15px; height: 15px; fill: #fff; display: block; }

/* ---- Mesajlar ---- */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  background: #f5f7fd;
  display: flex;
  flex-direction: column;
  gap: 13px;
  min-height: 280px;
}
.chat-messages::-webkit-scrollbar { width: 5px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: #c7cfe6; border-radius: 3px; }

.message { display: flex; align-items: flex-end; gap: 9px; animation: chatFadeIn 0.3s ease; }
.message.user { flex-direction: row-reverse; }

.message-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.message.bot .message-avatar { background: #ffffff; box-shadow: 0 1px 5px rgba(17, 24, 52, 0.12); }
.message.bot .message-avatar img { width: 26px; height: 26px; border-radius: 50%; display: block; }
.message.user .message-avatar { background: linear-gradient(135deg, #2f50e2, #1c2e86); }
.message.user .message-avatar svg { width: 15px; height: 15px; fill: #fff; }

.message-content {
  max-width: 76%;
  padding: 11px 15px;
  font-size: 14px;
  line-height: 1.55;
  word-wrap: break-word;
}
.message.bot .message-content {
  background: #ffffff;
  color: #2b3142;
  box-shadow: 0 2px 10px rgba(17, 24, 52, 0.07);
  border-radius: 16px 16px 16px 5px;
}
.message.user .message-content {
  background: linear-gradient(135deg, #2f50e2, #2440c0);
  color: #fff;
  border-radius: 16px 16px 5px 16px;
}
.message-content b, .message-content strong { color: #1c2e86; font-weight: 600; }
.message.user .message-content b, .message.user .message-content strong { color: #fff; }
.message-content a { color: #2f50e2; font-weight: 600; text-decoration: none; }
.message-content a:hover { text-decoration: underline; }

/* ---- Hızlı cevap butonları (chip) ---- */
.chat-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 2px 39px;
  animation: chatFadeIn 0.3s ease;
}
.chat-chip {
  font-size: 13px;
  font-weight: 500;
  color: #2f50e2;
  background: #ffffff;
  border: 1.5px solid #d6ddfb;
  border-radius: 20px;
  padding: 8px 14px;
  cursor: pointer;
  transition: all 0.18s ease;
  font-family: inherit;
}
.chat-chip:hover { background: #2f50e2; color: #fff; border-color: #2f50e2; }

/* ---- Yazıyor göstergesi ---- */
.typing-indicator { display: flex; align-items: center; }
.typing-indicator .message-avatar { background: #fff; box-shadow: 0 1px 5px rgba(17, 24, 52, 0.12); }
.typing-indicator .message-avatar img { width: 26px; height: 26px; border-radius: 50%; }
.typing-dots {
  display: flex; gap: 4px;
  padding: 12px 16px;
  background: #fff;
  border-radius: 16px 16px 16px 5px;
  box-shadow: 0 2px 10px rgba(17, 24, 52, 0.07);
}
.typing-dot { width: 7px; height: 7px; border-radius: 50%; background: #2f50e2; animation: typingBounce 1.4s infinite ease-in-out; }
.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }
@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* ---- Giriş alanı ---- */
.chat-input-container { padding: 14px 16px; background: #fff; border-top: 1px solid #eef0f6; }
.chat-input-wrapper {
  display: flex; align-items: flex-end; gap: 9px;
  background: #f5f7fd;
  border: 1.5px solid #e6e9f5;
  border-radius: 14px;
  padding: 5px 5px 5px 15px;
  transition: all 0.2s ease;
}
.chat-input-wrapper:focus-within { border-color: #2f50e2; box-shadow: 0 0 0 4px rgba(47, 80, 226, 0.12); }
.chat-input {
  flex: 1; border: none; outline: none; background: none;
  padding: 9px 4px; font-size: 14px; resize: none;
  font-family: inherit; max-height: 80px; line-height: 1.4; color: #2b3142;
}
.chat-input::placeholder { color: #9aa3b8; }
.chat-send-btn {
  width: 40px; height: 40px;
  border-radius: 11px;
  background: linear-gradient(135deg, #2f50e2, #1c2e86);
  border: none; color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s ease; flex-shrink: 0;
}
.chat-send-btn:hover:not(:disabled) { filter: brightness(1.08); transform: translateY(-1px); }
.chat-send-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.chat-send-btn svg { width: 17px; height: 17px; fill: #fff; }

/* ---- Footer ---- */
.chat-footer {
  text-align: center;
  padding: 9px 16px;
  font-size: 11px;
  color: #9aa3b8;
  background: #fff;
}
.chat-footer a { color: #2f50e2; text-decoration: none; font-weight: 600; }
.chat-footer a:hover { text-decoration: underline; }

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

/* ---- Mobil ---- */
@media (max-width: 480px) {
  .yildiz-chatbot { bottom: 16px; right: 16px; }
  .chat-container { width: calc(100vw - 28px); max-width: none; bottom: 78px; border-radius: 14px; }
  .chat-toggle-btn { width: 58px; height: 58px; }
  .chat-toggle-btn img { width: 46px; height: 46px; }
  .chat-header { padding: 13px 15px; }
  .chat-messages { padding: 15px; min-height: 240px; }
  .chat-input-container { padding: 12px 14px; }
  .message-content { max-width: 84%; padding: 10px 13px; font-size: 13.5px; }
  .chat-quick-replies { margin-left: 30px; }
}
