/* v20.1 AI YÜZER PANEL — nefes + hale, cam panel, vurgu ışığı */
#aiDugme {
  position: fixed; right: 14px; top: 72%;
  width: 56px; height: 56px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.85);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.18);
  cursor: grab; z-index: 9000; padding: 0;
  animation: aiNefes 4s ease-in-out infinite;
  touch-action: none;
}
#aiDugme:active { cursor: grabbing; }
#aiDugme .ai-ic {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%;
}
/* Baretin altındaki konuşma çubukları hafifçe yaşar (AI kimliği) */
#aiDugme .ai-ic-cubuk { animation: aiCubuk 2.6s ease-in-out infinite; }
@keyframes aiCubuk { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }
#aiDugme .ai-hale {
  position: absolute; inset: -3px; border-radius: 50%;
  background: conic-gradient(from 0deg, #4f46e5, #0ea5e9, #ea580c, #4f46e5);
  filter: blur(6px); opacity: 0.55; z-index: 0;
  animation: aiHale 9s linear infinite;
}
#aiDugme::after { /* içi maskele: hale yalnız çeper */
  content: ''; position: absolute; inset: 2px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.92); z-index: 1;
}
@keyframes aiNefes { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes aiHale { to { transform: rotate(360deg); } }

#aiPanel {
  position: fixed; z-index: 9001;
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
  display: flex; flex-direction: column;
  opacity: 0; transform: translateY(14px) scale(0.96);
  transition: opacity .22s ease, transform .25s cubic-bezier(.34, 1.4, .64, 1);
}
#aiPanel.ai-acik { opacity: 1; transform: none; }
.ai-sohbet-boyu { right: 16px; bottom: 16px; width: min(400px, calc(100vw - 32px)); height: min(540px, calc(100vh - 100px)); }
.ai-form-boyu { right: 12px; bottom: 12px; width: min(340px, calc(100vw - 24px)); height: min(46vh, 420px); }
@media (max-width: 640px) {
  .ai-form-boyu { left: 8px; right: 8px; width: auto; height: 38vh; bottom: 8px; }
}

.ai-baslik { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid rgba(15, 23, 42, 0.08); }
.ai-rozet { font-size: 0.62rem; letter-spacing: 0.06em; text-transform: uppercase; background: linear-gradient(120deg, #4f46e5, #0ea5e9); color: #fff; border-radius: 999px; padding: 3px 8px; }
.ai-kapat { margin-left: auto; border: none; background: none; font-size: 1.4rem; line-height: 1; cursor: pointer; color: #64748b; }

.ai-dalga { display: inline-flex; gap: 2px; align-items: flex-end; height: 14px; }
.ai-dalga i { width: 3px; height: 5px; border-radius: 2px; background: linear-gradient(#4f46e5, #0ea5e9); }
.ai-konusuyor .ai-dalga i { animation: aiDalga 0.9s ease-in-out infinite; }
.ai-konusuyor .ai-dalga i:nth-child(2) { animation-delay: 0.15s; }
.ai-konusuyor .ai-dalga i:nth-child(3) { animation-delay: 0.3s; }
@keyframes aiDalga { 0%, 100% { height: 5px; } 50% { height: 14px; } }

.ai-akis { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.ai-balon { max-width: 86%; padding: 9px 12px; border-radius: 14px; font-size: 0.9rem; line-height: 1.45; }
.ai-b-as { align-self: flex-start; background: #f1f5f9; color: #0f172a; border-bottom-left-radius: 4px; }
.ai-b-kul { align-self: flex-end; background: linear-gradient(120deg, #4f46e5, #4338ca); color: #fff; border-bottom-right-radius: 4px; }
.ai-dusunce { display: inline-flex; gap: 4px; }
.ai-dusunce i { width: 6px; height: 6px; border-radius: 50%; background: #94a3b8; animation: aiDalga 1s ease-in-out infinite; }
.ai-dusunce i:nth-child(2) { animation-delay: 0.15s; }
.ai-dusunce i:nth-child(3) { animation-delay: 0.3s; }

.ai-giris { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid rgba(15, 23, 42, 0.08); }
.ai-giris input { flex: 1; border: 1px solid #d1d5db; border-radius: 10px; padding: 9px 12px; font-size: 0.9rem; }
.ai-giris button { border: none; border-radius: 10px; background: linear-gradient(120deg, #4f46e5, #0ea5e9); color: #fff; width: 42px; cursor: pointer; font-size: 0.95rem; }
.ai-kvkk { font-size: 0.64rem; color: #94a3b8; text-align: center; padding: 0 12px 8px; }
.ai-kvkk a { color: #64748b; }

/* Asistanın doldurduğu alan: 1 sn vurgu ışığı */
.ai-vurgu { animation: aiVurgu 1.1s ease; }
@keyframes aiVurgu {
  0% { box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.0); background-color: #fff7cf; }
  35% { box-shadow: 0 0 0 6px rgba(79, 70, 229, 0.25); }
  100% { box-shadow: 0 0 0 0 rgba(79, 70, 229, 0); background-color: inherit; }
}

@media (prefers-reduced-motion: reduce) {
  #aiDugme, #aiDugme .ai-hale, .ai-konusuyor .ai-dalga i, .ai-dusunce i { animation: none !important; }
  #aiPanel { transition: opacity .15s ease; transform: none; }
}


/* v20.3 SESLİ GİRİŞ */
#aiMik {
  border: 1px solid #d1d5db; border-radius: 10px; background: #fff;
  width: 42px; cursor: pointer; font-size: 1rem;
  -webkit-user-select: none; user-select: none; touch-action: none;
}
body.ai-dinliyor #aiMik,
body.ai-dinliyor #aiDugme {
  background: #fee2e2 !important; border-color: #ef4444 !important;
  animation: aiDinleme 1s ease-in-out infinite !important;
}
@keyframes aiDinleme {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.35); }
  50% { box-shadow: 0 0 0 12px rgba(239, 68, 68, 0); }
}
@media (prefers-reduced-motion: reduce) {
  body.ai-dinliyor #aiMik, body.ai-dinliyor #aiDugme { animation: none !important; }
}


@media (prefers-reduced-motion: reduce) {
  #aiDugme .ai-ic-cubuk { animation: none !important; }
}


/* v20.5 Sesli sohbet anahtarı */
.ai-sesli-sohbet {
  border: 1px solid #d1d5db; background: #fff; border-radius: 8px;
  padding: 2px 8px; cursor: pointer; font-size: 0.9rem; opacity: 0.55;
}
.ai-sesli-sohbet.acik {
  opacity: 1; border-color: #4f46e5;
  background: linear-gradient(120deg, #eef2ff, #e0f2fe);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.15);
}
