/* Yüzen Mutfak Asistanı (Chatbot) */
.td-chat-root {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 950;
  font-family: var(--font-body, "Outfit", "Segoe UI", sans-serif);
}

.td-chat-fab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 112px;
  height: 112px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.td-chat-fab:hover {
  transform: scale(1.05);
}

.td-chat-fab-icon {
  width: 112px;
  height: 112px;
  object-fit: contain;
  flex-shrink: 0;
}

.td-chat-fab-label {
  display: none;
}

.td-chat-window {
  position: fixed;
  right: 22px;
  bottom: 84px;
  width: min(390px, calc(100vw - 28px));
  height: min(580px, calc(100vh - 110px));
  display: flex;
  flex-direction: column;
  background: #fffaf2;
  border: 1px solid rgba(134, 58, 6, 0.24);
  border-radius: 24px;
  box-shadow: 0 24px 56px rgba(19, 8, 1, 0.26);
  overflow: hidden;
  z-index: 951;
}

.td-chat-window[hidden] {
  display: none;
}

.td-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: linear-gradient(135deg, var(--burnt, #B54E03), #8f3b02);
  color: var(--white, #fffefc);
}

.td-chat-header-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.td-chat-title {
  margin: 0;
  font-family: var(--font-display, "Kalam", cursive);
  font-size: 1.25rem;
  line-height: 1.15;
}

.td-chat-subtitle {
  margin: 0;
  font-size: 0.78rem;
  opacity: 0.9;
}

.td-chat-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.td-chat-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #fffefc;
  transition: background 0.15s ease;
}

.td-chat-icon-btn:hover {
  background: rgba(255, 255, 255, 0.28);
}

.td-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background:
    repeating-linear-gradient(
      to bottom,
      #fffaf2 0px,
      #fffaf2 29px,
      rgba(182, 100, 25, 0.08) 29px,
      rgba(182, 100, 25, 0.08) 30px
    );
}

.td-chat-msg {
  max-width: 88%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 0.92rem;
  line-height: 1.45;
  word-wrap: break-word;
}

.td-chat-msg--bot {
  align-self: flex-start;
  background: #ffffff;
  color: var(--ink, #130801);
  border: 1px solid rgba(134, 58, 6, 0.16);
  border-bottom-left-radius: 4px;
  box-shadow: 0 3px 10px rgba(19, 8, 1, 0.05);
}

.td-chat-msg--user {
  align-self: flex-end;
  background: var(--burnt, #B54E03);
  color: #fffefc;
  border-bottom-right-radius: 4px;
}

.td-chat-typing {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 11px 14px;
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  background: #ffffff;
  border: 1px solid rgba(134, 58, 6, 0.16);
}

.td-chat-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--burnt, #B54E03);
  opacity: 0.35;
  animation: tdChatPulse 1.1s infinite ease-in-out;
}

.td-chat-typing span:nth-child(2) {
  animation-delay: 0.18s;
}

.td-chat-typing span:nth-child(3) {
  animation-delay: 0.36s;
}

@keyframes tdChatPulse {
  0%, 80%, 100% {
    opacity: 0.3;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

.td-chat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 8px 14px 4px;
  background: #fffaf2;
  border-top: 1px solid rgba(134, 58, 6, 0.1);
}

.td-chat-chips:empty {
  display: none;
}

.td-chat-chip {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(181, 78, 3, 0.32);
  background: #f9ecd9;
  color: var(--brown, #863A06);
  font-size: 0.82rem;
  font-weight: 500;
  transition: all 0.15s ease;
}

.td-chat-chip:hover {
  background: var(--burnt, #B54E03);
  color: #fffefc;
  border-color: var(--burnt, #B54E03);
}

.td-chat-chip--yes {
  background: #e9f6ec;
  border-color: #2f855a;
  color: #22543d;
}

.td-chat-chip--yes:hover {
  background: #2f855a;
  color: #ffffff;
}

.td-chat-chip--no {
  background: #fdecec;
  border-color: #c53030;
  color: #9b2c2c;
}

.td-chat-chip--no:hover {
  background: #c53030;
  color: #ffffff;
}

.td-chat-form {
  display: flex;
  gap: 8px;
  padding: 10px 14px 14px;
  background: #fffaf2;
}

.td-chat-input {
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  border: 1px solid rgba(134, 58, 6, 0.28);
  border-radius: 999px;
  background: #ffffff;
  color: var(--ink, #130801);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
}

.td-chat-input:focus {
  border-color: var(--burnt, #B54E03);
  box-shadow: 0 0 0 3px rgba(181, 78, 3, 0.14);
}

.td-chat-send {
  padding: 10px 16px;
  border: none;
  border-radius: 999px;
  background: var(--burnt, #B54E03);
  color: #fffefc;
  font-weight: 600;
  font-size: 0.88rem;
  transition: background 0.15s ease;
}

.td-chat-send:hover:not(:disabled) {
  background: #964002;
}

.td-chat-send:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.td-chat-results {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.td-chat-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid rgba(134, 58, 6, 0.2);
  box-shadow: 0 4px 12px rgba(19, 8, 1, 0.06);
}

.td-chat-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.td-chat-card-title {
  margin: 0;
  font-family: var(--font-display, "Kalam", cursive);
  font-size: 1.05rem;
  color: var(--ink, #130801);
}

.td-chat-badge {
  flex-shrink: 0;
  padding: 3px 8px;
  border-radius: 999px;
  background: #f9ecd9;
  color: var(--burnt, #B54E03);
  font-size: 0.76rem;
  font-weight: 600;
}

.td-chat-card-meta {
  font-size: 0.78rem;
  color: var(--brown, #863A06);
}

.td-chat-card-missing {
  font-size: 0.78rem;
  color: #9b2c2c;
  background: #fff5f5;
  padding: 4px 8px;
  border-radius: 8px;
}

.td-chat-card-btn {
  align-self: flex-start;
  margin-top: 2px;
  padding: 6px 12px;
  border: none;
  border-radius: 999px;
  background: var(--burnt, #B54E03);
  color: #fffefc;
  font-size: 0.8rem;
  font-weight: 600;
}

.td-chat-card-btn:hover {
  background: #964002;
}

@media (max-width: 520px) {
  .td-chat-root {
    right: 14px;
    bottom: 14px;
  }

  .td-chat-fab {
    padding: 0;
  }

  .td-chat-window {
    right: 10px;
    left: 10px;
    bottom: 76px;
    width: auto;
    height: min(72vh, 540px);
  }
}
