/* Ayşe Chat Widget */

/* --- Buton grubu (sağ altta) --- */
.ayse-launcher {
  position: fixed;
  bottom: 5.8rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  z-index: 998;
}

/* Yuvarlak buton */
.ayse-btn {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #e91e8c, #c2177a);
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  box-shadow: 0 4px 18px rgba(233,30,140,0.5);
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  flex-shrink: 0;
}

.ayse-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 26px rgba(233,30,140,0.65);
}

/* Pulse halkası */
.ayse-btn::before {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 2px solid rgba(233,30,140,0.45);
  animation: ayse-pulse 2.4s ease-out infinite;
  pointer-events: none;
}

@keyframes ayse-pulse {
  0%   { transform: scale(1);    opacity: 1; }
  70%  { transform: scale(1.18); opacity: 0; }
  100% { transform: scale(1.18); opacity: 0; }
}

/* Online noktası */
.ayse-btn::after {
  content: '';
  position: absolute;
  bottom: 3px;
  right: 3px;
  width: 12px;
  height: 12px;
  background: #4ade80;
  border-radius: 50%;
  border: 2px solid #fff;
}

/* "Ayşe" isim etiketi */
.ayse-btn-label {
  background: #1e2a38;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
  letter-spacing: 0.3px;
  font-family: inherit;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* --- Tanıtım balonu --- */
.ayse-intro {
  position: fixed;
  bottom: 11rem;
  right: 1.5rem;
  max-width: 240px;
  background: #fff;
  border-radius: 14px 14px 4px 14px;
  box-shadow: 0 4px 24px rgba(30,42,56,0.15);
  padding: 12px 36px 12px 14px;
  z-index: 997;
  font-size: 13.5px;
  color: #1e2a38;
  line-height: 1.5;
  border: 1px solid #fce4f3;
  animation: ayse-intro-in 0.35s ease;
}

.ayse-intro b {
  color: #e91e8c;
  display: block;
  margin-bottom: 2px;
  font-size: 13px;
}

.ayse-intro-close {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: none;
  font-size: 14px;
  color: #a0aab5;
  cursor: pointer;
  line-height: 1;
  padding: 2px;
}

.ayse-intro-close:hover { color: #6b7e94; }

@keyframes ayse-intro-in {
  from { opacity: 0; transform: translateY(8px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* --- Chat penceresi --- */
.ayse-window {
  position: fixed;
  bottom: 11rem;
  right: 1.5rem;
  width: 340px;
  height: 500px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 8px 40px rgba(30,42,56,0.18);
  display: flex;
  flex-direction: column;
  z-index: 999;
  overflow: hidden;
  transform: scale(0.92) translateY(16px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.22s ease, opacity 0.22s ease;
}

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

/* Header */
.ayse-header {
  background: linear-gradient(135deg, #e91e8c, #c2177a);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.ayse-header-avatar {
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,0.2);
  border: 2px solid rgba(255,255,255,0.4);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  position: relative;
}

.ayse-header-avatar::after {
  content: '';
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 10px;
  height: 10px;
  background: #4ade80;
  border-radius: 50%;
  border: 2px solid #c2177a;
}

.ayse-header-info { flex: 1; }
.ayse-header-name { color: #fff; font-weight: 700; font-size: 14px; line-height: 1.2; }
.ayse-header-status { color: rgba(255,255,255,0.82); font-size: 11px; }

.ayse-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.75);
  cursor: pointer;
  padding: 4px;
  font-size: 18px;
  line-height: 1;
  border-radius: 4px;
  transition: color 0.15s;
}
.ayse-close:hover { color: #fff; }

/* Mesajlar */
.ayse-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f8fafc;
}

.ayse-messages::-webkit-scrollbar { width: 4px; }
.ayse-messages::-webkit-scrollbar-track { background: transparent; }
.ayse-messages::-webkit-scrollbar-thumb { background: #dde3ea; border-radius: 4px; }

.ayse-msg {
  max-width: 82%;
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.5;
  word-break: break-word;
  white-space: pre-wrap;
}

.ayse-msg.bot {
  background: #fff;
  color: #1e2a38;
  border: 1px solid #e8f7fd;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.ayse-msg.user {
  background: linear-gradient(135deg, #e91e8c, #c2177a);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

/* WhatsApp butonu */
.ayse-wa-redirect {
  margin-top: 6px;
  padding: 9px 14px;
  background: #25d366;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  align-self: flex-start;
  transition: background 0.2s;
  max-width: 82%;
}
.ayse-wa-redirect:hover { background: #1ebe5a; }

/* Yazıyor animasyonu */
.ayse-typing {
  align-self: flex-start;
  display: flex;
  gap: 5px;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid #e8f7fd;
  border-radius: 12px;
  border-bottom-left-radius: 4px;
}

.ayse-typing span {
  width: 7px;
  height: 7px;
  background: #4bbfe3;
  border-radius: 50%;
  animation: ayse-bounce 1.2s infinite;
}
.ayse-typing span:nth-child(2) { animation-delay: 0.2s; }
.ayse-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes ayse-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40%           { transform: translateY(-6px); opacity: 1; }
}

/* Input */
.ayse-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid #edf2f7;
  background: #fff;
  flex-shrink: 0;
}

.ayse-input {
  flex: 1;
  border: 1px solid #dde3ea;
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 13.5px;
  outline: none;
  resize: none;
  font-family: inherit;
  color: #1e2a38;
  background: #f8fafc;
  transition: border-color 0.15s;
  max-height: 80px;
  min-height: 38px;
  line-height: 1.4;
}
.ayse-input:focus { border-color: #4bbfe3; background: #fff; }
.ayse-input::placeholder { color: #a0aab5; }

.ayse-send {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #e91e8c, #c2177a);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.15s, opacity 0.15s;
}
.ayse-send:hover { transform: scale(1.08); }
.ayse-send:disabled { opacity: 0.5; cursor: default; transform: none; }

/* Mobil */
@media (max-width: 600px) {
  .ayse-launcher { bottom: 5.2rem; right: 1rem; }
  .ayse-btn { width: 54px; height: 54px; font-size: 26px; }
  .ayse-intro { right: 1rem; bottom: 10.5rem; max-width: calc(100vw - 2rem); }
  .ayse-window { width: calc(100vw - 2rem); right: 1rem; bottom: 10.5rem; height: 430px; }
}
