* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #2c3e50;
}

.editor-container {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.input-section, .preview-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: white;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 15px;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

h2 {
    font-size: 1.2rem;
    color: #2c3e50;
}

#editor {
    flex: 1;
    min-height: 500px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    resize: none;
}

#preview {
    flex: 1;
    min-height: 500px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow-y: auto;
    background-color: white;
}

button {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

button:hover {
    background-color: #c0392b;
}

/* Markdown Styling */
#preview h1 {
    font-size: 2em;
    margin: 0.67em 0;
    text-align: left;
}

#preview h2 {
    font-size: 1.5em;
    margin: 0.83em 0;
}

#preview h3 {
    font-size: 1.17em;
    margin: 1em 0;
}

#preview h4 {
    font-size: 1em;
    margin: 1.33em 0;
}

#preview h5 {
    font-size: 0.83em;
    margin: 1.67em 0;
}

#preview h6 {
    font-size: 0.67em;
    margin: 2.33em 0;
}

#preview p {
    margin: 1em 0;
}

#preview ul, #preview ol {
    margin: 1em 0;
    padding-left: 2em;
}

#preview blockquote {
    margin: 1em 0;
    padding-left: 1em;
    border-left: 4px solid #ddd;
    color: #666;
}

#preview pre {
    background-color: #f6f8fa;
    border-radius: 3px;
    padding: 16px;
    overflow: auto;
    margin: 1em 0;
}

#preview code {
    font-family: 'Courier New', Courier, monospace;
    background-color: #f6f8fa;
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-size: 85%;
}

#preview pre code {
    padding: 0;
    background-color: transparent;
}

#preview a {
    color: #0366d6;
    text-decoration: none;
}

#preview a:hover {
    text-decoration: underline;
}

#preview img {
    max-width: 100%;
    height: auto;
}

#preview table {
    border-collapse: collapse;
    width: 100%;
    margin: 1em 0;
}

#preview th, #preview td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}

#preview th {
    background-color: #f6f8fa;
}

/* Responsive Design */
@media (max-width: 768px) {
    .editor-container {
        flex-direction: column;
    }
    
    .input-section, .preview-section {
        width: 100%;
    }
    
    #editor, #preview {
        min-height: 300px;
    }
}