/* Reyhan Esans - AI Sohbet Widget — premium amber tema (site paletine uyumlu) */
:root{--rs-amber:#E4C76B;--rs-amber-2:#B8924A;--rs-ink:#15110b;--rs-ink-2:#1A1408}

/* ── Sohbet balonu: koyu zemin + altın halka + nabız + online noktası ── */
#rs-chat-btn{position:fixed;right:22px;bottom:22px;width:62px;height:62px;border-radius:50%;
  background:radial-gradient(circle at 32% 28%, #2a2114 0%, var(--rs-ink-2) 55%, #0c0a06 100%);
  color:var(--rs-amber);border:1.5px solid rgba(228,199,107,.55);cursor:pointer;z-index:9998;
  display:flex;align-items:center;justify-content:center;
  box-shadow:0 8px 28px rgba(0,0,0,.45), inset 0 1px 1px rgba(255,255,255,.08);
  transition:transform .25s cubic-bezier(.34,1.56,.64,1), box-shadow .3s, border-color .3s;
  animation:rs-pulse 2.8s ease-out infinite}
#rs-chat-btn svg{width:28px;height:28px}
#rs-chat-btn:hover{transform:scale(1.1) rotate(-4deg);border-color:var(--rs-amber);
  box-shadow:0 12px 36px rgba(0,0,0,.5), 0 0 22px rgba(228,199,107,.4), inset 0 1px 1px rgba(255,255,255,.12)}
#rs-chat-btn.acik{animation:none}
@keyframes rs-pulse{
  0%{box-shadow:0 8px 28px rgba(0,0,0,.45), 0 0 0 0 rgba(228,199,107,.5), inset 0 1px 1px rgba(255,255,255,.08)}
  70%{box-shadow:0 8px 28px rgba(0,0,0,.45), 0 0 0 14px rgba(228,199,107,0), inset 0 1px 1px rgba(255,255,255,.08)}
  100%{box-shadow:0 8px 28px rgba(0,0,0,.45), 0 0 0 0 rgba(228,199,107,0), inset 0 1px 1px rgba(255,255,255,.08)}}
/* "online" noktası */
#rs-chat-btn::after{content:"";position:absolute;top:6px;right:6px;width:12px;height:12px;border-radius:50%;
  background:#3ddc84;border:2px solid var(--rs-ink-2);box-shadow:0 0 6px rgba(61,220,132,.7)}

/* ── Panel ── */
#rs-chat-panel{position:fixed;right:22px;bottom:96px;width:350px;max-width:calc(100vw - 36px);
  height:500px;max-height:calc(100vh - 130px);background:#fffdf8;color:var(--rs-ink);
  border:1px solid rgba(184,146,74,.25);border-radius:20px;
  box-shadow:0 18px 60px rgba(0,0,0,.4);display:none;flex-direction:column;overflow:hidden;z-index:9999;
  transform-origin:bottom right;animation:rs-acil .28s cubic-bezier(.34,1.4,.64,1)}
#rs-chat-panel.acik{display:flex}
@keyframes rs-acil{from{opacity:0;transform:translateY(14px) scale(.94)}to{opacity:1;transform:none}}

/* Başlık — altın gradyan */
#rs-chat-head{background:linear-gradient(135deg, var(--rs-ink-2) 0%, #2a2012 100%);
  color:var(--rs-amber);padding:15px 18px;display:flex;justify-content:space-between;align-items:center;
  border-bottom:1px solid rgba(228,199,107,.25)}
#rs-chat-head .rs-head-sol{display:flex;align-items:center;gap:10px}
#rs-chat-head .rs-avatar{width:34px;height:34px;border-radius:50%;flex:0 0 auto;
  background:radial-gradient(circle at 35% 30%, #3a2e18, #1a1408);border:1px solid rgba(228,199,107,.5);
  display:flex;align-items:center;justify-content:center}
#rs-chat-head .rs-avatar svg{width:18px;height:18px}
#rs-chat-head .rs-baslik{font-weight:700;font-size:15px;line-height:1.1}
#rs-chat-head .rs-alt{font-size:11px;color:#9c8a5e;font-weight:500;display:flex;align-items:center;gap:5px}
#rs-chat-head .rs-alt::before{content:"";width:7px;height:7px;border-radius:50%;background:#3ddc84;box-shadow:0 0 5px #3ddc84}
#rs-chat-head .kapat{cursor:pointer;font-size:22px;line-height:1;color:var(--rs-amber);opacity:.75;transition:opacity .2s}
#rs-chat-head .kapat:hover{opacity:1}

/* Mesaj alanı */
#rs-chat-msgs{flex:1;overflow-y:auto;padding:16px;display:flex;flex-direction:column;gap:11px;
  background:linear-gradient(180deg,#fffdf8 0%,#faf5ea 100%)}
#rs-chat-msgs::-webkit-scrollbar{width:6px}
#rs-chat-msgs::-webkit-scrollbar-thumb{background:rgba(184,146,74,.35);border-radius:3px}
.rs-msg{max-width:82%;padding:11px 14px;border-radius:16px;font-size:14px;line-height:1.5;white-space:pre-wrap;
  animation:rs-msg-in .25s ease}
@keyframes rs-msg-in{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
.rs-msg.user{align-self:flex-end;background:linear-gradient(135deg,var(--rs-ink-2),#2a2012);color:#f3ece0;
  border-bottom-right-radius:5px}
.rs-msg.bot{align-self:flex-start;background:#fff;color:var(--rs-ink);border:1px solid rgba(184,146,74,.2);
  border-bottom-left-radius:5px;box-shadow:0 1px 4px rgba(184,146,74,.08)}
.rs-msg.yaziyor{opacity:.65;font-style:italic;color:var(--rs-amber-2)}

/* Sohbette koku/ürün eşleşince çıkan "Sepete ekle" kartı */
.rs-sepet-kart{align-self:flex-start;max-width:88%;display:flex;align-items:center;gap:10px;
  margin:2px 0 2px;padding:11px 13px;border-radius:14px;text-decoration:none;
  background:linear-gradient(135deg,#3a2c12,#241a0c);border:1px solid rgba(228,199,107,.45);
  color:#f6e6c8;box-shadow:0 4px 16px rgba(0,0,0,.28);transition:transform .18s,box-shadow .18s;
  animation:rs-msg-in .28s ease}
.rs-sepet-kart:hover{transform:translateY(-2px);box-shadow:0 8px 22px rgba(228,199,107,.28);
  border-color:rgba(228,199,107,.8)}
.rs-sepet-ikon{font-size:22px;line-height:1}
.rs-sepet-yazi{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}
.rs-sepet-yazi b{font-size:14px;color:#ffe9a8}
.rs-sepet-yazi small{font-size:11.5px;color:#cbb588;opacity:.85}
.rs-sepet-ok{font-size:22px;color:#e4c76b;font-weight:700}

/* WhatsApp butonu */
#rs-chat-wa{display:none;margin:0 16px 12px;padding:12px;background:#25d366;color:#fff;text-align:center;
  border-radius:13px;text-decoration:none;font-weight:600;font-size:14px;
  box-shadow:0 4px 14px rgba(37,211,102,.35);transition:transform .2s}
#rs-chat-wa:hover{transform:translateY(-1px)}
#rs-chat-wa.gor{display:block}

/* Giriş formu */
#rs-chat-form{display:flex;border-top:1px solid rgba(184,146,74,.2);padding:11px;gap:8px;background:#fffdf8}
#rs-chat-input{flex:1;border:1px solid rgba(184,146,74,.35);border-radius:22px;padding:10px 16px;font-size:14px;
  outline:none;background:#fff;transition:border-color .2s}
#rs-chat-input:focus{border-color:var(--rs-amber)}
#rs-chat-send{background:linear-gradient(135deg,var(--rs-amber),var(--rs-amber-2));color:var(--rs-ink);border:none;
  border-radius:50%;width:40px;height:40px;cursor:pointer;font-size:17px;flex:0 0 auto;
  display:flex;align-items:center;justify-content:center;transition:transform .2s}
#rs-chat-send:hover{transform:scale(1.08)}

/* ── Gece modu ── */
@media (prefers-color-scheme: dark){
  #rs-chat-panel{background:var(--rs-ink-2);color:#f2efe6;border-color:rgba(228,199,107,.2)}
  #rs-chat-msgs{background:linear-gradient(180deg,#1a1408 0%,#12100a 100%)}
  .rs-msg.bot{background:#241d10;color:#f2efe6;border-color:rgba(228,199,107,.18)}
  #rs-chat-form{background:var(--rs-ink-2);border-color:rgba(228,199,107,.18)}
  #rs-chat-input{background:#241d10;color:#f2efe6;border-color:rgba(228,199,107,.3)}
}
body.gece #rs-chat-panel{background:var(--rs-ink-2);color:#f2efe6;border-color:rgba(228,199,107,.2)}
body.gece #rs-chat-msgs{background:linear-gradient(180deg,#1a1408 0%,#12100a 100%)}
body.gece .rs-msg.bot{background:#241d10;color:#f2efe6;border-color:rgba(228,199,107,.18)}
body.gece #rs-chat-form{background:var(--rs-ink-2);border-color:rgba(228,199,107,.18)}
body.gece #rs-chat-input{background:#241d10;color:#f2efe6;border-color:rgba(228,199,107,.3)}


/* ── SAYFA TEMASI ÖNCELİKLİ: sayfa açık temadaysa panel de açık (OS tercihini ezer) ── */
html[data-theme="light"] #rs-chat-panel, html.gunduz #rs-chat-panel{background:#fffdf8;color:var(--rs-ink);border-color:rgba(184,146,74,.25)}
html[data-theme="light"] #rs-chat-msgs, html.gunduz #rs-chat-msgs{background:linear-gradient(180deg,#fffdf8 0%,#faf5ea 100%)}
html[data-theme="light"] .rs-msg.bot, html.gunduz .rs-msg.bot{background:#fff;color:var(--rs-ink);border-color:rgba(184,146,74,.2)}
html[data-theme="light"] #rs-chat-form, html.gunduz #rs-chat-form{background:#fffdf8;border-color:rgba(184,146,74,.2)}
html[data-theme="light"] #rs-chat-input, html.gunduz #rs-chat-input{background:#fff;color:var(--rs-ink);border-color:rgba(184,146,74,.35)}
html[data-theme="light"] #rs-chat-head, html.gunduz #rs-chat-head{background:linear-gradient(135deg,#f3ead6,#eaddc0);color:#7a5a17;border-bottom-color:rgba(169,126,31,.3)}
html[data-theme="light"] #rs-chat-head .kapat, html.gunduz #rs-chat-head .kapat{color:#7a5a17}
html[data-theme="light"] #rs-chat-head .rs-alt, html.gunduz #rs-chat-head .rs-alt{color:#8a6a2e}
html[data-theme="light"] #rs-chat-btn, html.gunduz #rs-chat-btn{background:radial-gradient(circle at 32% 28%,#fffdf8 0%,#f3ead6 60%,#e6d5ae 100%);color:#a9761f;border-color:rgba(169,126,31,.5);box-shadow:0 8px 24px rgba(0,0,0,.18)}
html[data-theme="light"] #rs-chat-btn::after, html.gunduz #rs-chat-btn::after{border-color:#f3ead6}
/* koyu sayfalarda (varsayılan gece siteleri) panel koyu kalsın */
html[data-theme="dark"] #rs-chat-panel{background:var(--rs-ink-2);color:#f2efe6;border-color:rgba(228,199,107,.2)}
html[data-theme="dark"] #rs-chat-msgs{background:linear-gradient(180deg,#1a1408 0%,#12100a 100%)}
html[data-theme="dark"] .rs-msg.bot{background:#241d10;color:#f2efe6;border-color:rgba(228,199,107,.18)}
html[data-theme="dark"] #rs-chat-form{background:var(--rs-ink-2);border-color:rgba(228,199,107,.18)}
html[data-theme="dark"] #rs-chat-input{background:#241d10;color:#f2efe6;border-color:rgba(228,199,107,.3)}
