:root {
    --background-primary: #202020;
    --background-secondary: #282828;
    --text-normal: #dcddde;
    --text-muted: #999;
    --text-faint: #666;
    --text-accent: #7f6df2;
    --interactive-accent: #7f6df2;
    --background-modifier-border: #333;
    --background-modifier-form-field: rgba(0, 0, 0, 0.2);
    --scrollbar-bg: rgba(255, 255, 255, 0.05);
    --scrollbar-thumb-bg: rgba(255, 255, 255, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-normal);
    background-color: var(--background-primary);
    margin: 0;
    padding: 0;
    display: flex;
    height: 100vh;
    overflow: hidden;
}

main {
    flex-grow: 1;
    overflow-y: auto;
    padding-bottom: 30vh;
}

.content {
    padding: 20px 40px;
    max-width: 800px;
    margin: 0 auto;
}

/* Markdown content styling */
h1, h2, h3, h4, h5, h6 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    color: var(--text-normal);
    font-weight: 600;
}

h1 {
    font-size: 2em;
    border-bottom: 1px solid var(--background-modifier-border);
    padding-bottom: 0.3em;
}

h2 {
    font-size: 1.5em;
    border-bottom: 1px solid var(--background-modifier-border);
    padding-bottom: 0.3em;
}

p {
    margin: 1em 0;
}

main a {
    color: var(--text-accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

code {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    background-color: rgba(0, 0, 0, 0.2);
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-size: 0.9em;
}

pre {
    border-radius: 4px;
    overflow-x: auto;
}

blockquote {
    border-left: 4px solid var(--background-modifier-border);
    margin: 1em 0;
    padding: 0 1em;
    color: var(--text-muted);
}

img {
    max-width: 100%;
    height: auto;
}

table {
    border-collapse: collapse;
    width: 100%;
    margin: 1em 0;
}

table, th, td {
    border: 1px solid var(--background-modifier-border);
}

th, td {
    padding: 8px 12px;
    text-align: left;
}

th {
    background-color: rgba(0, 0, 0, 0.1);
}

hr {
    border: none;
    border-top: 1px solid var(--background-modifier-border);
    margin: 2em 0;
}

.task-list-item {
    list-style-type: none;
}

.task-list-item-checkbox {
    margin-right: 0.5em;
}

.wiki-link {
    color: var(--text-accent);
    text-decoration: none;
    border-bottom: 1px dashed var(--text-accent);
}

.wiki-link:hover {
    text-decoration: none;
    border-bottom: 1px solid var(--text-accent);
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--scrollbar-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb-bg);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Embedded content */
.embedded-image {
    max-width: 100%;
    height: auto;
    max-height: 40vh;
    border-radius: 4px;
    margin: 10px 0;
}

.embedded-note {
    border: 1px solid var(--background-modifier-border);
    border-radius: 4px;
    padding: 10px 15px;
    margin: 10px 0;
    background-color: rgba(0, 0, 0, 0.1);
}

.embedded-note-error {
    border: 1px solid #ff5555;
    border-radius: 4px;
    padding: 10px 15px;
    margin: 10px 0;
    background-color: rgba(255, 85, 85, 0.1);
    color: #ff5555;
}

audio, video {
    width: 100%;
    margin: 10px 0;
    border-radius: 4px;
}

.embedded-file {
    display: inline-block;
    padding: 8px 12px;
    margin: 10px 0;
    background-color: rgba(127, 109, 242, 0.1);
    border-radius: 4px;
    color: var(--text-accent);
    text-decoration: none;
}

.embedded-file:hover {
    background-color: rgba(127, 109, 242, 0.2);
    text-decoration: none;
}

/* PDF embed */
embed[type="application/pdf"] {
    margin: 10px 0;
    border-radius: 4px;
    border: 1px solid var(--background-modifier-border);
}
