/* --- Markdown Preview Wrapper --- */
#mp-wrapper {
    font-family: 'Press Start 2P', monospace;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 1100px; /* Wide format for split screen */
    margin: 0 auto;
    background-color: #111827;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    border: 2px solid #374151;
    color: white;
}

/* --- Header / Toolbar --- */
.mp-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    background-color: #1f2937;
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid #374151;
}

.mp-title {
    color: #FBBF24; /* Amber */
    font-size: 1rem;
    text-shadow: 2px 2px 0 #000;
}

.mp-actions {
    display: flex;
    gap: 10px;
}

.mp-btn {
    padding: 8px 12px;
    font-family: inherit;
    font-size: 0.6rem;
    text-transform: uppercase;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.1s ease;
    border-bottom: 3px solid rgba(0,0,0,0.3);
}

.mp-btn:active {
    transform: translateY(3px);
    border-bottom: none;
    margin-top: 3px;
}

.mp-btn-load { background-color: #3b82f6; color: white; border-bottom-color: #1d4ed8; }
.mp-btn-copy { background-color: #10b981; color: white; border-bottom-color: #047857; }
.mp-btn-clear { background-color: #ef4444; color: white; border-bottom-color: #b91c1c; }

/* --- Split Pane Area --- */
.mp-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 600px;
    gap: 15px;
}

@media (min-width: 768px) {
    .mp-container {
        flex-direction: row;
    }
}

/* --- Editor Pane --- */
.mp-pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0; /* Fix flex scrolling */
}

.mp-label {
    font-size: 0.7rem;
    color: #9ca3af;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.mp-textarea {
    flex-grow: 1;
    background-color: #050505;
    color: #d1d5db;
    border: 1px solid #333;
    padding: 15px;
    font-family: 'Press Start 2P', monospace, sans-serif;
    font-size: 0.9rem;
    line-height: 1.6;
    border-radius: 6px;
    resize: none;
    outline: none;
    transition: border-color 0.2s;
}

.mp-textarea:focus {
    border-color: #FBBF24;
}

/* --- Preview Pane --- */
.mp-preview-window {
    flex-grow: 1;
    background-color: #ffffff;
    color: #1f2937;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 20px;
    overflow-y: auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    line-height: 1.6;
}

/* Markdown Content Styling (Prose) */
.mp-preview-window h1 { font-size: 2em; border-bottom: 1px solid #eaecef; margin-bottom: 16px; padding-bottom: 0.3em; font-weight: bold; }
.mp-preview-window h2 { font-size: 1.5em; border-bottom: 1px solid #eaecef; margin-bottom: 16px; padding-bottom: 0.3em; margin-top: 24px; font-weight: bold; }
.mp-preview-window h3 { font-size: 1.25em; margin-top: 24px; margin-bottom: 16px; font-weight: bold; }
.mp-preview-window p { margin-bottom: 16px; }
.mp-preview-window ul, .mp-preview-window ol { padding-left: 2em; margin-bottom: 16px; }
.mp-preview-window ul { list-style-type: disc; }
.mp-preview-window ol { list-style-type: decimal; }
.mp-preview-window blockquote { margin: 0 0 16px; border-left: 0.25em solid #dfe2e5; padding: 0 1em; color: #6a737d; }
.mp-preview-window code { padding: 0.2em 0.4em; margin: 0; font-size: 85%; background-color: rgba(27,31,35,0.05); border-radius: 3px; font-family: monospace; }
.mp-preview-window pre { padding: 16px; overflow: auto; font-size: 85%; line-height: 1.45; background-color: #f6f8fa; border-radius: 3px; margin-bottom: 16px; }
.mp-preview-window pre code { background-color: transparent; padding: 0; }
.mp-preview-window hr { height: 0.25em; padding: 0; margin: 24px 0; background-color: #e1e4e8; border: 0; }
.mp-preview-window a { color: #0366d6; text-decoration: none; }
.mp-preview-window a:hover { text-decoration: underline; }
.mp-preview-window img { max-width: 100%; box-sizing: content-box; background-color: #fff; }

/* Dark Mode Toggle for Preview (Optional future feature, current is Light Paper style) */

/* Mobile Responsiveness */
@media (max-width: 768px) {
    #mp-wrapper { padding: 10px; }
    .mp-container { height: auto; }
    .mp-textarea, .mp-preview-window { height: 300px; }
}