/* MOVA Mobot /ask — ChatGPT-style minimal shell */
.mobot-page {
  --mobot-bg: #050b16;
  --mobot-ink: #f4f7fb;
  --mobot-muted: #8b97a8;
  --mobot-line: rgba(148, 163, 184, 0.35);
  --mobot-panel: #0d1626;
  --mobot-gold: #c9a35a;
  --mobot-cyan: #3ec7e6;
  --mobot-violet: #7b5cff;
  min-height: 100dvh;
  margin: 0;
  background: radial-gradient(1200px 700px at 50% -10%, #12203a 0%, var(--mobot-bg) 55%);
  color: var(--mobot-ink);
  font-family: Manrope, system-ui, sans-serif;
}

.mobot-page a { color: inherit; }

.mobot-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.mobot-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(5, 11, 22, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Scrollbar belirince sayfa yana oynamasın (Ozan dersi 2026-08-16):
   hem html hem body her zaman scrollbar alanı rezerve eder. */
html {
  overflow-y: scroll;
  scrollbar-gutter: stable;
}
html, body.mobot-page {
  overflow-y: scroll;
  scrollbar-gutter: stable;
  width: auto;
  max-width: 100%;
}

/* ChatGPT tarzı: sayfa scroll'u — pencerenin sağ kenarında ince scrollbar */
.mobot-page::-webkit-scrollbar {
  width: 10px;
}

.mobot-page::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.3);
  border-radius: 8px;
}

.mobot-page::-webkit-scrollbar-track {
  background: transparent;
}

.mobot-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.mobot-brand img {
  width: 28px;
  height: 32px;
  object-fit: contain;
}

.mobot-brand__name {
  font-weight: 800;
  letter-spacing: 0.04em;
  font-size: 1rem;
}

.mobot-brand__bot {
  color: var(--mobot-gold);
  font-weight: 600;
  font-size: 0.9rem;
}

.mobot-top__actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.mobot-newchat {
  width: 42px;
  height: 42px;
  border: 0;
  background: transparent;
  color: var(--mobot-ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  border-radius: 10px;
  opacity: 0.85;
}

.mobot-newchat svg {
  width: 20px;
  height: 20px;
}

.mobot-newchat:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.06);
}

.mobot-newchat:focus-visible {
  outline: 2px solid var(--mobot-gold);
  outline-offset: 2px;
}

.mobot-burger {
  width: 42px;
  height: 42px;
  border: 0;
  background: transparent;
  color: var(--mobot-ink);
  display: grid;
  place-items: center;
  gap: 5px;
  cursor: pointer;
  border-radius: 10px;
}

.mobot-burger span {
  display: block;
  width: 20px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
}

.mobot-burger:focus-visible {
  outline: 2px solid var(--mobot-gold);
  outline-offset: 2px;
}

.mobot-drawer {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
}

.mobot-drawer.is-open { pointer-events: auto; }

.mobot-drawer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.mobot-drawer.is-open .mobot-drawer__backdrop { opacity: 1; }

.mobot-drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(320px, 88vw);
  height: 100%;
  background: #0a1424;
  border-left: 1px solid var(--mobot-line);
  padding: 24px 20px;
  transform: translateX(104%);
  transition: transform 0.22s ease;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mobot-drawer.is-open .mobot-drawer__panel { transform: none; }

.mobot-drawer__panel a {
  text-decoration: none;
  padding: 12px 10px;
  border-radius: 10px;
  color: var(--mobot-ink);
  font-weight: 600;
}

.mobot-drawer__panel a:hover { background: rgba(255, 255, 255, 0.06); }

.mobot-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 16px 24px;
  gap: 14px;
  width: min(720px, 100%);
  margin: 0 auto;
}

.mobot-page.is-chatting .mobot-main {
  justify-content: flex-start;
  padding-top: 8px;
  display: flex;
  flex-direction: column;
}

.mobot-page.is-chatting .mobot-thread {
  order: 1;
}

.mobot-page.is-chatting .mobot-wave {
  order: 2;
  width: 140px;
  height: 140px;
  margin: 8px auto 12px;
  flex-shrink: 0;
}

.mobot-page.is-chatting .mobot-composer-wrap {
  order: 3;
  position: sticky;
  bottom: 0;
  z-index: 10;
  padding: 10px 0 14px;
  background: linear-gradient(180deg, rgba(5, 11, 22, 0) 0%, var(--mobot-bg) 35%);
}

.mobot-wave {
  --orb-pulse: 0.22;
  width: min(280px, 70vw);
  height: min(280px, 70vw);
  position: relative;
  margin: 0 auto;
}

.mobot-wave canvas,
.mobot-wave__video {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 50%;
}

.mobot-wave__video {
  object-fit: cover;
  background: #000;
  transform: scale(calc(0.94 + var(--orb-pulse) * 0.12));
  filter: brightness(calc(0.78 + var(--orb-pulse) * 0.55))
    saturate(calc(0.92 + var(--orb-pulse) * 0.35))
    drop-shadow(0 0 calc(8px + var(--orb-pulse) * 28px) rgba(62, 160, 255, calc(0.15 + var(--orb-pulse) * 0.45)));
  transition: transform 60ms linear, filter 60ms linear;
  will-change: transform, filter;
}

.mobot-wave[data-orb-state="speaking"] .mobot-wave__video {
  /* speaking: slightly punchier glow */
  filter: brightness(calc(0.85 + var(--orb-pulse) * 0.6))
    saturate(calc(1 + var(--orb-pulse) * 0.4))
    drop-shadow(0 0 calc(12px + var(--orb-pulse) * 36px) rgba(80, 190, 255, calc(0.25 + var(--orb-pulse) * 0.5)));
}

.mobot-wave[data-orb-state="thinking"] .mobot-wave__video {
  animation: mobot-orb-think 1.1s ease-in-out infinite;
}

@keyframes mobot-orb-think {
  0%, 100% { opacity: 0.88; }
  50% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .mobot-wave__video {
    transform: none;
    filter: brightness(0.95);
    transition: none;
    animation: none !important;
  }
}

.mobot-title {
  margin: 0;
  font-family: Fraunces, Georgia, serif;
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 600;
  text-align: center;
}

.mobot-sub {
  margin: 0;
  max-width: 34rem;
  text-align: center;
  color: var(--mobot-muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.mobot-page.is-chatting .mobot-title,
.mobot-page.is-chatting .mobot-sub,
.mobot-page.is-chatting .mobot-chips {
  display: none;
}

.mobot-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 4px;
}

.mobot-chip {
  border: 1px solid var(--mobot-line);
  background: rgba(13, 22, 38, 0.85);
  color: var(--mobot-ink);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.mobot-chip:hover {
  border-color: rgba(201, 163, 90, 0.55);
  color: #f5e6c8;
}

.mobot-thread {
  width: 100%;
  display: none;
  flex-direction: column;
  gap: 18px;
  flex: 1 1 auto;
  padding: 8px 2px 12px;
}

.mobot-page.is-chatting .mobot-thread { display: flex; }

.asst-rating {
  align-self: flex-start;
  margin: 0 0 4px;
  padding: 10px 12px;
  border: 1px solid rgba(201, 163, 90, 0.35);
  border-radius: 10px;
  max-width: 280px;
}

.asst-rating__label,
.asst-rating__done {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--text-primary, #e8eef8);
}

.asst-rating__done { margin: 0; }

.asst-rating__stars { display: flex; gap: 4px; }

.asst-rating__star {
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  color: rgba(201, 163, 90, 0.45);
  font-size: 22px;
  cursor: pointer;
  padding: 0;
}

.asst-rating__star:hover,
.asst-rating__star:focus-visible {
  color: #c9a35a;
}

.mobot-msg {
  white-space: pre-wrap;
  line-height: 1.5;
  font-size: 0.94rem;
}

/* Müşteri: kompakt tek satır hap-çerçeve (uzunsa sarar) */
.mobot-msg--user {
  align-self: flex-end;
  width: fit-content;
  max-width: 85%;
  background: #1a3a6e;
  border: 1px solid var(--mobot-line);
  border-radius: 999px;
  padding: 9px 16px;
}

/* Bot: çerçevesiz düz metin (ChatGPT tarzı) */
.mobot-msg--bot {
  align-self: flex-start;
  max-width: 100%;
  background: transparent;
  border: 0;
  padding: 0 2px;
}

.mobot-msg--typing {
  padding: 2px;
}

.mobot-typing {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 18px;
  margin-top: 2px;
}

.mobot-typing i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(201, 163, 90, 0.85);
  animation: mobot-dot 1.1s ease-in-out infinite;
}

.mobot-typing i:nth-child(2) { animation-delay: 0.15s; }
.mobot-typing i:nth-child(3) { animation-delay: 0.3s; }

@keyframes mobot-dot {
  0%, 80%, 100% { opacity: 0.25; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}

.mobot-msg__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.mobot-msg__links a {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(201, 163, 90, 0.55);
  color: #f0e0b8;
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 700;
}

.mobot-msg__img {
  display: block;
  width: min(100%, 168px);
  height: auto;
  aspect-ratio: 9 / 16;
  object-fit: contain;
  object-position: top center;
  margin-top: 10px;
  border-radius: 12px;
  border: 1px solid rgba(201, 163, 90, 0.45);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  background: #001640;
  cursor: pointer;
}

.mobot-lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(0, 22, 64, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.mobot-lightbox[hidden] { display: none; }
.mobot-lightbox img {
  max-width: min(96vw, 420px);
  max-height: 92vh;
  width: auto;
  height: auto;
  border-radius: 12px;
  border: 1px solid rgba(201, 163, 90, 0.45);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}
.mobot-lightbox__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.mobot-attach {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--mobot-muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.mobot-attach:hover { color: var(--mobot-gold); }
.mobot-attach svg { width: 18px; height: 18px; }

.mobot-mic {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--mobot-muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.mobot-mic:hover { color: var(--mobot-gold); }
.mobot-mic svg { width: 18px; height: 18px; }
.mobot-mic.is-recording { color: var(--mobot-gold); box-shadow: 0 0 0 2px rgba(201, 163, 90, 0.35); }
.mobot-mic.is-busy { opacity: 0.55; pointer-events: none; }

.mobot-page.is-sabri-desk .mobot-composer {
  border-color: rgba(201, 163, 90, 0.55);
  box-shadow: 0 0 0 1px rgba(201, 163, 90, 0.2), 0 10px 40px rgba(0, 0, 0, 0.25);
}

.mobot-attach-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.mobot-attach-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(201, 163, 90, 0.14);
  border: 1px solid rgba(201, 163, 90, 0.35);
  color: var(--mobot-ink);
  font-size: 0.78rem;
}
.mobot-attach-chip button {
  border: 0;
  background: transparent;
  color: var(--mobot-muted);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0;
}

.mobot-composer-wrap {
  width: 100%;
  margin-top: 8px;
}

.mobot-composer {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 56px;
  padding: 8px 10px 8px 18px;
  border-radius: 16px;
  background: var(--mobot-panel);
  border: 1px solid var(--mobot-line);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}

.mobot-composer input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--mobot-ink);
  font: inherit;
  font-size: 0.95rem;
  outline: none;
}

.mobot-composer input::placeholder { color: #6b7788; }

.mobot-send {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: var(--mobot-gold);
  color: #0b1220;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.mobot-send:hover { filter: brightness(1.05); }

.mobot-send svg { width: 18px; height: 18px; }

.mobot-foot {
  text-align: center;
  padding: 14px 16px 18px;
  font-size: 0.72rem;
  color: var(--mobot-muted);
}

.mobot-foot a {
  color: var(--mobot-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

@media (max-width: 640px) {
  .mobot-top { padding: 14px 14px; }
  .mobot-brand__bot { display: none; }
  .mobot-page.is-chatting .mobot-brand__bot { display: inline; }
}
