/* ══════════════════════════════════════════════════════════════
   Tüfekci AI — style.css
   ══════════════════════════════════════════════════════════════ */

/* ── Reset & Kök değişkenler ──────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:              #f5f5f7;
  --panel:           #ffffff;
  --text:            #1a1a1e;
  --muted:           #6b6b76;
  --accent:          #6d5efc;
  --accent-2:        #9b8bff;
  --bubble-user:     #6d5efc;
  --bubble-user-txt: #ffffff;
  --bubble-bot:      #ffffff;
  --bubble-bot-txt:  #1a1a1e;
  --border:          #e4e4ea;
  --sidebar-bg:      #1c1c24;
  --sidebar-text:    #f0f0f5;
  --sidebar-muted:   #9797a3;
  --sidebar-hover:   #2a2a35;
  --sidebar-active:  #34304f;
  --msg-font-size:   15px;
  --header-grad:     linear-gradient(180deg,#ffb27a 0%,#ff8a65 30%,#7d6bd0 70%,#4a3f8f 100%);
  --radius:          12px;
  --radius-sm:       8px;
  --transition:      .2s ease;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:            #131318;
    --panel:         #1c1c24;
    --text:          #f0f0f5;
    --muted:         #9797a3;
    --bubble-bot:    #24242e;
    --bubble-bot-txt:#f0f0f5;
    --border:        #2c2c38;
  }
}
:root[data-theme="dark"] {
  --bg:            #131318;
  --panel:         #1c1c24;
  --text:          #f0f0f5;
  --muted:         #9797a3;
  --bubble-bot:    #24242e;
  --bubble-bot-txt:#f0f0f5;
  --border:        #2c2c38;
}

html, body {
  height: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* ── Lock screen ──────────────────────────────────────────────── */
#lockScreen {
  position: fixed; inset: 0; z-index: 120;
  background: #131318; color: #f0f0f5;
  display: none; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 14px; padding: 24px; text-align: center;
}
#lockScreen.visible { display: flex; }
#lockScreen .lock-icon {
  width: 56px; height: 56px; border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex; align-items: center; justify-content: center; font-size: 26px;
}
#lockScreen #lockTitleText  { font-size: 16px; font-weight: 700; }
#lockScreen #lockPromptText { font-size: 13px; color: #9797a3; }
#lockPin {
  font-size: 22px; letter-spacing: 10px; text-align: center;
  width: 140px; padding: 10px; border-radius: 10px;
  border: 1px solid #3a3a48; background: #20202a; color: #fff;
}
#lockError  { color: #ff6b6b; font-size: 13px; min-height: 16px; }
#unlockBtn  {
  background: var(--accent); color: #fff; border: none;
  border-radius: 10px; padding: 10px 22px;
  font-size: 14px; font-weight: 600; cursor: pointer;
}

/* ── Google Auth Overlay ──────────────────────────────────────── */
#authScreen {
  position: fixed; inset: 0; z-index: 110;
  background: rgba(10, 10, 20, 0.92);
  display: none; align-items: center; justify-content: center;
  backdrop-filter: blur(8px);
}
#authScreen.visible { display: flex; }

.auth-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2.5rem 2rem;
  max-width: 380px; width: 90%;
  display: flex; flex-direction: column;
  align-items: center; gap: 1rem;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0,0,0,.45);
}

.auth-logo {
  width: 72px; height: 72px; border-radius: 20px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 24px rgba(109,94,252,.45);
}

#authTitle    { font-size: 1.3rem; font-weight: 800; }
#authSubtitle { font-size: .9rem; color: var(--muted); margin-top: -.25rem; }

#googleLoginBtn {
  display: flex; align-items: center; gap: .65rem;
  background: #fff; color: #3c4043;
  border: 1px solid #dadce0; border-radius: 10px;
  padding: .65rem 1.25rem;
  font-size: .95rem; font-weight: 600; cursor: pointer;
  transition: box-shadow var(--transition);
  width: 100%; justify-content: center;
}
#googleLoginBtn:hover { box-shadow: 0 2px 8px rgba(0,0,0,.15); }

.auth-note { font-size: .75rem; color: var(--muted); }

/* ── Arka plan partiküller ────────────────────────────────────── */
.bg-animation {
  position: fixed; inset: 0; z-index: 0;
  overflow: hidden; pointer-events: none;
}
.bg-animation .particle {
  position: absolute; border-radius: 50%;
  opacity: .22; animation: particleFloat 15s infinite;
}
@keyframes particleFloat {
  0%,100% { transform: translateY(0) rotate(0deg);   opacity: .22; }
  50%      { transform: translateY(-100px) rotate(180deg); opacity: .1; }
}

/* ── App layout ───────────────────────────────────────────────── */
.app { height: 100dvh; display: flex; position: relative; z-index: 1; overflow: hidden; }

/* ── Overlay (mobil sidebar açık) ────────────────────────────── */
#overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 20; }
.app.sidebar-open #overlay { display: block; }

/* ══════ SIDEBAR ══════════════════════════════════════════════ */
#sidebar {
  position: fixed; top: 0; bottom: 0; left: 0;
  width: 82%; max-width: 320px;
  background: var(--sidebar-bg); color: var(--sidebar-text);
  transform: translateX(-100%); transition: transform .25s ease;
  z-index: 21; display: flex; flex-direction: column;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.app.sidebar-open #sidebar { transform: translateX(0); }

#sidebarScroll { flex: 1; overflow-y: auto; display: flex; flex-direction: column; min-height: 0; }

.sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 10px 8px 14px; flex-shrink: 0;
}
.sidebar-header .brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; }
.sidebar-header .brand .dot {
  width: 22px; height: 22px; border-radius: 7px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: #fff;
  background-size: cover; background-position: center;
}
.sidebar-header .actions { display: flex; align-items: center; }

.icon-btn {
  background: none; border: none; color: var(--sidebar-muted);
  cursor: pointer; padding: 6px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px; transition: background var(--transition), color var(--transition);
}
.icon-btn:hover  { background: var(--sidebar-hover); color: var(--sidebar-text); }
.icon-btn:active { background: var(--sidebar-hover); }
.icon-btn svg { width: 20px; height: 20px; }
#fontBtn { font-size: 13px; font-weight: 700; width: 30px; height: 30px; }

/* Header icon-btn (farklı renk) */
#menuBtn, #exportBtn, #findBtn {
  position: absolute; top: calc(10px + env(safe-area-inset-top, 0px)); z-index: 4;
  background: rgba(0,0,0,.28); color: #fff; border-radius: 10px;
}
#menuBtn   { left:  10px; }
#exportBtn { right: 10px; }
#findBtn   { right: 56px; }
#menuBtn:hover, #exportBtn:hover, #findBtn:hover { background: rgba(0,0,0,.45); }

/* Sidebar arama */
#searchWrap { margin: 0 12px 8px; }
#searchInput {
  width: 100%; background: var(--sidebar-hover);
  border: 1px solid rgba(255,255,255,.08);
  color: var(--sidebar-text); border-radius: 9px;
  padding: 8px 10px; font-size: 13px; outline: none;
}
#searchInput::placeholder { color: var(--sidebar-muted); }

/* Bölüm etiketleri */
#toneWrap, #langWrap, #modeWrap, #speedWrap, #weatherWrap { margin: 0 12px 10px; }

.row-label {
  font-size: 11px; color: var(--sidebar-muted); margin-bottom: 5px;
  text-transform: uppercase; letter-spacing: .03em;
}

#toneOptions, #langOptions, #sceneOptions, #modeOptions, #speedOptions,
#weatherOptions { display: flex; gap: 6px; flex-wrap: wrap; }

.pill-btn {
  flex: 1; background: var(--sidebar-hover);
  border: 1px solid rgba(255,255,255,.08);
  color: var(--sidebar-muted); padding: 7px 4px;
  border-radius: 8px; font-size: 12px; cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  white-space: nowrap;
}
.pill-btn.active {
  background: var(--accent); border-color: var(--accent);
  color: #fff; font-weight: 600;
}
.pill-btn.scene-pick { display: flex; align-items: center; justify-content: center; padding: 5px; }
.pill-btn.scene-pick svg { border-radius: 4px; display: block; }
.pill-btn.scene-pick.active { outline: 2px solid var(--accent); outline-offset: 1px; }

#weatherOptions .pill-btn { flex: 1 1 28%; }

/* Ayarlar <details> */
#settingsDetails { margin: 0 12px 10px; }
#settingsDetails summary {
  cursor: pointer; font-size: 13px; font-weight: 600;
  padding: 8px 10px; background: var(--sidebar-hover);
  border-radius: 9px; list-style: none;
}
#settingsDetails summary::-webkit-details-marker { display: none; }
#settingsDetails summary::before { content: '⚙️ '; }
.settings-body { padding: 10px 2px 2px; display: flex; flex-direction: column; gap: 12px; }
.setting-item label, .setting-item .row-label {
  display: block; font-size: 11.5px; color: var(--sidebar-muted); margin-bottom: 4px;
}
.setting-item input[type="text"],
.setting-item textarea {
  width: 100%; background: var(--sidebar-hover);
  border: 1px solid rgba(255,255,255,.08); color: var(--sidebar-text);
  border-radius: 8px; padding: 7px 9px; font-size: 12.5px; outline: none; font-family: inherit;
}
.setting-item textarea { resize: vertical; min-height: 44px; }
.setting-item input[type="color"] {
  width: 44px; height: 30px; border: none; border-radius: 6px; background: none; cursor: pointer;
}
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

/* Toggle switch */
.switch { position: relative; width: 40px; height: 22px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track {
  position: absolute; inset: 0; background: rgba(255,255,255,.15);
  border-radius: 20px; cursor: pointer; transition: .2s;
}
.switch .track::before {
  content: ''; position: absolute; width: 16px; height: 16px;
  left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s;
}
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::before { transform: translateX(18px); }

/* Ayar butonları */
.settings-btn-row { display: flex; gap: 6px; }
.settings-btn {
  flex: 1; background: var(--sidebar-hover);
  border: 1px solid rgba(255,255,255,.08); color: var(--sidebar-text);
  border-radius: 8px; padding: 7px 6px; font-size: 11.5px; cursor: pointer;
}
.settings-btn.danger  { color: #ff6b6b; }
.settings-btn.confirming { background: #ff4d4f; border-color: #ff4d4f; color: #fff; }
.settings-hint { font-size: 10.5px; color: var(--sidebar-muted); margin-top: 3px; }

.file-btn-wrap { position: relative; flex: 1; overflow: hidden; border-radius: 8px; }
.file-btn-wrap .settings-btn { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; pointer-events: none; }
.file-btn-wrap input[type="file"] {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; cursor: pointer; font-size: 100px;
}

/* Gizli sohbet + özetle */
#incognitoBtn, #summarizeBtn {
  margin: 0 12px 10px; flex-shrink: 0;
  background: var(--sidebar-hover); border: 1px solid rgba(255,255,255,.08);
  color: var(--sidebar-text); padding: 9px 12px;
  border-radius: 10px; font-size: 13px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
#incognitoBtn.active { background: #4a3f8f; border-color: #4a3f8f; color: #fff; }
#summarizeBtn:disabled { opacity: .5; cursor: default; }

/* Yeni sohbet satırı */
.sidebar-row { display: flex; gap: 8px; margin: 0 12px 10px; flex-shrink: 0; }
#newChatBtn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--sidebar-hover); border: 1px solid rgba(255,255,255,.08);
  color: var(--sidebar-text); padding: 10px 12px;
  border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer;
}
#newChatBtn svg { width: 16px; height: 16px; }
#clearAllBtn {
  flex-shrink: 0; background: var(--sidebar-hover);
  border: 1px solid rgba(255,255,255,.08); color: var(--sidebar-muted);
  padding: 0 12px; border-radius: 10px; font-size: 12px; cursor: pointer; white-space: nowrap;
}
#clearAllBtn.confirming { background: #ff4d4f; border-color: #ff4d4f; color: #fff; }

/* Kullanıcı satırı */
#userRow {
  display: flex; align-items: center; gap: 10px;
  margin: 0 12px 10px; padding: 10px 12px;
  background: var(--sidebar-hover); border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px; flex-shrink: 0;
}
#userAvatar {
  width: 34px; height: 34px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0; border: 2px solid var(--accent);
}
#userInfo { flex: 1; min-width: 0; }
#userName  { font-size: 13px; font-weight: 600; color: var(--sidebar-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#userEmail { font-size: 11px; color: var(--sidebar-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#logoutBtn {
  background: none; border: 1px solid rgba(255,255,255,.12);
  color: var(--sidebar-muted); border-radius: 8px; padding: 5px;
  cursor: pointer; display: flex; flex-shrink: 0;
  transition: background var(--transition), color var(--transition);
}
#logoutBtn:hover { background: #ff4d4f22; color: #ff6b6b; border-color: #ff4d4f; }

/* Sidebar Google giriş butonu */
#sidebarLoginBtn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin: 0 12px 10px; padding: 9px 12px; flex-shrink: 0;
  background: #fff; color: #3c4043;
  border: 1px solid #dadce0; border-radius: 10px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: box-shadow var(--transition);
}
#sidebarLoginBtn:hover { box-shadow: 0 2px 8px rgba(0,0,0,.25); }

/* Konuşma listesi */
#convList { flex: 1; overflow-y: visible; padding: 4px 8px 12px; display: flex; flex-direction: column; gap: 2px; }
.conv-item {
  display: flex; align-items: center; gap: 2px;
  padding: 9px 6px 9px 10px; border-radius: 9px; cursor: pointer;
  font-size: 13.5px; color: var(--sidebar-text);
  white-space: nowrap; overflow: hidden; transition: background var(--transition);
}
.conv-item:hover, .conv-item:active { background: var(--sidebar-hover); }
.conv-item.active  { background: var(--sidebar-active); }
.conv-item .conv-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-item.pinned .conv-title::before { content: '📌 '; }
.conv-item .conv-title-input {
  flex: 1; background: rgba(255,255,255,.08); border: 1px solid var(--accent);
  color: var(--sidebar-text); border-radius: 6px; padding: 2px 6px;
  font-size: 13px; outline: none; min-width: 0;
}
.conv-item .mini-btn {
  background: none; border: none; color: var(--sidebar-muted);
  cursor: pointer; padding: 3px 5px; font-size: 12px; line-height: 1;
  flex-shrink: 0; border-radius: 6px;
}
.conv-item .mini-btn:active { color: #fff; background: rgba(255,255,255,.12); }
.conv-item .del-btn:active   { color: #ff6b6b; }
.conv-item .pin-btn.pinned-on { color: #ffd166; }
.sidebar-empty { color: var(--sidebar-muted); font-size: 13px; padding: 10px 14px; }

/* ══════ MAIN COLUMN ══════════════════════════════════════════ */
.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; height: 100%; position: relative; }

/* ── Header / Sahne ───────────────────────────────────────────── */
header {
  position: relative;
  padding-top: env(safe-area-inset-top, 0px);
  background: var(--header-grad);
  overflow: hidden; flex-shrink: 0;
}
header .scene { position: relative; width: 100%; height: 168px; }
header svg.mountains {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block;
  transform-origin: 50% 100%;
  animation: sceneSway 16s ease-in-out infinite alternate;
}
@keyframes sceneSway {
  0%   { transform: scale(1.07) translateX(-1.6%); }
  100% { transform: scale(1.07) translateX(1.6%); }
}

.sky-tint  { position: absolute; inset: 0; pointer-events: none; z-index: 1; transition: background .8s; }
.weather   { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 2; }

/* Logo peak */
.logo-peak {
  position: absolute; left: 50%; bottom: 34px; transform: translateX(-50%);
  width: 56px; height: 56px; border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 24px;
  box-shadow: 0 10px 22px rgba(0,0,0,.35), 0 0 0 4px rgba(255,255,255,.15);
  z-index: 3;
  background-size: cover; background-position: center;
}

/* Başlık */
.title-block { position: relative; z-index: 3; text-align: center; padding: 4px 16px 14px; }
header h1 {
  font-size: 27px; margin: 0 0 2px; font-weight: 800;
  display: inline-block; letter-spacing: 1px; color: #fff;
}
header h1 .ltr {
  display: inline-block;
  animation: letterWave 1.8s ease-in-out infinite, rgbGlow 3.6s linear infinite;
  animation-delay: calc(var(--i) * .11s), calc(var(--i) * -.32s);
}
header h1 .ltr.sp { width: .32em; }

@keyframes letterWave {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-9px); }
}
@keyframes rgbGlow {
  0%   { color:#ff3b3b; text-shadow:0 0 6px #ff3b3b,0 0 14px rgba(255,59,59,.8); }
  17%  { color:#ffb020; text-shadow:0 0 6px #ffb020,0 0 14px rgba(255,176,32,.8); }
  33%  { color:#3bff6a; text-shadow:0 0 6px #3bff6a,0 0 14px rgba(59,255,106,.8); }
  50%  { color:#3bf0ff; text-shadow:0 0 6px #3bf0ff,0 0 14px rgba(59,240,255,.8); }
  67%  { color:#4a6bff; text-shadow:0 0 6px #4a6bff,0 0 14px rgba(74,107,255,.8); }
  83%  { color:#d03bff; text-shadow:0 0 6px #d03bff,0 0 14px rgba(208,59,255,.8); }
  100% { color:#ff3b3b; text-shadow:0 0 6px #ff3b3b,0 0 14px rgba(255,59,59,.8); }
}
header p { margin: 0; font-size: 12px; color: rgba(255,255,255,.85); }

/* "Düşünüyor" + fırtına efekti */
header.thinking h1 .ltr { animation-duration: .8s, 1.6s; }
header.thinking h1 { filter: brightness(1.25); }
header.storm h1 { animation: titleFlash 7s linear infinite; }
@keyframes titleFlash {
  0%,90%  { filter: none; }
  91%     { filter: brightness(3) drop-shadow(0 0 14px #fff); }
  92%     { filter: brightness(1.3); }
  93.5%   { filter: brightness(2.6) drop-shadow(0 0 12px #fff); }
  96%,100%{ filter: none; }
}

/* Gizli mod banner */
#incognitoBanner {
  display: none; text-align: center; font-size: 11.5px;
  padding: 5px; background: #4a3f8f; color: #fff; flex-shrink: 0;
}
#incognitoBanner.visible { display: block; }

/* ── Hava durumu elemanları ───────────────────────────────────── */
.weather .cloud {
  position: absolute; left: 0;
  width: calc(80px * var(--s)); height: calc(24px * var(--s));
  border-radius: 30px; background: rgba(255,255,255,.55);
  animation: cloudMove linear infinite;
}
.weather .cloud::before, .weather .cloud::after {
  content: ''; position: absolute; background: inherit; border-radius: 50%;
}
.weather .cloud::before { width: 55%; height: 150%; left: 15%; top: -70%; }
.weather .cloud::after  { width: 40%; height: 120%; right: 12%; top: -45%; }
.weather .cloud.night   { background: rgba(190,200,240,.25); }
@keyframes cloudMove {
  from { transform: translateX(-140px); }
  to   { transform: translateX(calc(100vw + 140px)); }
}
.weather.w-rain .cloud,
.weather.w-storm .cloud { background: rgba(140,150,175,.85); }

.weather .orb {
  position: absolute; width: 96px; height: 96px;
  margin: -48px 0 0 -48px; border-radius: 50%;
  animation: orbPulse 4s ease-in-out infinite;
}
.weather .orb.sun      { background: radial-gradient(circle, rgba(255,240,190,.75) 0%, rgba(255,220,150,.25) 45%, transparent 70%); }
.weather .orb.sun.warm { background: radial-gradient(circle, rgba(255,170,120,.8)  0%, rgba(255,120,90,.3)   45%, transparent 70%); }
.weather .orb.moon     { background: radial-gradient(circle, rgba(210,225,255,.45) 0%, rgba(180,200,255,.15) 45%, transparent 70%); }
@keyframes orbPulse { 0%,100%{transform:scale(1);opacity:.8;} 50%{transform:scale(1.3);opacity:1;} }

.weather .star {
  position: absolute; width: 2px; height: 2px;
  border-radius: 50%; background: #fff;
  animation: twinkle 2.5s ease-in-out infinite;
}
@keyframes twinkle { 0%,100%{opacity:.15;transform:scale(.8);} 50%{opacity:1;transform:scale(1.5);} }

.weather .flake {
  position: absolute; top: -6px; width: 4px; height: 4px;
  border-radius: 50%; background: #fff; opacity: .85;
  animation: snowFall linear infinite;
}
@keyframes snowFall {
  from { transform: translate(0,-6px); }
  to   { transform: translate(var(--dx),185px); }
}

.weather .bird { position: absolute; left: 0; width: 16px; height: 8px; animation: birdFly linear infinite; }
.weather .bird svg { width: 100%; height: 100%; animation: flap .5s ease-in-out infinite alternate; }
@keyframes birdFly { from{transform:translateX(-30px);} to{transform:translateX(calc(100vw + 30px));} }
@keyframes flap    { from{transform:scaleY(1);}         to{transform:scaleY(.35);} }

.weather .leaf {
  position: absolute; top: -8px; width: 7px; height: 5px;
  border-radius: 0 80% 0 80%; animation: leafFall linear infinite;
}
@keyframes leafFall {
  from { transform: translate(0,-8px) rotate(0deg); }
  to   { transform: translate(var(--dx),185px) rotate(360deg); }
}

.weather .firefly {
  position: absolute; width: 3px; height: 3px; border-radius: 50%;
  background: #e9ff7a; box-shadow: 0 0 6px 2px rgba(233,255,122,.7);
  animation: fireflyMove ease-in-out infinite alternate;
}
@keyframes fireflyMove {
  0%  { transform:translate(0,0);                        opacity:.2; }
  50% { opacity:1; }
  100%{ transform:translate(var(--dx),var(--dy));        opacity:.3; }
}

.weather .win {
  position: absolute; width: 3px; height: 3px;
  background: #ffd86b; box-shadow: 0 0 4px rgba(255,216,107,.8);
  animation: winBlink ease-in-out infinite;
}
@keyframes winBlink { 0%,100%{opacity:.25;} 40%,70%{opacity:1;} }

.weather .drop {
  position: absolute; top: -14px; width: 1.5px; height: 12px;
  background: linear-gradient(transparent, rgba(200,220,255,.85));
  animation: rainFall linear infinite;
}
@keyframes rainFall {
  from { transform: translate(0,-14px) rotate(10deg); }
  to   { transform: translate(-26px,190px) rotate(10deg); }
}

.weather .lightning {
  position: absolute; inset: 0; background: rgba(235,240,255,.9);
  opacity: 0; animation: lightningFlash 7s linear infinite;
}
@keyframes lightningFlash {
  0%,90%  { opacity: 0; }
  91%     { opacity: .85; }
  92%     { opacity: .1; }
  93.5%   { opacity: .7; }
  96%,100%{ opacity: 0; }
}

.weather .fog {
  position: absolute; left: -20%; width: 140%; height: 38%;
  background: linear-gradient(90deg,transparent,rgba(255,255,255,.4),transparent);
  filter: blur(6px); animation: fogDrift 18s ease-in-out infinite alternate;
}
@keyframes fogDrift { from{transform:translateX(-10%);} to{transform:translateX(10%);} }

.weather .windline {
  position: absolute; left: 0; height: 1.5px;
  background: linear-gradient(90deg,transparent,rgba(255,255,255,.75),transparent);
  animation: windBlow linear infinite;
}
@keyframes windBlow { from{transform:translateX(-80px);} to{transform:translateX(calc(100vw + 80px));} }

/* ── Find bar ─────────────────────────────────────────────────── */
#findBar {
  display: none; align-items: center; gap: 6px;
  padding: 8px 12px; background: var(--panel);
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}
#findBar.open { display: flex; }
#findInput {
  flex: 1; min-width: 0; border: 1px solid var(--border);
  background: var(--bg); color: var(--text);
  border-radius: 14px; padding: 7px 12px; font-size: 14px; outline: none;
}
#findInput:focus { border-color: var(--accent); }
#findCount { font-size: 12px; color: var(--muted); min-width: 42px; text-align: center; }
#findBar button {
  border: 1px solid var(--border); background: var(--bg); color: var(--text);
  border-radius: 10px; width: 32px; height: 32px; cursor: pointer; font-size: 14px; flex-shrink: 0;
}
mark.find-hit         { background: #ffe066; color: #222; border-radius: 3px; padding: 0 1px; }
mark.find-hit.current { background: #ff9f43; }

/* ── Chat ─────────────────────────────────────────────────────── */
#chat {
  flex: 1; overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 12px;
  background-size: cover; background-position: center; background-repeat: no-repeat;
}
#chat::-webkit-scrollbar { width: 6px; }
#chat::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* Mesaj */
.msg {
  max-width: 82%; padding: 10px 14px; border-radius: 16px;
  line-height: 1.45; font-size: var(--msg-font-size);
  white-space: pre-wrap; word-wrap: break-word; position: relative;
  animation: msgIn .18s ease;
}
@keyframes msgIn { from{opacity:0;transform:translateY(6px);} to{opacity:1;transform:none;} }

.msg.user {
  align-self: flex-end; background: var(--bubble-user);
  color: var(--bubble-user-txt); border-bottom-right-radius: 4px;
}
.msg.bot {
  align-self: flex-start; background: var(--bubble-bot);
  color: var(--bubble-bot-txt); border: 1px solid var(--border);
  border-bottom-left-radius: 4px; max-width: 88%;
}
.msg.bot .msg-content { white-space: normal; }

/* Markdown içerik */
.msg-content p { margin: 0 0 8px; }
.msg-content p:last-child { margin-bottom: 0; }
.msg-content ul, .msg-content ol { margin: 4px 0 8px; padding-left: 20px; }
.msg-content li { margin-bottom: 3px; }
.msg-content strong { font-weight: 700; }
.msg-content a { color: var(--accent); text-decoration: underline; word-break: break-all; }
.msg-content code {
  background: rgba(128,128,128,.18); padding: 1px 5px;
  border-radius: 5px; font-size: .9em;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.msg-content pre {
  background: #1e1e1e; color: #d4d4d4;
  padding: 30px 12px 10px; border-radius: 10px;
  overflow-x: auto; margin: 0 0 8px;
}
.code-wrap { position: relative; margin: 0 0 8px; }
.code-wrap pre { margin: 0; }
.code-copy {
  position: absolute; top: 6px; right: 6px;
  background: rgba(255,255,255,.14); color: #d4d4d4; border: none;
  border-radius: 6px; font-size: 11px; padding: 3px 8px; cursor: pointer;
}
.code-copy:active { opacity: .6; }
.msg-content pre code { background: none; padding: 0; font-size: .85em; white-space: pre; }
.msg-image { max-width: 100%; border-radius: 10px; margin-bottom: 6px; display: block; }

/* Syntax renklendirme */
.msg-content pre code .tk-c { color: #7f8c98; font-style: italic; }
.msg-content pre code .tk-s { color: #a5d6a7; }
.msg-content pre code .tk-n { color: #f0a868; }
.msg-content pre code .tk-k { color: #82aaff; font-weight: 600; }

/* Yazıyor animasyonu */
.typing-dots { display: inline-flex; gap: 4px; align-items: center; padding: 4px 0; }
.typing-dots span {
  width: 6px; height: 6px; border-radius: 50%; background: var(--muted);
  animation: bounce 1.2s infinite ease-in-out;
}
.typing-dots span:nth-child(2) { animation-delay: .15s; }
.typing-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%,60%,100%{transform:translateY(0);opacity:.5;} 30%{transform:translateY(-5px);opacity:1;} }

.msg-time { display: block; font-size: 10px; opacity: .6; margin-top: 4px; }
.msg-actions { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; align-items: center; }
.action-btn {
  display: inline-flex; align-items: center; gap: 4px;
  background: none; border: 1px solid var(--border);
  color: var(--muted); font-size: 11px; padding: 3px 9px;
  border-radius: 10px; cursor: pointer; transition: opacity var(--transition);
}
.action-btn:active { opacity: .6; }
.action-btn.fb-active-up    { background:#2ecc71; border-color:#2ecc71; color:#fff; }
.action-btn.fb-active-down  { background:#ff6b6b; border-color:#ff6b6b; color:#fff; }
.action-btn.fb-active-heart { background:#ff5c8a; border-color:#ff5c8a; color:#fff; }
.action-btn.fb-active-laugh { background:#ffb020; border-color:#ffb020; color:#fff; }
.action-btn.fb-active-wow   { background:#7c6bf0; border-color:#7c6bf0; color:#fff; }

/* Boş durum */
.empty-state {
  background: none; padding: 0; width: fit-content; max-width: 92%;
  display: flex; flex-direction: column; align-items: center;
  gap: 6px; margin: auto; text-align: center;
}
.mini-welcome {
  font-size: clamp(17px, 5.4vw, 26px); font-weight: 800; letter-spacing: .4px;
  display: inline-block; white-space: nowrap;
  background: linear-gradient(90deg,#0a3cff 0%,#1e90ff 25%,#00d9ff 50%,#1e90ff 75%,#0a3cff 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  filter: drop-shadow(0 0 6px rgba(30,144,255,.85)) drop-shadow(0 0 14px rgba(0,180,255,.45));
  animation: bwShift 3s linear infinite, bwFloat 3s ease-in-out infinite;
}
@keyframes bwShift { from{background-position:0% 50%;} to{background-position:200% 50%;} }
@keyframes bwFloat { 0%,100%{transform:translateY(0);} 50%{transform:translateY(-3px);} }

.hope-line {
  font-size: 14px; font-weight: 700; display: inline-block;
  text-align: center; max-width: 92%; line-height: 1.4; margin-top: 2px;
  background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.18));
  animation: hopeShift 5s linear infinite, hopeIn .8s ease;
  transition: opacity .5s;
}
.hope-line.fade { opacity: 0; }
@keyframes hopeShift { from{background-position:0% 50%;} to{background-position:200% 50%;} }
@keyframes hopeIn    { from{opacity:0;transform:translateY(6px);} to{opacity:1;transform:none;} }
.mini-sub { font-size: 13px; color: var(--muted); }

/* Scroll to bottom */
#scrollBottomBtn {
  position: absolute; right: 14px; bottom: 78px;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--panel); border: 1px solid var(--border); color: var(--text);
  box-shadow: 0 4px 10px rgba(0,0,0,.15);
  display: none; align-items: center; justify-content: center;
  cursor: pointer; z-index: 5;
}
#scrollBottomBtn.visible { display: flex; }
#scrollBottomBtn svg { width: 16px; height: 16px; }

/* Drag highlight */
.drag-highlight { outline: 3px dashed var(--accent); outline-offset: -6px; }

/* Görsel önizleme */
#imagePreviewWrap {
  display: none; align-items: center; gap: 8px;
  padding: 8px 12px 0; background: var(--panel);
}
#imagePreviewWrap.visible { display: flex; }
#imagePreviewWrap img {
  width: 44px; height: 44px; object-fit: cover;
  border-radius: 8px; border: 1px solid var(--border);
}
#imagePreviewWrap .remove-img {
  background: none; border: 1px solid var(--border); color: var(--muted);
  border-radius: 8px; padding: 3px 8px; font-size: 11px; cursor: pointer;
}

/* Notice */
#notice { text-align: center; font-size: 12px; color: var(--muted); padding: 6px 16px 0; flex-shrink: 0; }

/* ── Giriş formu ──────────────────────────────────────────────── */
form#inputBar {
  position: relative; display: flex; gap: 8px; padding: 12px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  background: var(--panel); border-top: 1px solid var(--border); flex-shrink: 0;
}

#q {
  flex: 1; border: 1px solid var(--border); background: var(--bg);
  color: var(--text); border-radius: 20px; padding: 10px 16px;
  font-size: 15px; outline: none; min-width: 0;
}
#q:focus { border-color: var(--accent); }

button#send {
  background: var(--accent); color: #fff; border: none;
  border-radius: 20px; padding: 0 18px; font-size: 15px;
  font-weight: 600; cursor: pointer; flex-shrink: 0;
  transition: background var(--transition);
}
button#send:disabled { opacity: .5; cursor: default; }
button#send.stop { background: #ef4444; }
button#send:not(:disabled):hover { background: var(--accent-2); }

.round-btn {
  flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--bg); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0; transition: background var(--transition);
}
.round-btn svg { width: 18px; height: 18px; }
.round-btn:hover { background: var(--border); }
.mic-btn.listening {
  background: #ff4d4f; border-color: #ff4d4f; color: #fff;
  animation: pulse 1.2s infinite;
}
@keyframes pulse {
  0%  { box-shadow: 0 0 0 0 rgba(255,77,79,.5); }
  70% { box-shadow: 0 0 0 10px rgba(255,77,79,0); }
  100%{ box-shadow: 0 0 0 0 rgba(255,77,79,0); }
}

/* Şablon menüsü */
#tplMenu {
  display: none; position: absolute; left: 12px; right: 12px; bottom: calc(100% + 6px);
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
  padding: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.25);
  grid-template-columns: 1fr 1fr; gap: 8px; z-index: 25;
}
#tplMenu.open { display: grid; }
.tpl {
  background: var(--panel); border: 1px solid var(--border); color: var(--text);
  border-radius: 12px; padding: 10px 8px; font-size: 12.5px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.tpl .em { font-size: 20px; }
.tpl:active { opacity: .7; }

/* ── Bağlam menüsü ────────────────────────────────────────────── */
#ctxMenu {
  position: fixed; z-index: 30; background: var(--panel);
  border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 6px 18px rgba(0,0,0,.2); overflow: hidden; display: none;
}
#ctxMenu.visible { display: block; }
#ctxMenu button {
  display: block; width: 100%; text-align: left;
  background: none; border: none; padding: 10px 16px;
  font-size: 13.5px; color: var(--text); cursor: pointer; white-space: nowrap;
}
#ctxMenu button:active { background: var(--bg); }
#ctxMenu button.danger { color: #ff5252; }

/* ── Erişilebilirlik ──────────────────────────────────────────── */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 640px) {
  .msg { max-width: 100%; }
}

/* Azaltılmış hareket */
@media (prefers-reduced-motion: reduce) {
  .bg-animation .particle,
  header h1 .ltr,
  header.storm h1,
  .weather *,
  header svg.mountains,
  .mini-welcome { animation: none !important; }
  .hope-line { animation: none; }
}
