/* Ezoterik asistan sohbet sayfası: astroloji.css'in üzerine. */

body { overflow: hidden; }
.chat-page { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 16px; width: 100%; max-width: 1180px; height: calc(100dvh - var(--ust, 64px)); margin: 0 auto; padding: 12px 16px; box-sizing: border-box; }

/* --- Sohbet listesi --- */
.threads { display: flex; flex-direction: column; gap: 10px; min-height: 0; padding: 14px; border: 1px solid var(--card-border); border-radius: var(--radius); background: var(--card); backdrop-filter: blur(10px); }
.new-chat { width: 100%; }
.threads-title { margin-top: 6px; color: var(--muted); font-size: 0.74rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
.threads ul { flex: 1; min-height: 0; margin: 0; padding: 0; overflow-y: auto; list-style: none; }
.threads li { position: relative; }
.threads li button.open { display: block; width: 100%; padding: 10px 34px 10px 12px; border: 0; border-radius: 12px; color: var(--foreground); background: none; font: inherit; font-size: 0.88rem; text-align: left; cursor: pointer; }
.threads li button.open small { display: block; color: var(--muted); font-size: 0.72rem; }
.threads li button.open span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.threads li.aktif button.open, .threads li button.open:hover { background: rgba(243, 194, 107, 0.1); }
.threads li .del { position: absolute; top: 50%; right: 6px; width: 24px; height: 24px; transform: translateY(-50%); border: 0; border-radius: 50%; color: var(--muted); background: none; cursor: pointer; opacity: 0; }
.threads li:hover .del, .threads li.aktif .del { opacity: 1; }
.threads li .del:hover { color: #fff; background: rgba(255, 90, 90, 0.4); }
.threads .bos { padding: 8px 4px; color: var(--muted); font-size: 0.84rem; }
.quota { color: var(--muted); font-size: 0.76rem; }

/* --- Sohbet --- */
.chat { padding-top: 0; display: flex; flex-direction: column; min-height: 0; border: 1px solid var(--card-border); border-radius: var(--radius); background: rgba(7, 9, 20, 0.72); backdrop-filter: blur(10px); overflow: hidden; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
.chat-head img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 18px rgba(243, 194, 107, 0.35); }
.chat-head b { display: block; font-family: var(--serif); font-size: 1.4rem; line-height: 1; }
.chat-head small { color: var(--muted); font-size: 0.8rem; }
.threads-toggle { display: none; width: 40px; height: 40px; border: 1px solid var(--card-border); border-radius: 12px; color: var(--foreground); background: none; font-size: 1.1rem; cursor: pointer; }

.messages { flex: 1; min-height: 0; padding: 18px; overflow-y: auto; scroll-behavior: smooth; }
.welcome { max-width: 620px; margin: 10px auto; text-align: center; animation: rise 0.6s ease both; }
.welcome img { width: 150px; height: 150px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 50px rgba(179, 136, 235, 0.35); animation: breathe 7s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.04); box-shadow: 0 0 70px rgba(243, 194, 107, 0.35); } }
.welcome h1 { margin: 12px 0 6px; font-size: clamp(1.8rem, 4vw, 2.4rem); }
.welcome p { color: #d8d3e8; }
.suggestions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 18px; }
.suggestions button { padding: 9px 14px; border: 1px solid rgba(243, 194, 107, 0.3); border-radius: 999px; color: var(--foreground); background: rgba(243, 194, 107, 0.06); font: inherit; font-size: 0.86rem; cursor: pointer; transition: border-color 0.2s, background 0.2s; }
.suggestions button:hover { border-color: var(--gold); background: rgba(243, 194, 107, 0.14); }

.msg { display: flex; gap: 10px; max-width: 820px; margin: 0 auto 14px; animation: rise 0.35s ease both; }
.msg .avatar { flex: 0 0 34px; width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.msg .bubble { padding: 12px 16px; border-radius: 18px; line-height: 1.65; font-size: 0.98rem; overflow-wrap: anywhere; }
.msg .bubble p + p { margin-top: 8px; }
.msg .bubble ul { margin: 6px 0; padding-left: 20px; }
.msg .bubble a { color: var(--gold); font-weight: 700; }
.msg.ezo .bubble { border: 1px solid rgba(255, 255, 255, 0.06); border-top-left-radius: 6px; background: rgba(255, 255, 255, 0.04); color: #efeaf9; }
.msg.kullanici { justify-content: flex-end; }
.msg.kullanici .bubble { max-width: 80%; border-top-right-radius: 6px; color: #1a1205; background: linear-gradient(135deg, #f6d48f, var(--gold)); white-space: pre-wrap; }
.msg .tools { margin-top: 6px; }
.msg .tools button { padding: 4px 10px; border: 1px solid rgba(243, 194, 107, 0.35); border-radius: 999px; color: var(--gold); background: none; font: inherit; font-size: 0.78rem; font-weight: 700; cursor: pointer; }
.msg .tools button.is-playing { color: #070914; background: var(--gold); }
.typing { display: inline-flex; align-items: center; gap: 5px; padding: 10px 16px; }
.typing-goz { width: 24px; height: auto; margin-right: 4px; filter: drop-shadow(0 0 6px rgba(255, 190, 90, 0.5)); animation: gozDon 3s linear infinite; }
@keyframes gozDon { to { transform: rotate(360deg); } }
.typing span { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); animation: blink 1.2s ease-in-out infinite; }
.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-4px); } }

.composer { display: flex; align-items: flex-end; gap: 8px; padding: 12px 14px; border-top: 1px solid rgba(255, 255, 255, 0.06); }
.composer textarea { flex: 1; box-sizing: border-box; min-height: 46px; max-height: 160px; padding: 12px 14px; border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 16px; color: var(--foreground); background: rgba(255, 255, 255, 0.06); font: inherit; font-size: 1rem; line-height: 1.4; resize: none; }
.composer textarea:focus { outline: none; border-color: var(--gold); }
.composer .send, .composer .mic { flex: 0 0 46px; width: 46px; height: 46px; border: 0; border-radius: 50%; font-size: 1.1rem; cursor: pointer; }
.composer .send { color: #070914; background: var(--gold); }
.composer .send:disabled { opacity: 0.5; cursor: progress; }
.composer .mic { color: var(--foreground); background: rgba(255, 255, 255, 0.08); }
.composer .mic.is-recording { background: rgba(255, 90, 90, 0.35); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(255, 90, 90, 0.18); } }
.note { padding: 0 14px 10px; color: var(--muted); font-size: 0.72rem; text-align: center; }

@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

@media (max-width: 820px) {
  .chat-page { grid-template-columns: 1fr; padding: 8px; height: calc(100dvh - var(--ust, 60px)); }
  .threads { position: fixed; z-index: 30; top: 60px; bottom: 0; left: 0; width: min(82vw, 300px); border-radius: 0 20px 20px 0; transform: translateX(-105%); transition: transform 0.3s ease; background: rgba(11, 13, 34, 0.97); }
  .threads.acik { transform: none; box-shadow: 20px 0 60px rgba(0, 0, 0, 0.6); }
  .threads-toggle { display: grid; place-items: center; }
  .messages { padding: 12px; }
  .msg.kullanici .bubble { max-width: 88%; }
  .welcome img { width: 110px; height: 110px; }
}
