/* AI Chat Integration Styles */
.ai-chat {
  margin-top: 18px;
  padding: 22px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 28px;
  background:
    radial-gradient(circle at 16% 0%, rgba(255,79,216,.12), transparent 20rem),
    radial-gradient(circle at 86% 10%, rgba(0,245,255,.10), transparent 18rem),
    linear-gradient(145deg, rgba(255,255,255,.07), rgba(255,255,255,.03));
  box-shadow: 0 26px 80px rgba(0,0,0,.4);
}

.chat-container {
  background:
    radial-gradient(circle at 16% 0%, rgba(255,79,216,.08), transparent 14rem),
    radial-gradient(circle at 86% 0%, rgba(0,245,255,.08), transparent 14rem),
    rgba(0, 0, 0, 0.20);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 22px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 320px;
  max-height: 440px;
}

.chat-counter {
  align-self: flex-start;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--muted);
  background: rgba(255,255,255,.05);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  white-space: nowrap;
}

.chat-display {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.msg {
  max-width: 85%;
  padding: 0.8rem 1.2rem;
  border-radius: 18px;
  font-size: 0.95rem;
  line-height: 1.5;
}

.msg.bot {
  align-self: flex-start;
  background: linear-gradient(135deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02));
  color: #f7f3ff;
  border: 1px solid rgba(255,255,255,0.1);
  border-bottom-left-radius: 4px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.msg.user {
  align-self: flex-end;
  background: linear-gradient(135deg, rgba(255,79,216,0.25), rgba(0,245,255,0.2));
  color: #fff;
  border: 1px solid rgba(255,255,255,0.14);
  border-bottom-right-radius: 4px;
  box-shadow: 0 12px 44px rgba(255,79,216,0.1);
}

.msg.thinking {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  color: var(--mint);
  letter-spacing: 0.05em;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.chat-input-row {
  display: flex;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.24);
  gap: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.chat-input-row input {
  flex: 1;
  min-width: 0;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 0.6rem 1rem;
  color: #fff;
  outline: none;
}

.chat-input-row input:focus {
  border-color: #00ffaa;
  box-shadow:
    0 0 0 3px rgba(0,245,255,.10),
    0 0 0 6px rgba(255,79,216,.06);
}

.chat-input-row .template-button {
  margin-top: 0;
  white-space: nowrap;
}

.chat-input-row input:disabled,
.chat-input-row .template-button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  filter: saturate(0.75);
}

@media (max-width: 680px) {
  .chat-input-row {
    flex-direction: column;
  }

  .msg {
    max-width: 100%;
  }
}

/* Custom Scrollbar for Chat */
.chat-display::-webkit-scrollbar {
  width: 4px;
}
.chat-display::-webkit-scrollbar-thumb {
  background: rgba(0, 255, 170, 0.2);
  border-radius: 10px;
}
