/* YDS365 Asistan (sağ altta sohbet) — renkler styles.css'teki tema değişkenlerinden gelir. */

/* Sağ altta: "Asistan" etiketi + yuvarlak lale simgesi */
.ast-fab {
  position: fixed;
  right: 16px;
  bottom: calc(84px + env(safe-area-inset-bottom));
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  cursor: pointer;
}

.ast-fab-label {
  padding: 7px 14px;
  border: 1px solid var(--gold);
  border-radius: 999px;
  background: linear-gradient(135deg, var(--cobalt), #0F4C5C);
  color: var(--side-text);
  font-size: 0.88rem;
  font-weight: 700;
  box-shadow: 0 12px 24px -14px rgba(11, 34, 56, 0.6);
}

.ast-fab-icon {
  display: block;
  width: 62px;
  height: 62px;
  border: 2px solid var(--gold);
  border-radius: 50%;
  background: #FFFFFF;
  overflow: hidden;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--gold) 22%, transparent), 0 16px 30px -14px rgba(11, 34, 56, 0.6);
  transition: transform 0.15s;
}

.ast-fab-icon img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ast-fab:hover .ast-fab-icon { transform: scale(1.06); }
.ast-fab:hover .ast-fab-label { border-color: var(--side-accent); }

body.ast-open .ast-fab { display: none; }

@media (min-width: 900px) {
  .ast-fab { right: 28px; bottom: 28px; }
}

.ast-panel {
  position: fixed;
  right: 16px;
  bottom: calc(84px + env(safe-area-inset-bottom));
  z-index: 90;
  display: flex;
  flex-direction: column;
  width: min(390px, calc(100vw - 32px));
  height: min(560px, calc(100dvh - 170px));
  border: 1px solid var(--gold);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 30px 60px -24px rgba(11, 34, 56, 0.55);
  overflow: hidden;
}

@media (min-width: 900px) {
  .ast-panel { right: 28px; bottom: 28px; height: min(600px, calc(100dvh - 56px)); }
}

.ast-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 10px 12px 16px;
  background: linear-gradient(135deg, var(--cobalt), #0F4C5C);
  color: var(--side-text);
  --focus-ring: var(--side-accent);
}

.ast-avatar { flex-shrink: 0; width: 38px; height: 38px; border: 2px solid var(--gold); border-radius: 50%; background: #FFFFFF; object-fit: cover; }
.ast-head-text { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.25; }
.ast-head-text strong { font-family: var(--font-display); font-size: 1.05rem; font-weight: 600; }
.ast-head-text span { font-size: 0.72rem; color: var(--side-muted); }

.ast-icon-btn {
  min-width: 40px;
  min-height: 40px;
  border: none;
  border-radius: 10px;
  background: none;
  color: var(--side-text);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.ast-icon-btn:hover { background: rgba(251, 247, 238, 0.1); }
.ast-close { font-size: 1.5rem; line-height: 1; }

.ast-messages { flex: 1; display: flex; flex-direction: column; gap: 10px; padding: 14px; overflow-y: auto; background: var(--bg); }

.ast-msg {
  max-width: 88%;
  padding: 10px 12px;
  border-radius: 16px;
  font-size: 0.9rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.ast-msg p { margin: 0 0 6px; }
.ast-msg p:last-child { margin-bottom: 0; }
.ast-list { margin: 2px 0 6px; padding-left: 18px; }
.ast-list:last-child { margin-bottom: 0; }

.ast-msg.is-user { align-self: flex-end; border-bottom-right-radius: 4px; background: var(--btn-primary-bg); color: var(--on-primary); }
.ast-msg.is-assistant { align-self: flex-start; border: 1px solid var(--border); border-bottom-left-radius: 4px; background: var(--surface); color: var(--text); }
.ast-msg.is-error { border-color: color-mix(in srgb, var(--error) 45%, var(--border)); color: var(--text-subtle); }

.ast-typing { display: inline-flex; gap: 4px; }
.ast-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--text-subtle); animation: ast-dot 1.2s infinite ease-in-out; }
.ast-typing span:nth-child(2) { animation-delay: 0.15s; }
.ast-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes ast-dot {
  0%, 80%, 100% { opacity: 0.3; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}

@media (prefers-reduced-motion: reduce) { .ast-typing span { animation: none; } }

.ast-chips { display: flex; gap: 6px; padding: 8px 12px 0; overflow-x: auto; scrollbar-width: none; background: var(--surface); }
.ast-chip {
  flex: none;
  padding: 6px 12px;
  border: 1px solid var(--primary);
  border-radius: 999px;
  background: var(--surface);
  color: var(--primary-text);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.ast-chip:hover { background: var(--primary-soft); }

.ast-form { display: flex; gap: 8px; padding: 10px 12px; background: var(--surface); }
.ast-form input { flex: 1; min-width: 0; }
.ast-form .btn { min-height: 48px; padding: 0 16px; }
.ast-foot { margin: 0; padding: 0 14px 10px; font-size: 0.68rem; color: var(--text-subtle); background: var(--surface); }
