/* ════════════════════════════════════════════════════════════════
   GALAKSI-CHAT.CSS — Sir Arthur Rock · SAR GALAKSİ
   Veritabanı-güdümlü galaksi rehberi (Galaksi) sohbet penceresi.
   Palet ve gramer galaksi.css belirteçlerini birebir izler:
   derin uzay + altın enstrüman, ışık malzemedir, hareket yalnız
   transform/opacity. İdle-yaşam yalnız html.gfx-idle altında oynar;
   prefers-reduced-motion tüm ortam hareketini keser.
   Aşamalı zenginleştirme: JS yoksa hiçbir düğüm basılmaz.
   ════════════════════════════════════════════════════════════════ */

/* Belirteçler galaksi.css'ten miras (:root). Yerel yedekler: */
.gk-root{
  --gk-launch: 62px;
  --gk-panel-w: 384px;
  --gk-panel-h: min(640px, 82vh);
  --gk-radius: 18px;
  --gk-z-launch: 130;
  --gk-z-panel: 210;
  --gk-cam: rgba(14,12,8,.62);
  --gk-cam-kenar: rgba(232,180,92,.34);
}

/* ───────── kök kapsayıcı ───────── */
.gk-root{
  position: fixed;
  right: clamp(1rem, 3vw, 1.7rem);
  bottom: clamp(1rem, 3vw, 1.7rem);
  z-index: var(--gk-z-launch);
  font-family: var(--gov, 'Inter', system-ui, sans-serif);
  -webkit-font-smoothing: antialiased;
}

/* ═════════ FIRLATICI — küçük ışıltılı takımyıldız yörünge orbu ═════════ */
.gk-launch{
  position: relative;
  width: var(--gk-launch);
  height: var(--gk-launch);
  border: 0;
  padding: 0;
  border-radius: 50%;
  cursor: pointer;
  background:
    radial-gradient(circle at 50% 42%, rgba(232,180,92,.30), rgba(10,9,6,.9) 68%),
    #0E0C08;
  box-shadow:
    0 0 0 1px rgba(232,180,92,.5),
    0 6px 26px -6px rgba(0,0,0,.7),
    0 0 26px -4px rgba(232,180,92,.42);
  display: grid;
  place-items: center;
  transition: transform var(--sure-2, .26s) var(--ease, cubic-bezier(.19,.82,.22,1)),
              box-shadow var(--sure-2, .26s) var(--ease, cubic-bezier(.19,.82,.22,1));
  -webkit-tap-highlight-color: transparent;
}
.gk-launch:hover,
.gk-launch:focus-visible{
  transform: translateY(-2px) scale(1.05);
  box-shadow:
    0 0 0 1px rgba(255,233,176,.75),
    0 10px 32px -6px rgba(0,0,0,.75),
    0 0 34px -2px rgba(232,180,92,.6);
}
.gk-launch:focus-visible{ outline: 2px solid var(--sicak,#FFE9B0); outline-offset: 4px; }
.gk-launch svg{ width: 70%; height: 70%; display: block; overflow: visible; }
.gk-orbit{ transform-origin: 50% 50%; }
.gk-orbit-dot{ transform-box: fill-box; transform-origin: center; }
.gk-core{ transform-box: fill-box; transform-origin: center; }

/* firlatıcı idle yaşam — yalnız html.gfx-idle (reduced-motion kapalıyken açılır) */
.gfx-idle .gk-root .gk-ring-a{ animation: gkSpin 26s linear infinite; transform-origin: 50% 50%; }
.gfx-idle .gk-root .gk-ring-b{ animation: gkSpin 38s linear infinite reverse; transform-origin: 50% 50%; }
.gfx-idle .gk-root .gk-core{ animation: gkPulse 4.5s var(--ease, ease) infinite alternate; }
@keyframes gkSpin{ to{ transform: rotate(360deg); } }
@keyframes gkPulse{ from{ transform: scale(1); opacity:.82; } to{ transform: scale(1.12); opacity:1; } }

/* açılınca fırlatıcıyı gizle (klavye/odak korunur; panel kapayınca döner) */
.gk-root.gk-acik .gk-launch{ opacity: 0; transform: scale(.6); pointer-events: none; }

/* küçük bildirim noktası (ilk açılışta karşılama beklerken) */
.gk-badge{
  position: absolute; top: 2px; right: 2px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--sicak,#FFE9B0);
  box-shadow: 0 0 0 2px #0A0906, 0 0 10px rgba(255,233,176,.8);
}
.gk-badge[hidden]{ display: none; }

/* ═════════ PANEL ═════════ */
.gk-panel{
  position: absolute;
  right: 0;
  bottom: 0;
  width: var(--gk-panel-w);
  max-width: calc(100vw - 2rem);
  height: var(--gk-panel-h);
  display: flex;
  flex-direction: column;
  border-radius: var(--gk-radius);
  overflow: hidden;
  background: linear-gradient(180deg, #12100A, #0A0906 62%);
  border: 1px solid var(--gk-cam-kenar);
  box-shadow:
    0 0 0 1px rgba(10,9,6,.6),
    0 24px 70px -18px rgba(0,0,0,.85),
    0 0 46px -18px rgba(232,180,92,.35);
  /* açılış: ölçek + belirme; köşeden doğar */
  transform-origin: bottom right;
  opacity: 0;
  transform: translateY(10px) scale(.94);
  pointer-events: none;
  transition:
    opacity var(--sure-2, .26s) var(--ease, cubic-bezier(.19,.82,.22,1)),
    transform var(--sure-3, .34s) var(--ease, cubic-bezier(.19,.82,.22,1));
}
.gk-root.gk-acik .gk-panel{
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.gk-panel[hidden]{ display: none; }

/* faint sürüklenen yıldız alanı (idle) */
.gk-star{
  position: absolute; inset: 0;
  pointer-events: none;
  opacity: .5;
  background-image:
    radial-gradient(1.2px 1.2px at 20% 30%, rgba(242,236,220,.55), transparent),
    radial-gradient(1px 1px at 68% 18%, rgba(232,180,92,.5), transparent),
    radial-gradient(1.4px 1.4px at 82% 62%, rgba(242,236,220,.4), transparent),
    radial-gradient(1px 1px at 34% 78%, rgba(232,180,92,.42), transparent),
    radial-gradient(1.1px 1.1px at 52% 48%, rgba(242,236,220,.35), transparent);
  background-repeat: no-repeat;
}
.gfx-idle .gk-panel .gk-star{ animation: gkDrift 120s linear infinite alternate; }
@keyframes gkDrift{ from{ transform: translate3d(-6px,4px,0); } to{ transform: translate3d(6px,-4px,0); } }

/* ── başlık ── */
.gk-head{
  position: relative;
  flex: none;
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--cizgi, rgba(184,134,47,.26));
  background: linear-gradient(180deg, rgba(232,180,92,.08), transparent);
}
.gk-avatar{ flex: none; width: 34px; height: 34px; display: block; overflow: visible; }
.gk-avatar .gk-av-dot{ transform-box: fill-box; transform-origin: center; }
.gfx-idle .gk-panel .gk-av-orbit{ animation: gkSpin 8s linear infinite; transform-origin: 50% 50%; }
.gk-head-txt{ display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.gk-title{
  font-family: var(--caps, 'Sora', sans-serif);
  font-weight: 600; font-size: .96rem; color: var(--fil,#F2ECDC);
  letter-spacing: .01em; display: flex; align-items: center; gap: .4rem;
}
.gk-title i{ color: var(--altin,#E8B45C); font-style: normal; }
.gk-sub{ font-size: .7rem; letter-spacing: .22em; text-transform: uppercase; color: var(--altin,#E8B45C); }
.gk-head-tools{ margin-left: auto; display: flex; gap: .25rem; }
.gk-icon-btn{
  width: 32px; height: 32px; border: 0; border-radius: 9px; cursor: pointer;
  background: transparent; color: var(--fil2,rgba(242,236,220,.74));
  display: grid; place-items: center;
  transition: background var(--sure-1,.16s) ease, color var(--sure-1,.16s) ease, transform var(--sure-1,.16s) ease;
}
.gk-icon-btn:hover{ background: rgba(232,180,92,.14); color: var(--sicak,#FFE9B0); }
.gk-icon-btn:focus-visible{ outline: 2px solid var(--sicak,#FFE9B0); outline-offset: 2px; }
.gk-icon-btn svg{ width: 17px; height: 17px; }

/* ── mesaj listesi ── */
.gk-log{
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1rem .95rem .5rem;
  display: flex;
  flex-direction: column;
  gap: .7rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(184,134,47,.4) transparent;
  overscroll-behavior: contain;
}
.gk-log::-webkit-scrollbar{ width: 8px; }
.gk-log::-webkit-scrollbar-thumb{ background: rgba(184,134,47,.35); border-radius: 8px; }

.gk-msg{ display: flex; max-width: 100%; }
.gk-msg-in{ animation: gkRise var(--sure-3,.34s) var(--ease,ease) both; }
@keyframes gkRise{ from{ opacity: 0; transform: translateY(8px); } to{ opacity: 1; transform: none; } }

.gk-bubble{
  max-width: 84%;
  padding: .62rem .8rem;
  border-radius: 14px;
  font-size: .9rem;
  line-height: 1.55;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}
/* bot balonu — altın kenarlı koyu cam */
.gk-msg.bot{ justify-content: flex-start; }
.gk-msg.bot .gk-bubble{
  background: linear-gradient(180deg, rgba(232,180,92,.08), rgba(14,12,8,.5));
  border: 1px solid var(--gk-cam-kenar);
  border-bottom-left-radius: 5px;
  color: var(--fil,#F2ECDC);
}
.gk-msg.bot .gk-bubble b,
.gk-msg.bot .gk-bubble strong{ color: var(--sicak,#FFE9B0); font-weight: 600; }
.gk-msg.bot .gk-bubble a{
  color: var(--altin,#E8B45C);
  text-decoration: none;
  border-bottom: 1px solid rgba(232,180,92,.45);
  transition: color var(--sure-1,.16s) ease, border-color var(--sure-1,.16s) ease;
}
.gk-msg.bot .gk-bubble a:hover{ color: var(--sicak,#FFE9B0); border-bottom-color: var(--sicak,#FFE9B0); }

/* kullanıcı balonu — som altın mürekkep */
.gk-msg.user{ justify-content: flex-end; }
.gk-msg.user .gk-bubble{
  background: linear-gradient(180deg, var(--sicak,#FFE9B0), var(--altin,#E8B45C));
  color: var(--murekkep,#171204);
  border-bottom-right-radius: 5px;
  font-weight: 500;
}

/* ── yazıyor göstergesi ── */
.gk-typing{ display: inline-flex; gap: 5px; align-items: center; padding: .7rem .85rem; }
.gk-typing span{
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--altin,#E8B45C);
  opacity: .4;
}
.gk-typing span:nth-child(1){ animation: gkBlink 1.1s ease-in-out infinite; }
.gk-typing span:nth-child(2){ animation: gkBlink 1.1s ease-in-out .2s infinite; }
.gk-typing span:nth-child(3){ animation: gkBlink 1.1s ease-in-out .4s infinite; }
@keyframes gkBlink{ 0%,100%{ opacity:.3; transform: translateY(0); } 50%{ opacity:1; transform: translateY(-3px); } }

/* ── hızlı yanıt çipleri + CTA ── */
.gk-chips{ display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .1rem; padding: 0 .1rem; }
.gk-chip{
  font-family: var(--caps,'Sora',sans-serif);
  font-size: .74rem;
  letter-spacing: .01em;
  color: var(--fil,#F2ECDC);
  background: rgba(232,180,92,.07);
  border: 1px solid var(--cizgi2, rgba(232,180,92,.5));
  border-radius: 999px;
  padding: .38rem .7rem;
  cursor: pointer;
  transition: background var(--sure-1,.16s) ease, color var(--sure-1,.16s) ease,
              border-color var(--sure-1,.16s) ease, transform var(--sure-1,.16s) ease;
}
.gk-chip:hover{ background: rgba(232,180,92,.18); color: var(--sicak,#FFE9B0); transform: translateY(-1px); }
.gk-chip:focus-visible{ outline: 2px solid var(--sicak,#FFE9B0); outline-offset: 2px; }

.gk-cta{
  display: inline-flex; align-items: center; gap: .45rem;
  margin-top: .15rem;
  font-family: var(--caps,'Sora',sans-serif);
  font-size: .78rem; font-weight: 600;
  color: var(--murekkep,#171204);
  background: linear-gradient(180deg, var(--sicak,#FFE9B0), var(--altin,#E8B45C));
  border: 0; border-radius: 999px;
  padding: .48rem .9rem;
  cursor: pointer; text-decoration: none;
  box-shadow: 0 0 18px -6px rgba(232,180,92,.6);
  transition: transform var(--sure-1,.16s) ease, box-shadow var(--sure-1,.16s) ease;
}
.gk-cta:hover{ transform: translateY(-1px); color: var(--murekkep,#171204); box-shadow: 0 0 26px -4px rgba(232,180,92,.8); }
.gk-cta:focus-visible{ outline: 2px solid var(--sicak,#FFE9B0); outline-offset: 3px; }
.gk-cta svg{ width: 13px; height: 13px; }

/* mesaja bağlı çip/cta grubu bot balonunun altında hizalı */
.gk-actions{ display: flex; flex-direction: column; gap: .45rem; align-items: flex-start; margin-top: -.2rem; }

/* ── giriş satırı ── */
.gk-form{
  flex: none;
  display: flex;
  gap: .5rem;
  align-items: flex-end;
  padding: .7rem .8rem calc(.7rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--cizgi, rgba(184,134,47,.26));
  background: linear-gradient(0deg, rgba(232,180,92,.05), transparent);
}
.gk-input{
  flex: 1 1 auto;
  resize: none;
  max-height: 96px;
  min-height: 22px;
  border: 1px solid var(--cizgi2, rgba(232,180,92,.5));
  border-radius: 12px;
  background: rgba(10,9,6,.6);
  color: var(--fil,#F2ECDC);
  font: 400 .9rem/1.45 var(--gov,'Inter',sans-serif);
  padding: .55rem .7rem;
  outline: none;
  transition: border-color var(--sure-1,.16s) ease, box-shadow var(--sure-1,.16s) ease;
}
.gk-input::placeholder{ color: rgba(242,236,220,.42); }
.gk-input:focus{ border-color: var(--sicak,#FFE9B0); box-shadow: 0 0 0 3px rgba(232,180,92,.14); }
.gk-send{
  flex: none;
  width: 40px; height: 40px;
  border: 0; border-radius: 11px; cursor: pointer;
  background: linear-gradient(180deg, var(--sicak,#FFE9B0), var(--altin,#E8B45C));
  color: var(--murekkep,#171204);
  display: grid; place-items: center;
  box-shadow: 0 0 20px -6px rgba(232,180,92,.6);
  transition: transform var(--sure-1,.16s) ease, box-shadow var(--sure-1,.16s) ease, opacity var(--sure-1,.16s) ease;
}
.gk-send:hover{ transform: translateY(-1px); box-shadow: 0 0 28px -4px rgba(232,180,92,.85); }
.gk-send:focus-visible{ outline: 2px solid var(--sicak,#FFE9B0); outline-offset: 3px; }
.gk-send svg{ width: 18px; height: 18px; }

/* ── mobil: alt sayfa ── */
@media (max-width: 480px){
  .gk-root{ right: 0; bottom: 0; left: 0; }
  .gk-launch{ position: fixed; right: clamp(1rem,4vw,1.4rem); bottom: clamp(1rem,4vw,1.4rem); }
  .gk-panel{
    position: fixed;
    inset: 0;
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    border-left: 0; border-right: 0; border-bottom: 0;
    transform-origin: bottom center;
  }
}

/* ── GFX şalteri kapalıysa (galaksiChat off) ortam hareketi durur ── */
.gk-still .gk-ring-a,
.gk-still .gk-ring-b,
.gk-still .gk-core,
.gk-still .gk-av-orbit,
.gk-still .gk-star{ animation: none !important; }

/* ── hareketi azalt: ortam hareketi yok, anlık durumlar ── */
@media (prefers-reduced-motion: reduce){
  .gk-launch,
  .gk-panel,
  .gk-chip,
  .gk-cta,
  .gk-send,
  .gk-icon-btn{ transition: none; }
  .gk-msg-in{ animation: none; }
  .gk-typing span{ animation: none; opacity: .7; }
  .gk-root.gk-acik .gk-panel{ transform: none; }
  .gk-panel{ transform: none; }
}

/* ═══════════ KARŞILAMA: firlatıcı parıltısı + selam teaser'ı ═══════════ */
@keyframes gkShine{
  0%,100%{ box-shadow:0 0 0 1px rgba(232,180,92,.5),0 6px 26px -6px rgba(0,0,0,.7),0 0 22px -4px rgba(255,233,176,.42); }
  50%{ box-shadow:0 0 0 1px rgba(255,233,176,.9),0 6px 26px -6px rgba(0,0,0,.7),0 0 36px 2px rgba(255,233,176,.75); }
}
@keyframes gkShineRing{
  0%{ transform:scale(.92); opacity:.7; }
  70%,100%{ transform:scale(1.5); opacity:0; }
}
.gk-launch.gk-shine{ animation:gkShine 2.1s var(--ease,ease-in-out) infinite; }
.gk-launch.gk-shine::after{
  content:""; position:absolute; inset:-6px; border-radius:50%;
  border:1px solid rgba(255,233,176,.55); opacity:0; pointer-events:none;
  animation:gkShineRing 2.1s var(--ease,ease-out) infinite;
}

.gk-teaser{
  position:absolute; right:0; bottom:calc(var(--gk-launch) + 14px); z-index:140;
  display:flex; align-items:flex-end; gap:6px; width:min(19.5rem,76vw);
  opacity:0; transform:translateY(10px) scale(.96);
  transition:opacity var(--sure-2,.3s) var(--ease,ease), transform var(--sure-2,.3s) var(--ease,ease);
}
.gk-teaser[hidden]{ display:none; }
.gk-teaser.gk-teaser-acik{ opacity:1; transform:none; }
.gk-root.gk-acik .gk-teaser{ display:none; }
.gk-teaser-ac{
  display:flex; align-items:center; gap:.6rem; text-align:left; cursor:pointer;
  border:1px solid var(--gk-cam-kenar,rgba(232,180,92,.34));
  background:linear-gradient(180deg,rgba(20,17,11,.95),rgba(12,10,7,.97));
  color:#F2ECDC; border-radius:14px 14px 4px 14px; padding:.7rem .85rem;
  box-shadow:0 12px 30px -10px rgba(0,0,0,.72),0 0 20px -6px rgba(232,180,92,.32);
  -webkit-backdrop-filter:blur(6px); backdrop-filter:blur(6px);
  transition:transform var(--sure-2,.26s) var(--ease,ease), box-shadow var(--sure-2,.26s) var(--ease,ease);
}
.gk-teaser-ac:hover,.gk-teaser-ac:focus-visible{ transform:translateY(-2px); box-shadow:0 16px 34px -10px rgba(0,0,0,.78),0 0 26px -4px rgba(232,180,92,.5); outline:none; }
.gk-teaser-ac:focus-visible{ outline:2px solid var(--sicak,#FFE9B0); outline-offset:3px; }
.gk-teaser-av{ flex:0 0 auto; width:30px; height:30px; }
.gk-teaser-av svg{ width:100%; height:100%; display:block; overflow:visible; }
.gk-teaser-txt{ font:400 .82rem/1.36 'Inter',system-ui,-apple-system,'Segoe UI',sans-serif; }
.gk-teaser-txt b{ display:block; font-weight:600; color:var(--sicak,#FFE9B0); letter-spacing:.01em; margin-bottom:2px; }
.gk-teaser-x{
  flex:0 0 auto; width:22px; height:22px; margin-bottom:2px; padding:0; cursor:pointer;
  border:1px solid var(--gk-cam-kenar,rgba(232,180,92,.28)); border-radius:50%;
  background:rgba(12,10,7,.9); color:#9a917f; display:grid; place-items:center;
}
.gk-teaser-x svg{ width:12px; height:12px; }
.gk-teaser-x:hover,.gk-teaser-x:focus-visible{ color:var(--sicak,#FFE9B0); border-color:var(--sicak,#FFE9B0); outline:none; }

@media (max-width: 480px){
  .gk-teaser{
    right:clamp(1rem,4vw,1.4rem); left:clamp(1rem,4vw,1.4rem);
    bottom:calc(clamp(1rem,4vw,1.4rem) + var(--gk-launch) + 12px); width:auto; max-width:none;
  }
  .gk-teaser-ac{ flex:1; }
}

/* devingenlik kapalıysa: parıltı sabit kalsın (yine de "ışıldar"), balon anında gelsin */
.gk-still .gk-launch.gk-shine,
.gk-still .gk-launch.gk-shine::after{ animation:none; }
@media (prefers-reduced-motion: reduce){
  .gk-launch.gk-shine{ animation:none; box-shadow:0 0 0 1px rgba(255,233,176,.9),0 6px 26px -6px rgba(0,0,0,.7),0 0 30px 0 rgba(255,233,176,.62); }
  .gk-launch.gk-shine::after{ animation:none; opacity:.5; }
  .gk-teaser{ transition:none; }
}
