/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* iMessage-style chat improvements */
#messages::-webkit-scrollbar {
  width: 8px;
}

#messages::-webkit-scrollbar-track {
  background: transparent;
}

#messages::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 4px;
}

#messages::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

/* Smooth message bubble animations */
@keyframes messageSlideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message-bubble {
  animation: messageSlideIn 0.2s ease-out;
}

/* Better prose styling for assistant messages */
.prose-assistant {
  color: #1f2937;
}

.prose-assistant p {
  margin-top: 0.25rem;
  margin-bottom: 0.25rem;
}

.prose-assistant code {
  background-color: rgba(0, 0, 0, 0.05);
  padding: 0.125rem 0.25rem;
  border-radius: 0.25rem;
  font-size: 0.875em;
}

.prose-assistant pre {
  background-color: rgba(0, 0, 0, 0.05);
  border-radius: 0.5rem;
  padding: 0.75rem;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

/* Auto-resizing textarea */
textarea[data-chat-target="input"] {
  min-height: 40px;
  max-height: 120px;
  overflow-y: auto;
  transition: height 0.1s ease;
}

/* Hide scrollbar in textarea */
textarea[data-chat-target="input"]::-webkit-scrollbar {
  display: none;
}

textarea[data-chat-target="input"] {
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;  /* Firefox */
}

/* Typing indicator animation */
@keyframes typing-dot-bounce {
  0%, 40%, 100% {
    transform: translateY(0);
  }
  20% {
    transform: translateY(-0.25rem);
  }
}

.animate-typing-dot-bounce {
  animation: typing-dot-bounce 1.25s ease-out infinite;
}

/* Shared document prose styling */
.prose-document {
  color: #1f2937;
  font-size: 0.875rem;
  line-height: 1.6;
}

.prose-document h1 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 1.25rem;
  margin-bottom: 0.75rem;
  color: #111827;
}

.prose-document h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  color: #111827;
}

.prose-document h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-top: 0.875rem;
  margin-bottom: 0.375rem;
  color: #111827;
}

.prose-document p {
  margin-top: 0.625rem;
  margin-bottom: 0.625rem;
}

.prose-document ul, .prose-document ol {
  margin-top: 0.625rem;
  margin-bottom: 0.625rem;
  padding-left: 1.25rem;
}

.prose-document li {
  margin-top: 0.25rem;
  margin-bottom: 0.25rem;
}

.prose-document ul {
  list-style-type: disc;
}

.prose-document ol {
  list-style-type: decimal;
}

.prose-document code {
  background-color: #f3f4f6;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  font-size: 0.875em;
  font-family: ui-monospace, SFMono-Regular, monospace;
}

.prose-document pre {
  background-color: #1f2937;
  color: #f9fafb;
  border-radius: 0.5rem;
  padding: 1rem;
  margin-top: 1rem;
  margin-bottom: 1rem;
  overflow-x: auto;
}

.prose-document pre code {
  background-color: transparent;
  padding: 0;
  color: inherit;
}

.prose-document blockquote {
  border-left: 4px solid #d1d5db;
  padding-left: 1rem;
  margin-top: 1rem;
  margin-bottom: 1rem;
  color: #4b5563;
  font-style: italic;
}

.prose-document table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.75rem;
  margin-bottom: 0.75rem;
  font-size: 0.8125rem;
}

.prose-document th, .prose-document td {
  border: 1px solid #e5e7eb;
  padding: 0.375rem 0.5rem;
  text-align: left;
}

.prose-document th {
  background-color: #f9fafb;
  font-weight: 600;
}

.prose-document a {
  color: #2563eb;
  text-decoration: underline;
}

.prose-document a:hover {
  color: #1d4ed8;
}

.prose-document hr {
  border: 0;
  border-top: 1px solid #e5e7eb;
  margin-top: 1rem;
  margin-bottom: 1rem;
}

.prose-document strong {
  font-weight: 600;
}

.prose-document em {
  font-style: italic;
}
