/**
 * Admin-specific styles for the Spraynt Markdown to HTML plugin.
 */

#smth-editor-container {
    display: flex;
    border: 1px solid #949494;
    background-color: #f0f0f1;
    overflow: hidden;
    /* Prevent resizer from causing overflow */
}

#smth-editor-toolbar {
    background-color: #f0f0f1;
    border: 1px solid #949494;
    border-bottom: none;
    padding: 5px;
}

#smth-editor-wrapper,
#smth-preview-wrapper {
    width: 50%;
    /* Initial width */
    min-width: 150px;
    /* Prevent panels from collapsing */
    position: relative;
    /* Needed for child elements if any were absolutely positioned */
}

#smth-resizer {
    flex: 0 0 10px;
    /* Don't grow or shrink, fixed width */
    cursor: col-resize;
    background-color: #dcdcde;
    border-left: 1px solid #c8c8c8;
    border-right: 1px solid #c8c8c8;
}

#smth-resizer:hover {
    background-color: #c8c8c8;
}

#smth-editor-toolbar .button {
    padding: 2px 6px;
    height: auto;
    line-height: 1.5;
}

#smth-editor-toolbar .button .dashicons {
    vertical-align: middle;
}

#smth_content_editor {
    width: 100%;
    box-sizing: border-box;
    /* Ensures padding and border are included in the width */
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    border-top: none;
    margin: 0;
}

.smth-preview-header {
    font-weight: 600;
    padding: 8px 12px;
    background-color: #f0f0f1;
    border-bottom: 1px solid #ddd;
}

#smth-preview-panel {
    height: 450px;
    /* Match a decent editor height */
    overflow-y: auto;
    background-color: #fff;
    padding: 10px 15px;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 14px;
    line-height: 1.6;
    border-bottom-right-radius: 3px;
}

/* --- Scoped Preview Panel Content Styles --- */
/* This section resets common element styles within the preview panel
   to prevent them from being overridden by admin/theme styles. */

#smth-preview-panel>*:first-child {
    margin-top: 0;
}

#smth-preview-panel>*:last-child {
    margin-bottom: 0;
}

#smth-preview-panel h1,
#smth-preview-panel h2,
#smth-preview-panel h3,
#smth-preview-panel h4,
#smth-preview-panel h5,
#smth-preview-panel h6 {
    margin: 1.2em 0 0.6em 0;
    padding: 0;
    font-weight: 600;
    line-height: 1.25;
}

#smth-preview-panel h1 {
    font-size: 1.8em;
}

#smth-preview-panel h2 {
    font-size: 1.5em;
}

#smth-preview-panel h3 {
    font-size: 1.25em;
}

#smth-preview-panel h4 {
    font-size: 1em;
}

#smth-preview-panel h5 {
    font-size: 0.875em;
}

#smth-preview-panel h6 {
    font-size: 0.85em;
    color: #666;
}

#smth-preview-panel p {
    margin: 0 0 1em 0;
}

#smth-preview-panel a {
    color: #0073aa;
    text-decoration: underline;
}

#smth-preview-panel a:hover {
    color: #00a0d2;
}

#smth-preview-panel ul,
#smth-preview-panel ol {
    margin: 0 0 1em 1.5em;
    padding: 0;
}

#smth-preview-panel blockquote {
    margin: 0 0 1em 0;
    padding: 0.5em 1em;
    color: #555;
    border-left: 0.25em solid #e0e0e0;
    background-color: #f9f9f9;
}

#smth-preview-panel code {
    font-family: monospace;
    background-color: rgba(0, 0, 0, 0.05);
    padding: 0.2em 0.4em;
    border-radius: 3px;
}

#smth-preview-panel pre {
    padding: 1em;
    background-color: #fdf6e3;
}

.smth-editor-footer {
    border: 1px solid #949494;
    border-top: none;
    padding: 5px 10px;
    margin-top: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Prevent text selection while resizing */
body.smth-resizing {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}
