/* ═══════════════════════════════════════
   CANLI DESTEK — Chat Widget CSS
   ═══════════════════════════════════════ */

/* CHAT BUTONU (sağ alt) */
#chat-fab {
  position: fixed;
  bottom: 28px; right: 28px;
  width: 56px; height: 56px;
  background: linear-gradient(135deg,#1a3a0d,var(--g));
  border-radius: 50%;
  box-shadow: 0 6px 24px rgba(90,158,58,.45);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; z-index: 999999;
  transition: all .3s cubic-bezier(.34,1.56,.64,1);
  border: none;
}
#chat-fab:hover { transform: scale(1.1); box-shadow: 0 8px 30px rgba(90,158,58,.55); }
#chat-fab-icon { font-size: 24px; transition: transform .3s; }
#chat-fab-badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--red); color: #fff;
  width: 20px; height: 20px;
  border-radius: 50%; font-size: 10px; font-weight: 700;
  display: none; align-items: center; justify-content: center;
  border: 2px solid #fff;
}

/* CHAT PENCERE */
#chat-window {
  position: fixed;
  bottom: 96px; right: 28px;
  width: 340px;
  max-height: 520px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.2), 0 0 0 1px rgba(0,0,0,.06);
  display: flex; flex-direction: column;
  z-index: 999998;
  opacity: 0; pointer-events: none;
  transform: translateY(20px) scale(.95);
  transition: all .3s cubic-bezier(.34,1.56,.64,1);
  overflow: hidden;
}
#chat-window.open {
  opacity: 1; pointer-events: all;
  transform: translateY(0) scale(1);
}

/* CHAT HEADER */
.chat-hd {
  background: linear-gradient(135deg,#1a3a0d 0%,var(--g) 100%);
  padding: 16px 18px;
  display: flex; align-items: center; gap: 12px;
  flex-shrink: 0;
}
.chat-av {
  width: 38px; height: 38px;
  background: rgba(255,255,255,.15);
  border: 2px solid rgba(255,255,255,.25);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.chat-online-dot {
  width: 10px; height: 10px;
  background: #4caf50;
  border: 2px solid #fff;
  border-radius: 50%;
  position: absolute; bottom: 0; right: 0;
}
.chat-hd-info { flex: 1; }
.chat-hd-nm { font-size: 13px; font-weight: 700; color: #fff; }
.chat-hd-st { font-size: 10px; color: rgba(255,255,255,.7); display: flex; align-items: center; gap: 5px; }
.chat-close {
  background: rgba(255,255,255,.15); border: none;
  color: #fff; width: 28px; height: 28px;
  border-radius: 50%; cursor: pointer; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.chat-close:hover { background: rgba(255,255,255,.25); }

/* CHAT MESAJLAR */
.chat-msgs {
  flex: 1; overflow-y: auto;
  padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
  background: #f8fdf5;
  min-height: 220px;
}
.chat-msgs::-webkit-scrollbar { width: 4px; }
.chat-msgs::-webkit-scrollbar-track { background: transparent; }
.chat-msgs::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

.chat-msg {
  display: flex; gap: 8px; align-items: flex-end;
  animation: msgIn .25s ease;
}
@keyframes msgIn {
  from { opacity:0; transform: translateY(8px); }
  to   { opacity:1; transform: translateY(0); }
}
.chat-msg.user { flex-direction: row-reverse; }
.chat-msg-av {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; flex-shrink: 0;
}
.chat-msg-av.support { background: linear-gradient(135deg,#1a3a0d,var(--g)); color: #e8c97a; font-weight: 700; }
.chat-msg-av.user-av  { background: var(--g3); border: 1px solid var(--border2); font-size: 10px; color: var(--g); font-weight: 700; }
.chat-msg-body { max-width: 220px; }
.chat-msg-text {
  padding: 9px 13px;
  border-radius: 16px;
  font-size: 12px; line-height: 1.55;
  word-break: break-word;
}
.chat-msg.support .chat-msg-text {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text);
  border-bottom-left-radius: 4px;
}
.chat-msg.user .chat-msg-text {
  background: linear-gradient(135deg,#2d6e1a,var(--g));
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-msg-time {
  font-size: 9px; color: var(--text3);
  margin-top: 3px; text-align: right;
}
.chat-msg.support .chat-msg-time { text-align: left; }

.chat-typing {
  display: flex; gap: 4px; padding: 10px 13px;
  background: #fff; border: 1px solid var(--border);
  border-radius: 16px; border-bottom-left-radius: 4px;
  width: fit-content;
}
.chat-typing span {
  width: 6px; height: 6px;
  background: var(--g2);
  border-radius: 50%;
  animation: typingDot 1.2s infinite;
}
.chat-typing span:nth-child(2) { animation-delay: .2s; }
.chat-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes typingDot {
  0%,60%,100% { transform: translateY(0); opacity:.4; }
  30% { transform: translateY(-5px); opacity:1; }
}

/* CHAT GİRİŞ */
.chat-foot {
  padding: 12px;
  border-top: 1px solid var(--border);
  background: #fff;
  display: flex; gap: 8px; align-items: flex-end;
  flex-shrink: 0;
}
.chat-input {
  flex: 1;
  border: 1.5px solid var(--border);
  border-radius: 22px;
  padding: 9px 14px;
  font-size: 12px;
  font-family: 'Inter', sans-serif;
  outline: none;
  resize: none;
  max-height: 80px;
  line-height: 1.4;
  transition: border-color .2s;
  background: var(--bg3);
}
.chat-input:focus { border-color: var(--g); background: #fff; }
.chat-send {
  width: 36px; height: 36px;
  background: var(--g);
  border: none; border-radius: 50%;
  color: #fff; font-size: 15px;
  cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s;
}
.chat-send:hover { background: var(--g2); transform: scale(1.05); }
.chat-send:disabled { opacity: .4; cursor: default; transform: none; }

/* HOŞGELDİN EKRANI */
.chat-welcome {
  padding: 20px;
  text-align: center;
}
.chat-welcome-icon { font-size: 40px; margin-bottom: 10px; }
.chat-welcome h3 { font-family: 'Playfair Display',serif; font-size: 16px; color: var(--text); margin-bottom: 6px; }
.chat-welcome p { font-size: 11px; color: var(--text3); line-height: 1.7; margin-bottom: 16px; }
.chat-welcome-btn {
  width: 100%;
  background: var(--g);
  color: #fff;
  border: none; border-radius: 8px;
  padding: 11px;
  font-size: 12px; font-weight: 700;
  cursor: pointer; font-family: 'Inter',sans-serif;
  transition: all .2s;
}
.chat-welcome-btn:hover { background: var(--g2); }
.chat-pre-q { margin-bottom: 6px; }
.chat-pre-q button {
  width: 100%; text-align: left;
  background: var(--g3); border: 1px solid var(--border2);
  border-radius: 8px; padding: 9px 12px;
  font-size: 11px; color: var(--g);
  cursor: pointer; margin-bottom: 5px;
  font-family: 'Inter',sans-serif;
  transition: all .2s;
}
.chat-pre-q button:hover { background: var(--g2); color: #fff; border-color: var(--g2); }

/* YENİ MESAJ BİLDİRİMİ */
.chat-notify {
  position: fixed;
  bottom: 96px; right: 28px;
  background: #fff;
  border: 1.5px solid var(--border2);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  display: flex; align-items: center; gap: 10px;
  z-index: 698;
  animation: notifyIn .4s cubic-bezier(.34,1.56,.64,1);
  cursor: pointer;
  max-width: 260px;
}
@keyframes notifyIn {
  from { opacity:0; transform: translateX(20px); }
  to   { opacity:1; transform: translateX(0); }
}

/* ADMİN DESTEK SEKMESİ */
.supp-sessions { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.supp-sess {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px; cursor: pointer;
  transition: all .2s; background: #fff;
}
.supp-sess:hover { border-color: var(--g2); background: var(--g3); }
.supp-sess.active { border-color: var(--g); background: var(--g3); }
.supp-sess.unread { border-color: rgba(255,160,0,.4); background: rgba(255,160,0,.04); }
.supp-sess-av {
  width: 38px; height: 38px;
  background: linear-gradient(135deg,#1a3a0d,var(--g));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #e8c97a; font-weight: 700; font-size: 15px;
  flex-shrink: 0;
}
.supp-sess-info { flex: 1; min-width: 0; }
.supp-sess-nm { font-size: 12px; font-weight: 600; color: var(--text); }
.supp-sess-preview { font-size: 10px; color: var(--text3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.supp-sess-meta { text-align: right; flex-shrink: 0; }
.supp-sess-time { font-size: 9px; color: var(--text3); }
.supp-unread-cnt {
  background: var(--red); color: #fff;
  width: 18px; height: 18px;
  border-radius: 50%; font-size: 9px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  margin-top: 3px; margin-left: auto;
}

.supp-chat-area {
  display: flex; flex-direction: column;
  height: 400px;
  border: 1.5px solid var(--border);
  border-radius: 8px; overflow: hidden;
  background: #f8fdf5;
}
.supp-chat-hd {
  background: linear-gradient(135deg,#1a3a0d,var(--g));
  padding: 12px 16px;
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
}
.supp-chat-msgs {
  flex: 1; overflow-y: auto;
  padding: 14px;
  display: flex; flex-direction: column; gap: 8px;
}
.supp-chat-foot {
  padding: 10px; border-top: 1px solid var(--border);
  background: #fff;
  display: flex; gap: 8px;
}
.supp-chat-foot input {
  flex: 1; border: 1.5px solid var(--border);
  border-radius: 20px; padding: 8px 14px;
  font-size: 12px; outline: none;
  font-family: 'Inter',sans-serif;
}
.supp-chat-foot input:focus { border-color: var(--g); }
.supp-reply-btn {
  background: var(--g); color: #fff;
  border: none; border-radius: 20px;
  padding: 8px 16px; font-size: 11px; font-weight: 700;
  cursor: pointer; font-family: 'Inter',sans-serif;
}

/* KULLANICI SİLME + MESAJ */
.usr-action-btn {
  padding: 5px 10px;
  font-size: 10px; font-weight: 600;
  border-radius: 4px; cursor: pointer;
  border: 1.5px solid;
  font-family: 'Inter',sans-serif;
  transition: all .2s;
}
.usr-msg-btn { color: var(--g); border-color: var(--border2); background: var(--g3); }
.usr-msg-btn:hover { background: var(--g); color: #fff; border-color: var(--g); }
.usr-del-btn { color: var(--red); border-color: rgba(200,16,46,.2); background: rgba(200,16,46,.04); }
.usr-del-btn:hover { background: var(--red); color: #fff; border-color: var(--red); }

/* MESAJ GÖNDERİM MODAL */
#msg-modal-wrap {
  position: fixed; inset: 0; z-index: 900;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .25s;
}
#msg-modal-wrap.on { opacity: 1; pointer-events: all; }
#msg-modal-bd {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.4); backdrop-filter: blur(4px);
}
#msg-modal-box {
  position: relative; z-index: 2;
  width: min(440px,94vw);
  background: #fff; border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,.25);
  transform: scale(.95); transition: transform .3s cubic-bezier(.34,1.56,.64,1);
}
#msg-modal-wrap.on #msg-modal-box { transform: scale(1); }
.mm-hd {
  background: linear-gradient(135deg,#1a3a0d,var(--g));
  padding: 20px 22px;
}
.mm-hd h3 { font-family:'Playfair Display',serif; font-size:18px; color:#fff; margin-bottom:3px; }
.mm-hd p  { font-size:11px; color:rgba(255,255,255,.65); }
.mm-body  { padding: 20px 22px 24px; }
.mm-body .fg label { font-size:10px; font-weight:700; letter-spacing:.5px; text-transform:uppercase; color:var(--text3); display:block; margin-bottom:6px; }
.mm-body .fg input,
.mm-body .fg textarea {
  width:100%; border:1.5px solid var(--border); border-radius:8px;
  padding:9px 13px; font-size:12px; font-family:'Inter',sans-serif;
  outline:none; transition:border-color .2s; background:var(--bg3);
}
.mm-body .fg input:focus,
.mm-body .fg textarea:focus { border-color:var(--g); background:#fff; }
.mm-body .fg { margin-bottom:13px; }
.mm-types { display:flex; gap:6px; flex-wrap:wrap; margin-bottom:14px; }
.mm-type-btn {
  padding:6px 12px; font-size:10px; font-weight:700;
  border-radius:20px; cursor:pointer; border:1.5px solid var(--border);
  background:transparent; color:var(--text3); font-family:'Inter',sans-serif;
  transition:all .2s;
}
.mm-type-btn.on { background:var(--g); color:#fff; border-color:var(--g); }
