<script setup>
import { marked } from 'marked'
import { computed } from 'vue'
import readmeContent from '../../README.md?raw'

const htmlContent = computed(() => {
  return marked(readmeContent)
})
</script>

<template>
  <div class="readme-container glass-panel">
    <div class="markdown-body" v-html="htmlContent"></div>
  </div>
</template>

<style scoped>
.readme-container {
  padding: 2rem;
  max-width: 800px;
  margin: 0 auto;
}

.markdown-body :deep(h1) {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: var(--primary-accent);
}

.markdown-body :deep(h2) {
  font-size: 1.5rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 0.5rem;
  color: var(--text-strong);
}

.markdown-body :deep(h3) {
  font-size: 1.25rem;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  color: var(--text-strong);
}

.markdown-body :deep(p) {
  margin-bottom: 1rem;
  line-height: 1.6;
  color: var(--text-color);
}

.markdown-body :deep(ul) {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.markdown-body :deep(li) {
  margin-bottom: 0.5rem;
  color: var(--text-color);
}

.markdown-body :deep(a) {
  color: var(--primary-accent);
  text-decoration: none;
}

.markdown-body :deep(a:hover) {
  text-decoration: underline;
}

.markdown-body :deep(code) {
  background: rgba(255, 255, 255, 0.1);
  padding: 0.2em 0.4em;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.9em;
}

.markdown-body :deep(pre) {
  background: rgba(0, 0, 0, 0.3);
  padding: 1rem;
  border-radius: 8px;
  overflow-x: auto;
  margin-bottom: 1rem;
  border: 1px solid var(--glass-border);
}

.markdown-body :deep(pre code) {
  background: none;
  padding: 0;
  color: #e6e6e6;
}

.markdown-body :deep(hr) {
  border: none;
  border-top: 1px solid var(--glass-border);
  margin: 2rem 0;
}
</style>
