/* Markdown Editor Styles - TipTap/ProseMirror */
.markdown-editor-wrapper {
  display: flex;
  flex-direction: column;
  position: relative;
}

.markdown-editor-wrapper.border-destructive {
  border-color: hsl(var(--destructive));
}

.markdown-editor-wrapper:focus-within {
  border-color: hsl(var(--primary)) !important;
}

.dark .markdown-editor-wrapper:focus-within {
  border-color: hsl(var(--accent-foreground)) !important;
}

.markdown-editor-wrapper > div {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  width: 100%;
}

.markdown-editor-wrapper .ProseMirror {
  outline: none !important;
  font-size: inherit;
  line-height: 24px;
  color: hsl(var(--foreground));
  background: transparent;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  flex: 1;
  min-height: 60px;
  cursor: text;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}

.markdown-editor-wrapper .ProseMirror:focus {
  outline: none !important;
}

.markdown-editor-wrapper:hover .ProseMirror,
.markdown-editor-wrapper .ProseMirror:focus {
  scrollbar-color: hsl(var(--muted-foreground) / 0.3) transparent;
}

/* Scrollbar styles */
.markdown-editor-wrapper .ProseMirror::-webkit-scrollbar {
  width: 8px;
}

.markdown-editor-wrapper .ProseMirror::-webkit-scrollbar-track {
  background: transparent;
}

.markdown-editor-wrapper .ProseMirror::-webkit-scrollbar-thumb {
  background-color: transparent;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.markdown-editor-wrapper:hover .ProseMirror::-webkit-scrollbar-thumb,
.markdown-editor-wrapper .ProseMirror:focus::-webkit-scrollbar-thumb {
  background-color: hsl(var(--muted-foreground) / 0.3);
}

.markdown-editor-wrapper:hover .ProseMirror::-webkit-scrollbar-thumb:hover,
.markdown-editor-wrapper .ProseMirror:focus::-webkit-scrollbar-thumb:hover {
  background-color: hsl(var(--muted-foreground) / 0.5);
}

/* Placeholder */
.markdown-editor-wrapper .ProseMirror p {
  margin: 0;
  min-height: 1.5em;
}

.markdown-editor-wrapper .ProseMirror p.is-empty:first-child::before {
  content: attr(data-placeholder);
  float: left;
  color: hsl(var(--muted-foreground));
  pointer-events: none;
  height: 0;
}

/* Typography */
.markdown-editor-wrapper .ProseMirror h1 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 1rem 0 0.5rem;
  line-height: 1.2;
  color: hsl(var(--foreground));
}

.markdown-editor-wrapper .ProseMirror h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 1rem 0 0.5rem;
  line-height: 1.2;
  color: hsl(var(--foreground));
}

.markdown-editor-wrapper .ProseMirror h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 1rem 0 0.5rem;
  line-height: 1.2;
  color: hsl(var(--foreground));
}

.markdown-editor-wrapper .ProseMirror h4 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0.5rem 0;
  color: hsl(var(--foreground));
}

.markdown-editor-wrapper .ProseMirror h5 {
  font-size: 0.875rem;
  font-weight: 600;
  margin: 0.5rem 0;
  color: hsl(var(--foreground));
}

.markdown-editor-wrapper .ProseMirror h6 {
  font-size: 0.75rem;
  font-weight: 600;
  margin: 0.5rem 0;
  color: hsl(var(--foreground));
}

.markdown-editor-wrapper .ProseMirror strong {
  font-weight: 600;
  color: hsl(var(--foreground));
}

.markdown-editor-wrapper .ProseMirror em {
  font-style: italic;
  color: hsl(var(--foreground));
}

/* Lists */
.markdown-editor-wrapper .ProseMirror ul,
.markdown-editor-wrapper .ProseMirror ol {
  list-style-position: outside;
  margin: 0.5rem 0;
  padding-left: 1.5rem;
  color: hsl(var(--foreground));
}

.markdown-editor-wrapper .ProseMirror ul {
  list-style-type: disc;
}

.markdown-editor-wrapper .ProseMirror ol {
  list-style-type: decimal;
}

.markdown-editor-wrapper .ProseMirror li {
  margin: 0.25rem 0;
  color: hsl(var(--foreground));
}

.markdown-editor-wrapper .ProseMirror li p {
  margin: 0;
  display: inline;
}

/* Code */
.markdown-editor-wrapper .ProseMirror code {
  background-color: hsl(var(--muted));
  color: hsl(var(--foreground));
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  font-size: 0.875em;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  font-weight: normal;
}

.markdown-editor-wrapper .ProseMirror pre {
  background-color: hsl(var(--muted));
  color: hsl(var(--foreground));
  padding: 0.75rem;
  border-radius: calc(var(--radius));
  overflow-x: auto;
  margin: 0.5rem 0;
}

.markdown-editor-wrapper .ProseMirror pre code {
  background: none;
  padding: 0;
  font-size: 0.875rem;
  color: inherit;
}

/* Blockquote */
.markdown-editor-wrapper .ProseMirror blockquote {
  border-left: 3px solid hsl(var(--border));
  padding-left: 1rem;
  margin: 0.5rem 0;
  color: hsl(var(--muted-foreground));
  font-style: italic;
}

/* Links */
.markdown-editor-wrapper .ProseMirror a {
  color: hsl(var(--primary));
  text-decoration: underline;
  cursor: pointer;
}

