/* ==========================================================================
   Canlı destek penceresi (assets/js/support.js)

   Sağ altta düğme; açılınca düğmenin üstünden büyüyen panel. Mobilde tam
   ekran alt panel. Animasyonlar yalnızca transform/opacity, blur yok.
   Renkler tema değişkenlerinden (--accent-rgb …): panelden seçilen renge uyar.
   ========================================================================== */

.lc { --lc-b: 22px; position: fixed; right: 22px; bottom: var(--lc-b); z-index: 110; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; pointer-events: none; transition: bottom .45s var(--ease-spring); }
.lc > * { pointer-events: auto; }
/* misafir çubuğu görünürken üstüne çık */
body[data-auth="0"]:has(.guest-bar.is-visible) .lc { --lc-b: 92px; }
/* oyun ekranı açıkken düğme oyunun kontrollerini örtmesin diye gizlenir; destek, oynatıcının üst
   çubuğundaki düğmeden açılır (footer.php .player__support) ve panel oyunun üstünde görünür.
   Eskiden .lc tamamen gizleniyordu: oyundaki üye desteğe hiç ulaşamıyordu ("düğme kayboluyor"). */
.page-covered .lc:not(.is-open) > .lc__fab, .page-covered .lc > .lc__peek { display: none; }

/* ---------- düğme ---------- */
.lc__fab {
  position: relative;
  order: 3;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 56px;
  padding: 0 20px 0 8px;
  border-radius: 28px;
  color: #fff;
  background: var(--accent-grad);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), 0 14px 34px -10px rgba(var(--accent-rgb), .95), 0 0 0 1px rgba(var(--accent-hi-rgb), .35);
  font: 700 14.5px var(--font-display);
  transition: transform .35s var(--ease-spring), box-shadow .3s var(--ease), padding .35s var(--ease);
  animation: lc-in .7s var(--ease-spring) 1.2s backwards;
}
.lc__fab:hover { transform: translateY(-2px) scale(1.02); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), 0 18px 40px -10px rgba(var(--accent-rgb), 1), 0 0 0 1px rgba(var(--accent-hi-rgb), .6); }
.lc__fab:active { transform: scale(.97); }
.lc__fab-ico { position: relative; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: rgba(255, 255, 255, .16); }
.lc__fab-ico .ico { position: absolute; width: 21px; height: 21px; transition: opacity .25s, transform .4s var(--ease-spring); }
.lc__fab-ico .ico:last-child { opacity: 0; transform: rotate(-90deg) scale(.5); }
.lc.is-open .lc__fab-ico .ico:first-child { opacity: 0; transform: rotate(90deg) scale(.5); }
.lc.is-open .lc__fab-ico .ico:last-child { opacity: 1; transform: none; }
.lc__fab-text { white-space: nowrap; }
.lc__badge { position: absolute; top: -4px; right: -4px; min-width: 22px; height: 22px; box-shadow: 0 0 0 3px var(--bg-0); animation: lc-pop .45s var(--ease-spring); }

/* çevrimiçi temsilci varken düğmenin çevresinde yavaş halka */
.lc__ring { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; }
.lc[data-online="1"] .lc__ring::before,
.lc.has-unread .lc__ring::before { content: ''; position: absolute; inset: -1px; border-radius: inherit; border: 2px solid rgba(var(--accent-hi-rgb), .55); animation: lc-ring 2.6s var(--ease) infinite; }
.lc.has-unread .lc__ring::before { border-color: rgba(255, 77, 109, .7); animation-duration: 1.4s; }
.lc.is-open .lc__ring::before { animation: none; opacity: 0; }

/* kapalıyken gelen yanıtın önizlemesi */
.lc__peek { order: 2; display: grid; gap: 3px; max-width: 280px; padding: 12px 14px; border-radius: 16px 16px 4px 16px; background: var(--bg-2); border: 1px solid rgba(var(--accent-hi-rgb), .3); box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .9); cursor: pointer; text-align: left; }
.lc__peek b { font-size: 12.5px; color: var(--accent-hi); }
.lc__peek span { font-size: 13.5px; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lc__peek.is-in { animation: lc-peek .55s var(--ease-spring); }
.lc.is-open .lc__peek { display: none; }

/* ---------- panel ---------- */
.lc__panel {
  order: 1;
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  width: 380px;
  /* düğme (56) + aralık (12) + üst boşluk (18) */
  height: min(620px, calc(100vh - var(--lc-b) - 86px));
  height: min(620px, calc(100dvh - var(--lc-b) - 86px));
  border-radius: 22px;
  background: var(--bg-1);
  border: 1px solid var(--line-strong);
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .95), 0 0 0 1px rgba(var(--accent-rgb), .08);
  overflow: hidden;
  transform-origin: 100% 100%;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(.94);
  transition: opacity .25s var(--ease), transform .45s var(--ease-spring), visibility .45s;
}
.lc.is-open .lc__panel { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
/* kapalı panel çizilmesin; içindeki animasyonlar duraklatılmış doğsun (bkz. base.css "Animasyonlar
   yalnızca alanı görünürken çalışır") — atlanmış panelde takılı kalan animasyon sayfayı yoruyordu */
.lc:not(.is-open) .lc__panel { content-visibility: hidden; }
.lc:not(.is-open) .lc__panel *, .lc:not(.is-open) .lc__panel *::before, .lc:not(.is-open) .lc__panel *::after { animation-play-state: paused !important; }

.lc__head { position: relative; display: flex; align-items: center; gap: 12px; flex-shrink: 0; padding: 16px 12px 16px 16px; background: radial-gradient(120% 140% at 0% 0%, rgba(var(--accent-rgb), .5), transparent 60%), radial-gradient(90% 120% at 100% 0%, rgba(var(--cyan-rgb), .25), transparent 60%), linear-gradient(160deg, #0b1a44, #070d1d); border-bottom: 1px solid var(--line); overflow: hidden; }
.lc__glow { position: absolute; z-index: -1; top: -40%; left: -60%; width: 50%; height: 180%; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .08), transparent); rotate: 20deg; animation: auth-beam 7s ease-in-out infinite; }
.lc__agents { display: flex; flex-shrink: 0; }
.lc__avatar { display: grid; place-items: center; width: 40px; height: 40px; margin-left: calc(var(--i, 0) * -12px); border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--cyan)); color: #fff; font: 800 14px var(--font-display); box-shadow: 0 0 0 3px #0a1532; animation: lc-pop .5s var(--ease-spring) backwards; animation-delay: calc(var(--i, 0) * 80ms); }
.lc__avatar:first-child { margin-left: 0; }
.lc__avatar--brand { background: linear-gradient(135deg, #1a5cff, #22b8ee); }
.lc__avatar--brand .ico { width: 21px; height: 21px; }
.lc__title { display: grid; flex: 1; min-width: 0; }
.lc__title b { font: 700 16px var(--font-display); }
.lc__title small { display: flex; align-items: center; gap: 6px; font-size: 12px; color: rgba(255, 255, 255, .72); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lc__dot { flex-shrink: 0; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 3px rgba(245, 196, 81, .2); }
.lc__dot.is-on { background: var(--green-hi); box-shadow: 0 0 0 3px rgba(74, 222, 128, .22); animation: blink 2s ease-in-out infinite; }
.lc__head .icon-btn { flex-shrink: 0; width: 36px; height: 36px; color: rgba(255, 255, 255, .8); }
.lc__head .icon-btn:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.lc__head .icon-btn[hidden] { display: none; }

.lc__body { position: relative; flex: 1; min-height: 0; padding: 16px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }

/* ---------- başlangıç ---------- */
.lc-start { display: grid; gap: 16px; }
.lc-hero { display: grid; justify-items: start; gap: 6px; }
.lc-hero__ico { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 4px; border-radius: 14px; background: rgba(var(--accent-rgb), .16); color: var(--accent-hi); animation: float-y 4s ease-in-out infinite; }
.lc-hero__ico .ico { width: 22px; height: 22px; }
.lc-hero h4 { font-size: 21px; }
.lc-hero p { font-size: 13.5px; color: var(--text-dim); }

.lc-form { display: grid; gap: 12px; }
.lc-topics { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; border: 0; }
.lc-topics legend { width: 100%; margin-bottom: 6px; font-size: 12.5px; font-weight: 700; color: var(--text-dim); }
.lc-topic input { position: absolute; opacity: 0; pointer-events: none; }
.lc-topic span { display: inline-flex; align-items: center; height: 32px; padding: 0 12px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line-strong); font-size: 12.5px; font-weight: 700; color: var(--text-dim); cursor: pointer; transition: background-color .2s, color .2s, border-color .2s, transform .25s var(--ease-spring); }
.lc-topic span:hover { color: var(--text); transform: translateY(-1px); }
.lc-topic input:checked + span { background: var(--accent-soft); border-color: rgba(var(--accent-hi-rgb), .5); color: var(--text); }
.lc-topic input:focus-visible + span { outline: 2px solid var(--accent-hi); outline-offset: 2px; }
.lc-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lc-field { display: grid; gap: 5px; }
.lc-field > span { font-size: 12.5px; font-weight: 700; color: var(--text-dim); }
.lc-field small { font-weight: 500; color: var(--text-mute); }
.lc-field input, .lc-field textarea { width: 100%; padding: 11px 13px; border-radius: 12px; background: var(--bg-0); border: 1px solid var(--line-strong); color: var(--text); font: 500 14px var(--font); resize: none; transition: border-color .2s, box-shadow .2s; }
.lc-field input:focus, .lc-field textarea:focus { outline: 0; border-color: rgba(var(--accent-rgb), .7); box-shadow: 0 0 0 4px rgba(var(--accent-rgb), .14); }
.lc-field em { font-style: normal; font-size: 12px; color: var(--red); }
.lc-field em:empty { display: none; }
.lc-quick { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.lc-quick a { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--text-dim); transition: color .2s; }
.lc-quick a:hover { color: var(--accent-hi); }
.lc-quick .ico { width: 15px; height: 15px; }

/* ---------- mesajlar ---------- */
.lc-thread { display: grid; gap: 8px; }
.lc-day { display: flex; justify-content: center; margin: 6px 0 2px; }
.lc-day span { padding: 3px 10px; border-radius: 10px; background: var(--bg-2); font-size: 11px; font-weight: 700; color: var(--text-mute); }
.lc-sys { justify-self: center; max-width: 90%; padding: 6px 12px; border-radius: 10px; background: rgba(var(--accent-rgb), .08); border: 1px dashed rgba(var(--accent-hi-rgb), .25); font-size: 12px; text-align: center; color: var(--text-dim); }

.lc-msg { display: flex; align-items: flex-end; gap: 8px; max-width: 86%; }
.lc-msg--me { justify-self: end; flex-direction: row-reverse; }
.lc-msg__av { display: grid; place-items: center; flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--cyan)); color: #fff; font: 800 12px var(--font-display); }
.lc-msg__bubble { display: grid; gap: 4px; min-width: 64px; padding: 9px 12px 6px; border-radius: 16px 16px 16px 5px; background: var(--bg-2); border: 1px solid var(--line-strong); font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.lc-msg--me .lc-msg__bubble { border-radius: 16px 16px 5px 16px; background: linear-gradient(135deg, rgba(var(--accent-rgb), .95), rgba(var(--accent-rgb), .75)); border-color: transparent; color: #fff; }
.lc-msg__bubble p { white-space: pre-wrap; }
.lc-msg__bubble a { color: inherit; text-decoration: underline; }
.lc-msg__name { font-size: 11.5px; color: var(--accent-hi); }
.lc-msg time { display: inline-flex; align-items: center; justify-self: end; gap: 3px; font-size: 10.5px; color: var(--text-mute); font-variant-numeric: tabular-nums; }
.lc-msg--me time { color: rgba(255, 255, 255, .7); }
.lc-tick .ico { width: 14px; height: 14px; stroke-width: 2.4; }
.lc-tick.is-pending .ico { width: 11px; height: 11px; }
.lc-msg--me.is-read .lc-tick { color: #9be7ff; }
.lc-msg.is-failed .lc-msg__bubble { background: rgba(255, 77, 109, .2); border: 1px solid rgba(255, 77, 109, .5); }
.lc-img { display: block; margin: -3px -6px 2px; border-radius: 12px; overflow: hidden; background: var(--bg-0); }
.lc-img img { display: block; width: 100%; max-height: 220px; object-fit: cover; }

.lc-typing { display: inline-flex; gap: 4px; margin-top: 8px; padding: 12px 14px; border-radius: 16px 16px 16px 5px; background: var(--bg-2); border: 1px solid var(--line-strong); }
.lc-typing[hidden] { display: none; }
.lc-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--text-mute); animation: lc-dot 1.2s ease-in-out infinite; }
.lc-typing span:nth-child(2) { animation-delay: .15s; }
.lc-typing span:nth-child(3) { animation-delay: .3s; }

/* sohbet bitti: değerlendirme */
.lc-end { display: grid; justify-items: center; gap: 10px; margin-top: 16px; padding: 16px; border-radius: 16px; background: var(--bg-2); border: 1px solid var(--line-strong); text-align: center; }
.lc-end p { font-size: 13px; color: var(--text-dim); }
.lc-end textarea { width: 100%; padding: 10px 12px; border-radius: 12px; background: var(--bg-0); border: 1px solid var(--line-strong); color: var(--text); font: 500 13.5px var(--font); resize: none; }
.lc-stars { display: flex; gap: 6px; }
.lc-stars button, .lc-stars span { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; color: var(--bg-4); transition: color .2s, transform .3s var(--ease-spring); }
.lc-stars button:hover { transform: scale(1.12); }
.lc-stars .ico { width: 26px; height: 26px; }
.lc-stars .is-on { color: var(--gold); }
.lc-stars button.is-on { animation: lc-pop .4s var(--ease-spring); }

.lc-loading { display: flex; justify-content: center; gap: 6px; padding: 60px 0; }
.lc-loading span { width: 9px; height: 9px; border-radius: 50%; background: var(--accent-hi); animation: lc-dot 1s ease-in-out infinite; }
.lc-loading span:nth-child(2) { animation-delay: .12s; }
.lc-loading span:nth-child(3) { animation-delay: .24s; }
.lc-offline { display: grid; justify-items: center; gap: 6px; padding: 50px 10px; text-align: center; color: var(--text-dim); }
.lc-offline .ico { width: 28px; height: 28px; color: var(--accent-hi); }
.lc-offline .btn { margin-top: 10px; }

/* ---------- yazma alanı ---------- */
.lc__composer { position: relative; display: flex; align-items: flex-end; gap: 8px; flex-shrink: 0; padding: 10px 12px 12px; border-top: 1px solid var(--line); background: var(--bg-1); }
.lc__composer[hidden] { display: none; }
.lc__composer::before { content: ''; position: absolute; left: 0; top: -1px; height: 2px; width: 100%; background: var(--accent-hi); transform: scaleX(var(--up, 0)); transform-origin: left; opacity: 0; transition: transform .2s linear, opacity .2s; }
.lc__composer.is-uploading::before { opacity: 1; }
.lc__composer textarea { flex: 1; min-height: 44px; max-height: 120px; padding: 11px 14px; border-radius: 14px; background: var(--bg-0); border: 1px solid var(--line-strong); color: var(--text); font: 500 14px/1.45 var(--font); resize: none; transition: border-color .2s, box-shadow .2s; }
.lc__composer textarea:focus { outline: 0; border-color: rgba(var(--accent-rgb), .7); box-shadow: 0 0 0 4px rgba(var(--accent-rgb), .14); }
.lc__tool { position: relative; display: grid; place-items: center; flex-shrink: 0; width: 44px; height: 44px; border-radius: 12px; color: var(--text-mute); cursor: pointer; transition: background-color .2s, color .2s; }
.lc__tool:hover { background: var(--bg-3); color: var(--text); }
.lc__tool:focus-within { outline: 2px solid var(--accent-hi); outline-offset: 2px; }
.lc__tool .ico { width: 20px; height: 20px; }
.lc__file { position: absolute; width: 1px; height: 1px; opacity: 0; }
.lc__sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.lc__send { display: grid; place-items: center; flex-shrink: 0; width: 44px; height: 44px; border-radius: 14px; background: var(--accent-grad); color: #fff; box-shadow: 0 8px 20px -8px rgba(var(--accent-rgb), .9); transition: transform .3s var(--ease-spring); }
.lc__send:hover { transform: translateY(-1px) rotate(-8deg); }
.lc__send:active { transform: scale(.92); }
.lc__send .ico { width: 19px; height: 19px; }

@keyframes lc-in { from { opacity: 0; transform: translateY(30px) scale(.8); } }
@keyframes lc-pop { from { opacity: 0; transform: scale(.4); } }
@keyframes lc-ring { 0% { opacity: .9; transform: scale(1); } 100% { opacity: 0; transform: scale(1.35, 1.6); } }
@keyframes lc-peek { from { opacity: 0; transform: translateY(12px) scale(.9); } }
@keyframes lc-dot { 0%, 60%, 100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-5px); opacity: 1; } }

/* ---------- gündüz teması ---------- */
:root[data-theme="light"] .lc__panel { background: #fff; }
:root[data-theme="light"] .lc__composer { background: #fff; }
:root[data-theme="light"] .lc-msg__bubble:not(.lc-msg--me .lc-msg__bubble),
:root[data-theme="light"] .lc-typing, :root[data-theme="light"] .lc-end, :root[data-theme="light"] .lc__peek { background: #f3f6fc; }

/* ---------- duyarlı ---------- */
@media (max-width: 1099.98px) {
  .lc__fab-text { display: none; }
  .lc__fab { padding: 0 8px; }
}
@media (max-width: 767.98px) {
  .lc, body[data-auth="0"]:has(.guest-bar.is-visible) .lc { --lc-b: calc(76px + env(safe-area-inset-bottom)); right: 14px; }
  /* açık alt paneller (giriş, cüzdan, kupon) düğmeyi örtmesin — o sırada destek cüzdanın
     başlığındaki düğmeden (.wlt__help) ve oyun çubuğundan açılır */
  .is-locked .lc:not(.is-open), .slip-open .lc:not(.is-open) { opacity: 0; pointer-events: none; }
  .lc__fab { height: 52px; }
  .lc__fab-ico { width: 36px; height: 36px; }
  .lc.is-open { inset: 0; gap: 0; }
  .lc.is-open .lc__fab, .lc.is-open .lc__peek { display: none; }
  .lc__panel { position: fixed; inset: 0; width: auto; height: auto; border-radius: 0; border: 0; transform-origin: 50% 100%; transform: translateY(40px); }
  .lc__head { padding-top: calc(14px + env(safe-area-inset-top)); }
  .lc__composer { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  .lc__composer textarea { font-size: 16px; }
  .lc-field input, .lc-field textarea { font-size: 16px; }
  .lc-row { grid-template-columns: 1fr; }
}

/* Yardım Merkezi'ndeki canlı destek kartı pencereyi açar */
.channel--live { cursor: pointer; }
