/* =================================================================
 * EDITOR CSS - Content Editor Styles
 * FEATURE-003: Content Editor
 * ================================================================= */

/* =================================================================
 * EDITOR TEXTAREA
 * ================================================================= */
.content-editor-textarea {
    width: 100%;
    height: 100%;
    min-height: 400px;
    font-family: 'SF Mono', Monaco, 'Cascadia Mono', 'Roboto Mono', Consolas, monospace;
    font-size: 14px;
    line-height: 1.6;
    padding: 1rem;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    resize: vertical;
    background-color: #fff;
}

.content-editor-textarea:focus {
    outline: none;
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.editor-actions .btn {
    font-size: 0.875rem;
}

/* =================================================================
 * MARKDOWN BODY STYLES - FEATURE-002
 * ================================================================= */
.markdown-body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    word-wrap: break-word;
}

.markdown-body h1, .markdown-body h2, .markdown-body h3,
.markdown-body h4, .markdown-body h5, .markdown-body h6 {
    margin-top: 24px;
    margin-bottom: 16px;
    font-weight: 600;
    line-height: 1.25;
}

.markdown-body h1 { font-size: 2em; border-bottom: 1px solid #eaecef; padding-bottom: 0.3em; }
.markdown-body h2 { font-size: 1.5em; border-bottom: 1px solid #eaecef; padding-bottom: 0.3em; }
.markdown-body h3 { font-size: 1.25em; }
.markdown-body h4 { font-size: 1em; }
.markdown-body h5 { font-size: 0.875em; }
.markdown-body h6 { font-size: 0.85em; color: #6a737d; }

.markdown-body p { margin-top: 0; margin-bottom: 16px; }

.markdown-body code {
    padding: 0.2em 0.4em;
    margin: 0;
    font-size: 85%;
    background-color: rgba(27, 31, 35, 0.05);
    border-radius: 6px;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

.markdown-body pre {
    padding: 16px;
    overflow: auto;
    font-size: 85%;
    line-height: 1.45;
    background-color: #f6f8fa;
    border-radius: 6px;
}

.markdown-body pre code {
    padding: 0;
    margin: 0;
    font-size: 100%;
    background-color: transparent;
    border-radius: 0;
}

.markdown-body blockquote {
    padding: 0 1em;
    color: #6a737d;
    border-left: 0.25em solid #dfe2e5;
    margin: 0 0 16px 0;
}

.markdown-body ul, .markdown-body ol {
    padding-left: 2em;
    margin-top: 0;
    margin-bottom: 16px;
}

.markdown-body li + li { margin-top: 0.25em; }

.markdown-body table {
    border-spacing: 0;
    border-collapse: collapse;
    margin-bottom: 16px;
    width: 100%;
}

.markdown-body table th, .markdown-body table td {
    padding: 6px 13px;
    border: 1px solid #dfe2e5;
}

.markdown-body table th { font-weight: 600; background-color: #f6f8fa; }
.markdown-body table tr:nth-child(2n) { background-color: #f6f8fa; }

.markdown-body hr {
    height: 0.25em;
    padding: 0;
    margin: 24px 0;
    background-color: #e1e4e8;
    border: 0;
}

.markdown-body a { color: #0366d6; text-decoration: none; }
.markdown-body a:hover { text-decoration: underline; }

.markdown-body img { max-width: 100%; box-sizing: border-box; }

/* Mermaid diagrams */
.mermaid { text-align: center; margin: 16px 0; }

/* =================================================================
 * CODE VIEWER (non-markdown)
 * ================================================================= */
.code-viewer {
    background-color: #f6f8fa;
    border-radius: 6px;
    padding: 16px;
    overflow: auto;
}

.code-viewer pre {
    margin: 0;
    padding: 0;
    background: transparent;
}

/* HTML Preview Styles */
.html-preview {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 400px;
}

.html-preview-toolbar {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    flex-shrink: 0;
}

.html-preview-iframe {
    flex: 1;
    width: 100%;
    border: none;
    background: white;
    min-height: 300px;
}
