/* Mor Elma Dijital Eğitim - Sohbet Asistanı
   Tüm seçiciler .me-sohbet ön ekiyle başlar; tema CSS'iyle çakışmaz. */

.me-sohbet-kok {
  --me-mor:       #7a1b55;
  --me-mor-koyu:  #5e1441;
  --me-mor-acik:  #9c2a6e;
  --me-zemin:     #ffffff;
  --me-kabarcik:  #f4eef2;
  --me-metin:     #2b2b2b;
  --me-soluk:     #7c7c7c;
  --me-cizgi:     #e6dde3;

  position: fixed;
  right: 20px;
  bottom: 90px; /* WhatsApp butonunun üzerinde kalsın */
  z-index: 99998;
  transition: bottom .2s ease;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

/* Sağ alt köşede başka bir buton (WhatsApp) yoksa balon aşağı iner.
   Bu sınıfı widget.js sayfaya bakarak kendisi ekler. */
.me-sohbet-kok.yalniz { bottom: 20px; }

/* --- Açma balonu --- */
.me-sohbet-buton {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: linear-gradient(145deg, var(--me-mor-acik), var(--me-mor-koyu));
  color: #fff;
  box-shadow: 0 6px 18px rgba(90, 20, 65, .38);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .18s ease, box-shadow .18s ease;
  padding: 0;
}
.me-sohbet-buton:hover  { transform: scale(1.06); box-shadow: 0 8px 24px rgba(90, 20, 65, .48); }
.me-sohbet-buton:active { transform: scale(.97); }
.me-sohbet-buton svg    { width: 28px; height: 28px; fill: #fff; }

/* Dikkat çeken küçük nokta */
.me-sohbet-nokta {
  position: absolute;
  top: 2px; right: 2px;
  width: 12px; height: 12px;
  background: #45c463;
  border: 2px solid #fff;
  border-radius: 50%;
}
.me-sohbet-kok.acik .me-sohbet-nokta { display: none; }

/* --- Panel --- */
.me-sohbet-panel {
  position: absolute;
  right: 0;
  bottom: 72px;
  width: 370px;
  max-width: calc(100vw - 32px);
  height: 540px;
  max-height: calc(100vh - 160px);
  background: var(--me-zemin);
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, .22);
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: me-sohbet-gir .2s ease;
}
.me-sohbet-kok.acik .me-sohbet-panel { display: flex; }
.me-sohbet-kok.acik .me-sohbet-buton-ikon-sohbet { display: none; }
.me-sohbet-kok:not(.acik) .me-sohbet-buton-ikon-kapat { display: none; }

@keyframes me-sohbet-gir {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --- Başlık --- */
.me-sohbet-baslik {
  background: linear-gradient(135deg, var(--me-mor), var(--me-mor-koyu));
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.me-sohbet-baslik-ad  { font-weight: 600; font-size: 15px; }
.me-sohbet-baslik-alt { font-size: 12px; opacity: .85; }
.me-sohbet-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .18);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.me-sohbet-avatar svg { width: 20px; height: 20px; fill: #fff; }
.me-sohbet-kapat {
  margin-left: auto;
  background: none; border: none; color: #fff;
  font-size: 22px; line-height: 1;
  cursor: pointer; opacity: .8;
  padding: 4px 6px; border-radius: 6px;
}
.me-sohbet-kapat:hover { opacity: 1; background: rgba(255, 255, 255, .14); }

/* --- Mesaj alanı --- */
.me-sohbet-govde {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: #fbf9fa;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.me-sohbet-govde::-webkit-scrollbar       { width: 6px; }
.me-sohbet-govde::-webkit-scrollbar-thumb { background: #d8ccd3; border-radius: 3px; }

.me-sohbet-mesaj {
  max-width: 85%;
  padding: 10px 13px;
  border-radius: 14px;
  word-wrap: break-word;
  white-space: pre-wrap;
  color: var(--me-metin);
}
.me-sohbet-mesaj.bot {
  background: var(--me-zemin);
  border: 1px solid var(--me-cizgi);
  border-bottom-left-radius: 4px;
  align-self: flex-start;
}
.me-sohbet-mesaj.ben {
  background: var(--me-mor);
  color: #fff;
  border-bottom-right-radius: 4px;
  align-self: flex-end;
}
.me-sohbet-mesaj.hata {
  background: #fdf0f0;
  border: 1px solid #f3d0d0;
  color: #8c2b2b;
  align-self: flex-start;
}
.me-sohbet-mesaj a          { color: var(--me-mor-acik); text-decoration: underline; }
.me-sohbet-mesaj.ben a      { color: #fff; }

/* Yazıyor göstergesi */
.me-sohbet-yaziyor {
  align-self: flex-start;
  display: flex; gap: 4px;
  padding: 12px 14px;
  background: var(--me-zemin);
  border: 1px solid var(--me-cizgi);
  border-radius: 14px;
  border-bottom-left-radius: 4px;
}
.me-sohbet-yaziyor span {
  width: 7px; height: 7px;
  background: #bfa9b7;
  border-radius: 50%;
  animation: me-sohbet-zipla 1.2s infinite;
}
.me-sohbet-yaziyor span:nth-child(2) { animation-delay: .18s; }
.me-sohbet-yaziyor span:nth-child(3) { animation-delay: .36s; }
@keyframes me-sohbet-zipla {
  0%, 60%, 100% { transform: translateY(0);    opacity: .5; }
  30%           { transform: translateY(-5px); opacity: 1;  }
}

/* --- Hızlı sorular --- */
.me-sohbet-oneriler {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 2px;
}
.me-sohbet-oneri {
  background: var(--me-zemin);
  border: 1px solid var(--me-mor);
  color: var(--me-mor);
  border-radius: 16px;
  padding: 7px 12px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s ease, color .15s ease;
}
.me-sohbet-oneri:hover { background: var(--me-mor); color: #fff; }

/* --- Giriş --- */
.me-sohbet-alt {
  border-top: 1px solid var(--me-cizgi);
  background: var(--me-zemin);
  padding: 10px;
  flex-shrink: 0;
}
.me-sohbet-form { display: flex; gap: 8px; align-items: flex-end; }
.me-sohbet-girdi {
  flex: 1;
  border: 1px solid var(--me-cizgi);
  border-radius: 20px;
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
  resize: none;
  max-height: 100px;
  outline: none;
  color: var(--me-metin);
  background: #fff;
}
.me-sohbet-girdi:focus { border-color: var(--me-mor); }
.me-sohbet-gonder {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--me-mor);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background .15s ease;
  padding: 0;
}
.me-sohbet-gonder:hover:not(:disabled) { background: var(--me-mor-acik); }
.me-sohbet-gonder:disabled             { background: #c9bcc4; cursor: default; }
.me-sohbet-gonder svg { width: 18px; height: 18px; fill: #fff; }

.me-sohbet-dipnot {
  text-align: center;
  font-size: 11px;
  color: var(--me-soluk);
  padding: 6px 10px 2px;
}

/* --- Mobil: tam ekran --- */
@media (max-width: 480px) {
  .me-sohbet-kok { right: 16px; bottom: 82px; }
  .me-sohbet-kok.yalniz { bottom: 16px; }
  .me-sohbet-panel {
    position: fixed;
    inset: 0;
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
  }
  /* Panel tam ekranken açma balonu giriş alanının üstünü kapatıyordu;
     kapatmak için başlıktaki × yeterli. */
  .me-sohbet-kok.acik .me-sohbet-buton { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .me-sohbet-panel, .me-sohbet-buton, .me-sohbet-yaziyor span { animation: none; transition: none; }
}
