.wysiwyg-editor {
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    background: var(--bs-body-bg);
    margin-bottom: 1rem;
}

.wysiwyg-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    padding: 0.75rem;
    background: var(--bs-secondary-bg);
    border-bottom: 1px solid #e2e8f0;
    border-top-left-radius: 0.5rem;
    border-top-right-radius: 0.5rem;
}

.wysiwyg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 0.375rem;
    background: transparent;
    color: var(--bs-body-color);
    cursor: pointer;
    transition: all 0.2s;
}

.wysiwyg-btn:hover {
    background: var(--bs-tertiary-bg);
    border-color: #cbd5e1;
}

.wysiwyg-btn.active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.wysiwyg-btn:active {
    transform: scale(0.95);
}

.wysiwyg-btn svg {
    width: 16px;
    height: 16px;
}

.wysiwyg-separator {
    width: 1px;
    height: 32px;
    background: #e2e8f0;
    margin: 0 0.25rem;
}

.wysiwyg-content {
    min-height: 300px;
    padding: 1rem;
    outline: none;
    overflow-y: auto;
    max-height: 600px;
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Remove scrollbar for article viewing */
article .wysiwyg-content,
.article-content .wysiwyg-content {
    min-height: unset;
    max-height: unset;
    overflow-y: visible;
    padding: 0;
}

.wysiwyg-content:focus {
    border-color: #3b82f6;
}

.wysiwyg-content h1 {
    font-size: 2rem;
    font-weight: 700;
    margin: 1.5rem 0 1rem;
    line-height: 1.2;
}

.wysiwyg-content h2 {
    font-size: 1.75rem;
    font-weight: 600;
    margin: 1.25rem 0 0.875rem;
    line-height: 1.3;
}

.wysiwyg-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 1rem 0 0.75rem;
    line-height: 1.4;
}

.wysiwyg-content h4 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0.875rem 0 0.625rem;
    line-height: 1.4;
}

.wysiwyg-content p {
    margin: 0.75rem 0;
}

.wysiwyg-content ul,
.wysiwyg-content ol {
    margin: 0.75rem 0;
    padding-left: 2rem;
}

.wysiwyg-content li {
    margin: 0.25rem 0;
}

.wysiwyg-content blockquote {
    margin: 1rem 0;
    padding: 0.75rem 1rem;
    border-left: 4px solid #3b82f6;
    background: var(--bs-secondary-bg);
    font-style: italic;
}

.wysiwyg-content pre {
    margin: 1rem 0;
    padding: 1rem;
    background: var(--bs-secondary-bg);
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    overflow-x: auto;
}

.wysiwyg-content code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.875rem;
    background: var(--bs-secondary-bg);
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
}

.wysiwyg-content pre code {
    padding: 0;
    background: transparent;
}

.wysiwyg-content a {
    color: #3b82f6;
    text-decoration: underline;
}

.wysiwyg-content a:hover {
    color: #2563eb;
}

.wysiwyg-content img {
    max-width: 100%;
    height: auto;
    border-radius: 0.375rem;
    margin: 1rem 0;
}

.wysiwyg-content strong,
.wysiwyg-content b {
    font-weight: 700;
}

.wysiwyg-content em,
.wysiwyg-content i {
    font-style: italic;
}

.wysiwyg-content u {
    text-decoration: underline;
}

.wysiwyg-content strike,
.wysiwyg-content s {
    text-decoration: line-through;
}

/* Dark mode adjustments */
[data-bs-theme="dark"] .wysiwyg-editor {
    border-color: #374151;
}

[data-bs-theme="dark"] .wysiwyg-toolbar {
    border-color: #374151;
}

[data-bs-theme="dark"] .wysiwyg-btn:hover {
    background: #374151;
    border-color: #4b5563;
}

[data-bs-theme="dark"] .wysiwyg-separator {
    background: #374151;
}

[data-bs-theme="dark"] .wysiwyg-content pre,
[data-bs-theme="dark"] .wysiwyg-content code {
    background: #1f2937;
    border-color: #374151;
}

[data-bs-theme="dark"] .wysiwyg-content blockquote {
    background: #1f2937;
}
