body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f4f4f4;
}

.dark-mode-toggle {
    position: absolute;
    top: 20px;
    left: 20px;
    padding: 10px;
    background: #DAA520;
    color: black;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.dark-mode-toggle:hover {
    background: #B8860B;
}

body.dark-mode {
    background-color: #222;
    color: #fff;
}

body.dark-mode .container {
    background: #333;
    color: #fff;
}

body.dark-mode textarea {
    background: #444;
    color: #fff;
    border: 1px solid #666;
}

body.dark-mode #toggle-preview {
    background: #555;
    color: #fff;
}

body.dark-mode #toggle-preview:hover {
    background: #666;
}

.container {
    display: flex;
    height: calc(100vh - 40px);
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.editor-container, .preview-container {
    width: 50%;
    padding: 20px;
    overflow-y: auto;
}

textarea {
    width: 100%;
    height: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: none;
    box-sizing: border-box;
    font-family: monospace;
}

#preview-output {
    width: 100%;
    height: 100%;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    box-sizing: border-box;
}

#toggle-preview {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 10px 15px;
    background: #DAA520;
    color: black;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

@media (max-width: 800px) {
    .container {
        flex-direction: column;
    }
    .editor-container, .preview-container {
        width: 100%;
        height: 50%;
    }
    .preview-container {
        display: none;
    }
    #toggle-preview {
        display: block;
    }
}
