/* ==========================================================
   admin.css — Blog admin panel styles
   ========================================================== */

/* Form inputs */
.admin-label {
    display: block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.625rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #78716c;
    margin-bottom: 0.375rem;
}

.admin-input {
    width: 100%;
    padding: 0.625rem 0.75rem;
    background: #fff;
    border: 1px solid #e7e5e4;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    color: #1c1917;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.admin-input:focus {
    outline: none;
    border-color: #fb923c;
}

.admin-input::placeholder {
    color: #a8a29e;
}

/* Small action buttons */
.admin-btn-sm {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.625rem;
    letter-spacing: 0.03em;
    color: #78716c;
    padding: 0.25rem 0.5rem;
    border: 1px solid #e7e5e4;
    border-radius: 0.125rem;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s;
}

.admin-btn-sm:hover {
    border-color: #fb923c;
    color: #fb923c;
}

/* ── Editor mode tabs ── */
.editor-tabs {
    display: flex;
    gap: 0;
    border: 1px solid #e7e5e4;
    border-bottom: none;
    border-radius: 0.25rem 0.25rem 0 0;
    overflow: hidden;
    background: #fafaf9;
}

.editor-tab {
    flex: 1;
    padding: 0.5rem 1rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #78716c;
    background: transparent;
    border: none;
    border-right: 1px solid #e7e5e4;
    cursor: pointer;
    transition: all 0.15s;
}

.editor-tab:last-child {
    border-right: none;
}

.editor-tab:hover {
    color: #1c1917;
    background: #f5f5f4;
}

.editor-tab.active {
    color: #1c1917;
    background: #fff;
    border-bottom: 2px solid #fb923c;
}

/* ── Editor pane container ── */
.editor-pane {
    border: 1px solid #e7e5e4;
    border-top: none;
    border-radius: 0 0 0.25rem 0.25rem;
    overflow: hidden;
    min-height: 500px;
}

/* ── Quill WYSIWYG overrides ── */
.editor-pane .ql-toolbar {
    border: none !important;
    border-bottom: 1px solid #e7e5e4 !important;
    background: #fafaf9;
}

.editor-pane .ql-container {
    border: none !important;
    font-family: 'Inter', sans-serif;
    font-size: 0.9375rem;
    line-height: 1.75;
    min-height: 460px;
}

.editor-pane .ql-editor {
    min-height: 460px;
    padding: 1.25rem;
    color: #1c1917;
}

.editor-pane .ql-editor.ql-blank::before {
    color: #a8a29e;
    font-style: normal;
}

/* ── Raw textarea (Markdown mode) ── */
.editor-raw {
    width: 100%;
    min-height: 500px;
    padding: 1.25rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8125rem;
    line-height: 1.7;
    color: #1c1917;
    background: #fafaf9;
    border: none;
    resize: vertical;
    box-sizing: border-box;
}

.editor-raw:focus {
    outline: none;
    background: #fff;
}

.editor-raw::placeholder {
    color: #a8a29e;
}

.editor-raw.hidden {
    display: none;
}

/* ── HTML Preview (read-only rendered view) ── */
.editor-preview {
    min-height: 500px;
    padding: 1.25rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.9375rem;
    line-height: 1.75;
    color: #1c1917;
    background: #fff;
    overflow-y: auto;
}

.editor-preview.hidden {
    display: none;
}

.editor-preview h1,
.editor-preview h2,
.editor-preview h3 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    font-weight: 600;
    line-height: 1.3;
}

.editor-preview h1 { font-size: 1.75em; }
.editor-preview h2 { font-size: 1.375em; }
.editor-preview h3 { font-size: 1.125em; }

.editor-preview p {
    margin-bottom: 1em;
}

.editor-preview blockquote {
    border-left: 3px solid #fb923c;
    padding-left: 1em;
    color: #57534e;
    margin: 1em 0;
}

.editor-preview pre {
    background: #1c1917;
    color: #e7e5e4;
    padding: 1em;
    border-radius: 0.375rem;
    overflow-x: auto;
    margin: 1em 0;
}

.editor-preview code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85em;
}

.editor-preview img {
    max-width: 100%;
    border-radius: 0.375rem;
    margin: 1em 0;
}

.editor-preview a {
    color: #fb923c;
    text-decoration: underline;
}

.editor-preview ul,
.editor-preview ol {
    padding-left: 1.5em;
    margin-bottom: 1em;
}

.editor-preview hr {
    border: none;
    border-top: 1px solid #e7e5e4;
    margin: 2em 0;
}

/* Mobile: reduce editor height */
@media (max-width: 768px) {
    .editor-pane {
        min-height: 300px;
    }
    .editor-pane .ql-container,
    .editor-pane .ql-editor,
    .editor-raw,
    .editor-preview {
        min-height: 300px;
    }
}
