* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    background-color: #0d1117;
    color: #c9d1d9;
    overflow: hidden;
}

.header {
    padding: 12px 24px;
    border-bottom: 1px solid #30363d;
    background-color: #161b22;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 100%;
}

.header h1 {
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    white-space: nowrap;
    border: 1px solid #30363d;
    border-radius: 6px;
    background-color: #21262d;
    color: #c9d1d9;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn:hover {
    background-color: #30363d;
    border-color: #8b949e;
}

.btn:active {
    background-color: #292e36;
}

.btn-danger {
    color: #f85149;
    border-color: #da3633;
}

.btn-danger:hover {
    background-color: #da3633;
    color: #ffffff;
}

.save-indicator {
    font-size: 13px;
    color: #57ab5a;
    opacity: 0;
    transition: opacity 0.3s ease;
    min-width: 70px;
    text-align: right;
}

.save-indicator.show {
    opacity: 1;
}

.save-indicator.saving {
    color: #f0883e;
}

.container {
    display: flex;
    height: calc(100vh - 60px);
}

.editor-pane, .preview-pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.editor-pane {
    border-right: 1px solid #30363d;
}

.pane-header {
    padding: 12px 24px;
    background-color: #161b22;
    border-bottom: 1px solid #30363d;
    font-size: 14px;
    font-weight: 600;
    color: #8b949e;
}

#editor {
    width: 100%;
    flex: 1;
    padding: 24px;
    border: none;
    outline: none;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 14px;
    line-height: 1.5;
    resize: none;
    background-color: #0d1117;
    color: #c9d1d9;
    overflow-y: auto;
}

.preview-pane {
    overflow-y: auto;
}

#preview {
    padding: 24px;
    min-height: 100%;
}

.markdown-body {
    box-sizing: border-box;
    min-width: 200px;
    max-width: 980px;
    margin: 0 auto;
    color-scheme: dark;
}

/* Styling for strikethrough */
.markdown-body del {
    text-decoration: line-through;
    opacity: 0.7;
}

/* Copy button for code blocks */
.markdown-body pre {
    position: relative;
}

.markdown-body pre:hover .copy-btn {
    opacity: 1;
}

.copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 4px 8px;
    font-size: 12px;
    background-color: #30363d;
    border: 1px solid #30363d;
    border-radius: 4px;
    color: #c9d1d9;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.copy-btn:hover {
    background-color: #40464d;
}

.copy-btn.copied {
    background-color: #238636;
    border-color: #238636;
    opacity: 1;
}

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

::-webkit-scrollbar-track {
    background: #161b22;
}

::-webkit-scrollbar-thumb {
    background: #30363d;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #40464d;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }

    .editor-pane {
        border-right: none;
        border-bottom: 1px solid #30363d;
        height: 50%;
    }

    .preview-pane {
        height: 50%;
    }

    .header-content {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .header-actions {
        width: 100%;
        justify-content: flex-start;
    }
}