/* Custom styles for the SPA */

/* Fade transition for elements */
#chat-widget {
  transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

#chat-widget.hidden {
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
}

#chat-widget:not(.hidden) {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Typography matching MDN */
.prose {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
}

.prose h1,
.prose h2,
.prose h3 {
  font-weight: 700;
  letter-spacing: -0.02em;
}

.prose h1 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
}

.prose h2 {
  font-size: 1.5rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.prose p {
  margin-bottom: 1rem;
}

/* Message styles */
.message {
  display: flex;
  flex-direction: column;
  max-width: 80%;
}

.message.sent {
  align-self: flex-end;
}

.message.received {
  align-self: flex-start;
}

.message-content {
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  word-wrap: break-word;
  word-break: break-word;
  font-size: 0.875rem;
}

.message.sent .message-content {
  background-color: #005395;
  color: white;
  border-bottom-right-radius: 0;
}

.message.received .message-content {
  background-color: #e5e7eb;
  color: #111827;
  border-bottom-left-radius: 0;
}

.message-timestamp {
  font-size: 0.7rem;
  color: #6b7280;
  margin-top: 0.125rem;
}

.message.sent .message-timestamp {
  text-align: right;
}

.message-image {
  max-width: 200px;
  max-height: 150px;
  border-radius: 0.375rem;
  margin-top: 0.125rem;
  cursor: pointer;
}

.message-document {
  display: flex;
  align-items: center;
  padding: 0.375rem 0.5rem;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 0.25rem;
  margin-top: 0.125rem;
}

.message-document-icon {
  margin-right: 0.25rem;
}

.message-document-link {
  color: inherit;
  text-decoration: underline;
  font-size: 0.875rem;
}

/* Scrollbar styling */
#messages-container::-webkit-scrollbar {
  width: 4px;
}

#messages-container::-webkit-scrollbar-track {
  background: #f3f4f6;
}

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

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

/* Hide scrollbar for Firefox */
#messages-container {
  scrollbar-width: thin;
  scrollbar-color: #d1d5db #f3f4f6;
}

/* Folder archive styles */
.folder-archive {
  background-color: #f3f4f6;
  padding: 0.75rem;
  border-radius: 0.5rem;
  margin-top: 0.125rem;
}

.folder-archive-title {
  font-weight: 600;
  color: #374151;
  display: block;
  margin-bottom: 0.5rem;
}

.folder-archive-list {
  max-height: 150px;
  overflow-y: auto;
}

.folder-archive-item {
  padding: 0.25rem 0;
}

.folder-archive-link {
  color: #1e40af;
  text-decoration: none;
  font-size: 0.875rem;
}

.folder-archive-link:hover {
  text-decoration: underline;
}

/* Input disabled state */
#message-input:disabled,
#message-input-widget:disabled {
  background-color: #f3f4f6;
  cursor: not-allowed;
  opacity: 0.6;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  #chat-widget {
    width: 90vw;
    max-width: 350px;
    height: 50vh;
    max-height: 450px;
  }
}