<template>
  <div class="quill-content" v-html="content"></div>
</template>

<script setup>
import { onMounted, nextTick } from 'vue'

const props = defineProps({
  content: {
    type: String,
    default: ''
  }
})

// No necesitamos procesar fórmulas si Quill guarda HTML simple
</script>

<style scoped>
.quill-content {
  line-height: 1.6;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  font-size: 14px;
}

.quill-content :deep(p) {
  margin-bottom: 0.75em;
}

.quill-content :deep(h1) {
  font-size: 1.5em;
  margin: 1em 0 0.5em 0;
  font-weight: 600;
}

.quill-content :deep(h2) {
  font-size: 1.25em;
  margin: 1em 0 0.5em 0;
  font-weight: 600;
}

.quill-content :deep(h3) {
  font-size: 1.125em;
  margin: 1em 0 0.5em 0;
  font-weight: 600;
}

.quill-content :deep(ul),
.quill-content :deep(ol) {
  padding-left: 1.5em;
  margin: 0.5em 0;
}

.quill-content :deep(blockquote) {
  border-left: 4px solid #1890ff;
  margin: 1em 0;
  padding-left: 16px;
  color: #666;
  font-style: italic;
}

.quill-content :deep(code) {
  background-color: #f5f5f5;
  padding: 2px 4px;
  border-radius: 3px;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
}

.quill-content :deep(pre) {
  background-color: #282c34;
  color: #abb2bf;
  padding: 12px;
  border-radius: 6px;
  overflow-x: auto;
  margin: 1em 0;
}

.quill-content :deep(pre code) {
  background-color: transparent;
  color: inherit;
  padding: 0;
}

.quill-content :deep(table) {
  border-collapse: collapse;
  width: 100%;
  margin: 1em 0;
  border: 1px solid #ddd;
}

.quill-content :deep(th) {
  background-color: #fafafa;
  font-weight: 600;
  text-align: left;
}

.quill-content :deep(th),
.quill-content :deep(td) {
  border: 1px solid #ddd;
  padding: 8px 12px;
}

.quill-content :deep(img) {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin: 0.5em 0;
}

.quill-content :deep(a) {
  color: #1890ff;
  text-decoration: none;
}

.quill-content :deep(a:hover) {
  text-decoration: underline;
}
</style>