/* Rentry Clone — rentry.co 1:1 aligned styles */

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

html, body {
    height: 100vh;
    overflow: hidden;
    font-family: Arial, sans-serif;
    font-size: 14px;
    background: #fff;
    color: #333;
}

/* ── Main container: full viewport ── */
#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 100%;
}

/* ── Tab bar: minimal, top-aligned ── */
.tab-bar {
    display: flex;
    align-items: center;
    height: 32px;
    padding: 0 12px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
    gap: 16px;
}

.tab {
    cursor: pointer;
    color: #888;
    font-size: 13px;
    padding: 4px 8px;
    border-bottom: 2px solid transparent;
    user-select: none;
}
.tab.active {
    color: #333;
    font-weight: bold;
    border-bottom-color: #228B22;
}
.tab:hover { color: #333; }

.tab-right { margin-left: auto; }
.meta-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #888;
    font-size: 13px;
}
.meta-btn:hover { color: #333; }

/* ── Tab views container: fills remaining space ── */
.tab-views {
    flex: 1;
    min-height: 0;
    display: flex;
    overflow: hidden;
}

.tab-view {
    flex: 1;
    display: none;
    flex-direction: column;
    min-height: 0;
}
.tab-view.active {
    display: flex;
}

/* ── Text tab: form + CodeMirror ── */
#view-text {
    display: flex;
    flex-direction: column;
}

#view-text form {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

#cm-editor {
    flex: 1;
    min-height: 0;
    overflow: hidden;
}
#cm-editor .CodeMirror {
    height: 100% !important;
    min-height: 100% !important;
}

/* ── Preview area ── */
#view-preview .preview-area {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    font-size: 15px;
    line-height: 1.6;
}

/* ── How content ── */
.how-content {
    padding: 16px;
    overflow-y: auto;
    font-size: 14px;
}
.how-content h2 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #333;
}
.how-content table {
    border-collapse: collapse;
    width: 100%;
}
.how-content th, .how-content td {
    border: 1px solid #eee;
    padding: 6px 12px;
    text-align: left;
}
.how-content th {
    background: #f9f9f9;
    font-weight: 600;
}
.how-content code {
    background: #f5f5f5;
    padding: 1px 5px;
    font-size: 12px;
}
.how-content a { color: #228B22; }

/* ── Options bar: bottom-docked, minimal ── */
.options-bar {
    display: flex;
    align-items: center;
    height: 40px;
    padding: 0 12px;
    border-top: 1px solid #eee;
    flex-shrink: 0;
    gap: 12px;
}

.options-bar input[type="text"],
.options-bar input[type="password"] {
    border: none;
    border-bottom: 1px solid #ccc;
    background: transparent;
    padding: 2px 4px;
    font-size: 13px;
    outline: none;
    min-width: 80px;
    font-family: Arial, sans-serif;
}
.options-bar input:focus {
    border-bottom-color: #228B22;
}
.options-bar input::placeholder {
    color: #bbb;
}

.options-bar select {
    border: none;
    border-bottom: 1px solid #ccc;
    background: transparent;
    font-size: 13px;
    outline: none;
    cursor: pointer;
    font-family: Arial, sans-serif;
}

.btn-go {
    margin-left: auto;
    background: #228B22;
    color: white;
    border: none;
    padding: 4px 16px;
    cursor: pointer;
    font-size: 13px;
    font-family: Arial, sans-serif;
}
.btn-go:hover { background: #1e7a1e; }

/* ── Metadata panel ── */
.meta-panel {
    border-top: 1px solid #eee;
    padding: 8px 12px;
    font-size: 12px;
    color: #888;
    flex-shrink: 0;
}

.result-inline {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.result-inline a {
    color: #228B22;
    text-decoration: none;
}
.result-inline a:hover { text-decoration: underline; }

.btn-copy {
    background: none;
    border: 1px solid #ccc;
    padding: 1px 8px;
    cursor: pointer;
    font-size: 12px;
    color: #333;
}
.btn-copy:hover { background: #f5f5f5; }

.code-readonly {
    border: none;
    border-bottom: 1px solid #ccc;
    background: transparent;
    font-size: 12px;
    width: 80px;
    color: #333;
}

.error-inline { color: #c00; }

.meta-hint { color: #aaa; }
.meta-hint a { color: #228B22; text-decoration: none; }

/* ── Result page styles ── */
.paste-view {
    max-width: 720px;
    margin: 0 auto;
    padding: 20px;
}
.paste-content {
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ── Markdown body (preview & paste view) ── */
.md-body h1, .md-body h2, .md-body h3,
.md-body h4, .md-body h5, .md-body h6 {
    font-weight: 600;
    margin: 1em 0 0.4em;
    line-height: 1.3;
}
.md-body h1 { font-size: 1.5rem; }
.md-body h2 { font-size: 1.25rem; }
.md-body h3 { font-size: 1.1rem; }
.md-body p { margin-bottom: 1em; }
.md-body a { color: #228B22; text-decoration: none; }
.md-body a:hover { text-decoration: underline; }
.md-body code {
    background: #f5f5f5;
    padding: 2px 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.88em;
}
.md-body pre {
    background: #f5f5f5;
    padding: 16px;
    overflow-x: auto;
    margin: 1em 0;
}
.md-body pre code { background: none; padding: 0; }
.md-body blockquote {
    border-left: 3px solid #ccc;
    margin: 1em 0;
    padding-left: 16px;
    color: #666;
}
.md-body ul, .md-body ol { padding-left: 24px; margin-bottom: 1em; }
.md-body li { margin-bottom: 0.25em; }
.md-body table { border-collapse: collapse; width: 100%; margin-bottom: 1em; }
.md-body th, .md-body td { border: 1px solid #ddd; padding: 8px 12px; }
.md-body th { background: #f5f5f5; font-weight: 600; }
.md-body img { max-width: 100%; height: auto; }
.md-body hr { border-top: 1px solid #eee; margin: 24px 0; }
