/* TipTap Editor Styling */
.tiptap {
  outline: none;
  padding: 1rem;
  min-height: 120px;
  font-size: 14px;
  line-height: 1.6;
  color: #374151;
}

/* Placeholder styling */
.tiptap p.is-editor-empty:first-child::before {
  content: attr(data-placeholder);
  float: left;
  color: #9ca3af;
  pointer-events: none;
  height: 0;
}

/* Headings */
.tiptap h1 {
  font-size: 2rem;
  font-weight: 700;
  margin: 1.5rem 0 1rem 0;
  line-height: 1.2;
  color: #1f2937;
}

.tiptap h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 1.25rem 0 0.75rem 0;
  line-height: 1.3;
  color: #1f2937;
}

.tiptap h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 1rem 0 0.5rem 0;
  line-height: 1.4;
  color: #1f2937;
}

.tiptap h4,
.tiptap h5,
.tiptap h6 {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0.75rem 0 0.5rem 0;
  line-height: 1.4;
  color: #1f2937;
}

/* Paragraphs */
.tiptap p {
  margin: 0.75rem 0;
  line-height: 1.6;
}

.tiptap p:first-child {
  margin-top: 0;
}

.tiptap p:last-child {
  margin-bottom: 0;
}

/* Text formatting */
.tiptap strong {
  font-weight: 600;
}

.tiptap em {
  font-style: italic;
}

.tiptap u {
  text-decoration: underline;
}

.tiptap s {
  text-decoration: line-through;
}

/* Links */
.tiptap a {
  color: #3b82f6;
  text-decoration: underline;
  cursor: pointer;
  transition: color 0.2s ease;
}

.tiptap a:hover {
  color: #1d4ed8;
}

/* Lists */
.tiptap ul {
  list-style-type: disc;
  margin: 0.75rem 0;
  padding-left: 1.5rem;
}

.tiptap ol {
  list-style-type: decimal;
  margin: 0.75rem 0;
  padding-left: 1.5rem;
}

.tiptap li {
  margin: 0.25rem 0;
  line-height: 1.6;
}

.tiptap li p {
  margin: 0;
}

/* Nested lists */
.tiptap ul ul,
.tiptap ol ol,
.tiptap ul ol,
.tiptap ol ul {
  margin: 0.25rem 0;
}

/* Images */
.tiptap img {
  max-width: 100%;
  height: auto;
  border-radius: 0.375rem;
  margin: 1rem 0;
  display: block;
}

/* Blockquotes */
.tiptap blockquote {
  border-left: 4px solid #e5e7eb;
  padding-left: 1rem;
  margin: 1rem 0;
  font-style: italic;
  color: #6b7280;
}

/* Code */
.tiptap code {
  background-color: #f3f4f6;
  color: #1f2937;
  padding: 0.125rem 0.25rem;
  border-radius: 0.25rem;
  font-family: "Monaco", "Menlo", "Ubuntu Mono", monospace;
  font-size: 0.875em;
}

.tiptap pre {
  background-color: #f3f4f6;
  color: #1f2937;
  padding: 1rem;
  border-radius: 0.5rem;
  margin: 1rem 0;
  overflow-x: auto;
  font-family: "Monaco", "Menlo", "Ubuntu Mono", monospace;
  font-size: 0.875rem;
  line-height: 1.4;
}

.tiptap pre code {
  background: none;
  padding: 0;
  border-radius: 0;
  font-size: inherit;
}

/* Text alignment */
.tiptap .text-left {
  text-align: left;
}

.tiptap .text-center {
  text-align: center;
}

.tiptap .text-right {
  text-align: right;
}

.tiptap .text-justify {
  text-align: justify;
}

/* Horizontal rule */
.tiptap hr {
  border: none;
  border-top: 2px solid #e5e7eb;
  margin: 2rem 0;
}

/* Tables */
.tiptap table {
  border-collapse: collapse;
  margin: 1rem 0;
  width: 100%;
}

.tiptap table td,
.tiptap table th {
  border: 1px solid #e5e7eb;
  padding: 0.5rem;
  text-align: left;
  vertical-align: top;
}

.tiptap table th {
  background-color: #f9fafb;
  font-weight: 600;
}

/* Focus styles */
.tiptap:focus {
  outline: none;
}

/* Selection styles */
.tiptap ::selection {
  background-color: #dbeafe;
}

/* Indent support */
.tiptap [data-indent="1"] {
  margin-left: 1.5rem;
}

.tiptap [data-indent="2"] {
  margin-left: 3rem;
}

.tiptap [data-indent="3"] {
  margin-left: 4.5rem;
}

.tiptap [data-indent="4"] {
  margin-left: 6rem;
}

.tiptap [data-indent="5"] {
  margin-left: 7.5rem;
}

/* Empty state */
.tiptap.is-empty::before {
  content: attr(data-placeholder);
  color: #9ca3af;
  pointer-events: none;
}

/* Disabled state */
.tiptap[contenteditable="false"] {
  opacity: 0.6;
  cursor: not-allowed;
}
