/* ═══════════════════════════════════════════════════════════════
   IMAGINEai Admin — Content Studio Styles (Purple + Black)
   ═══════════════════════════════════════════════════════════════ */
:root {
    --bg: #08070d;
    --surface: #110f1a;
    --surface-bright: #1a1726;
    --surface-high: #221e30;
    --primary: #a855f7;
    --secondary: #c084fc;
    --tertiary: #e879f9;
    --text: #f0eef8;
    --text-muted: #7a6f8a;
    --border: rgba(160,120,255,0.15);
    --error: #ff5c5c;
    --success: #4cff9f;
    --font-head: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
}

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

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    overflow: hidden;
    height: 100vh;
}

/* ─── Screens ─────────────────────────────────────────────── */
.screen { display: none; height: 100vh; }
.screen.active { display: flex; }

/* ─── Login ───────────────────────────────────────────────── */
#login-screen {
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at center, #15112a 0%, #08070d 70%);
}

.login-card {
    background: rgba(17, 15, 26, 0.6);
    backdrop-filter: blur(24px);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 48px;
    width: 420px;
    text-align: center;
}

.login-logo h1 {
    font-family: var(--font-head);
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.04em;
    margin-bottom: 4px;
}

.login-logo p {
    color: var(--text-muted);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-weight: 600;
    margin-bottom: 32px;
}

.login-form .input-group {
    display: flex; align-items: center; gap: 12px;
    background: var(--bg); border: 1px solid var(--border);
    border-radius: 12px; padding: 0 16px; margin-bottom: 16px;
    transition: border-color 0.3s;
}
.login-form .input-group:focus-within { border-color: var(--primary); }
.login-form .input-group input {
    flex: 1; background: transparent; border: none;
    color: var(--text); font-size: 15px; padding: 14px 0;
    outline: none; font-family: var(--font-body);
}

.error-text { color: var(--error); font-size: 13px; margin-top: 12px; min-height: 20px; }

/* OAuth Buttons */
.oauth-btn {
    width: 100%; padding: 13px;
    border: 1px solid var(--border); border-radius: 12px;
    font-size: 14px; font-weight: 600; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    font-family: var(--font-body); transition: all 0.3s; margin-bottom: 10px;
}
.oauth-btn.google { background: #fff; color: #333; }
.oauth-btn.google:hover { background: #f1f1f1; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(255,255,255,0.15); }
.oauth-btn.github { background: #24292e; color: #fff; }
.oauth-btn.github:hover { background: #2f363d; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(255,255,255,0.1); }

.user-info {
    font-size: 12px; color: var(--text-muted);
    padding: 4px 12px; background: var(--surface-bright); border-radius: 20px;
}

/* ─── Topbar ──────────────────────────────────────────────── */
.topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 24px; height: 56px;
    background: var(--surface); border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.topbar-left { display: flex; align-items: center; gap: 10px; }
.logo-sm { color: var(--primary); font-size: 24px; }
.topbar-title { font-family: var(--font-head); font-weight: 700; font-size: 16px; letter-spacing: -0.02em; }
.topbar-actions { display: flex; gap: 4px; }

.btn-ghost {
    display: flex; align-items: center; gap: 6px;
    background: transparent; border: 1px solid transparent;
    color: var(--text-muted); padding: 8px 14px; border-radius: 8px;
    font-size: 13px; font-weight: 500; cursor: pointer;
    font-family: var(--font-body); transition: all 0.2s;
}
.btn-ghost:hover { background: var(--surface-bright); color: var(--text); }
.btn-ghost.danger:hover { color: var(--error); }

/* ─── Editor Layout ───────────────────────────────────────── */
#editor-screen { flex-direction: column; }
.editor-layout { display: flex; flex: 1; overflow: hidden; }

/* ─── Sidebar ─────────────────────────────────────────────── */
.sidebar {
    width: 300px; background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column; flex-shrink: 0;
    transition: margin-left 0.3s;
}
.sidebar:not(.open) { margin-left: -300px; }

.sidebar-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px; border-bottom: 1px solid var(--border);
}
.sidebar-header h3 { font-family: var(--font-head); font-size: 15px; font-weight: 600; }

.badge {
    background: var(--surface-bright); color: var(--text-muted);
    font-size: 11px; font-weight: 700; padding: 2px 10px; border-radius: 20px;
}

.posts-list { flex: 1; overflow-y: auto; padding: 8px; }
.posts-list::-webkit-scrollbar { width: 4px; }
.posts-list::-webkit-scrollbar-track { background: transparent; }
.posts-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.post-item {
    display: flex; gap: 12px; padding: 12px; border-radius: 10px;
    cursor: pointer; transition: background 0.2s; margin-bottom: 2px;
}
.post-item:hover { background: var(--surface-bright); }
.post-item.active { background: var(--surface-high); border: 1px solid var(--border); }

.post-item-thumb {
    width: 48px; height: 48px; border-radius: 8px;
    object-fit: cover; flex-shrink: 0; background: var(--surface-bright);
}
.post-item-info { flex: 1; min-width: 0; }
.post-item-title {
    font-size: 13px; font-weight: 600; line-height: 1.3; margin-bottom: 4px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.post-item-meta {
    display: flex; align-items: center; gap: 8px;
    font-size: 11px; color: var(--text-muted);
}

.status-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.status-dot.published { background: var(--success); }
.status-dot.draft { background: var(--text-muted); }

.empty-state {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; padding: 48px 20px; color: var(--text-muted);
}
.empty-state p { font-size: 13px; }

/* ─── Main Editor ─────────────────────────────────────────── */
.editor-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.editor-scroll { flex: 1; overflow-y: auto; padding: 0 48px 48px; }
.editor-scroll::-webkit-scrollbar { width: 6px; }
.editor-scroll::-webkit-scrollbar-track { background: transparent; }
.editor-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* Cover Image */
.cover-zone {
    position: relative; height: 280px; background: var(--surface);
    border-radius: 16px; margin-bottom: 32px; margin-top: 32px;
    overflow: hidden; cursor: pointer; border: 2px dashed var(--border);
    transition: border-color 0.3s;
}
.cover-zone:hover { border-color: var(--primary); }
.cover-zone.has-image { border: none; }

.cover-placeholder {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; height: 100%; color: var(--text-muted);
}
.cover-placeholder p { font-size: 13px; }
.cover-preview { width: 100%; height: 100%; object-fit: cover; display: none; }
.cover-remove {
    position: absolute; top: 12px; right: 12px;
    background: rgba(0,0,0,0.7); border: none; color: white;
    width: 32px; height: 32px; border-radius: 8px;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
}

/* Title & Excerpt */
.title-input {
    width: 100%; background: transparent; border: none;
    color: var(--text); font-family: var(--font-head);
    font-size: 36px; font-weight: 700; letter-spacing: -0.03em;
    outline: none; margin-bottom: 16px; line-height: 1.2;
}
.title-input::placeholder { color: rgba(160,120,255,0.2); }

.excerpt-input {
    width: 100%; background: transparent; border: none;
    border-left: 3px solid var(--primary); color: var(--text-muted);
    font-size: 16px; padding: 8px 16px; outline: none;
    resize: none; margin-bottom: 20px;
    font-family: var(--font-body); line-height: 1.5;
}
.excerpt-input::placeholder { color: rgba(160,120,255,0.2); }

/* Meta Row */
.meta-row {
    display: flex; gap: 24px; align-items: center;
    margin-bottom: 24px; padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}
.input-group-sm label {
    display: block; font-size: 10px; text-transform: uppercase;
    letter-spacing: 0.15em; color: var(--text-muted);
    margin-bottom: 6px; font-weight: 600;
}
.input-group-sm input[type="text"] {
    background: var(--surface); border: 1px solid var(--border);
    color: var(--text); padding: 8px 12px; border-radius: 8px;
    font-size: 13px; outline: none; font-family: var(--font-body); width: 200px;
}
.input-group-sm input[type="text"]:focus { border-color: var(--primary); }

.checkbox-label {
    display: flex !important; align-items: center; gap: 8px;
    cursor: pointer; font-size: 13px !important;
    color: var(--text) !important; text-transform: none !important;
    letter-spacing: 0 !important; margin-top: 20px;
}
.checkbox-label input[type="checkbox"] { accent-color: var(--primary); width: 16px; height: 16px; }

/* Quill Editor */
#editor-container {
    border: 1px solid var(--border); border-radius: 12px;
    overflow: hidden; background: var(--surface); min-height: 400px;
}
.ql-toolbar.ql-snow {
    background: var(--surface-bright) !important; border: none !important;
    border-bottom: 1px solid var(--border) !important; padding: 12px 16px !important;
}
.ql-snow .ql-stroke { stroke: var(--text-muted) !important; }
.ql-snow .ql-fill { fill: var(--text-muted) !important; }
.ql-snow .ql-picker-label { color: var(--text-muted) !important; }
.ql-snow .ql-active .ql-stroke { stroke: var(--primary) !important; }
.ql-snow .ql-active .ql-fill { fill: var(--primary) !important; }
.ql-snow .ql-picker-options { background: var(--surface-bright) !important; border-color: var(--border) !important; }
.ql-snow .ql-picker-item { color: var(--text-muted) !important; }
.ql-snow .ql-picker-item:hover { color: var(--primary) !important; }

.ql-editor {
    min-height: 350px; color: var(--text) !important;
    font-family: var(--font-body) !important; font-size: 16px !important;
    line-height: 1.8 !important; padding: 24px !important;
}
.ql-editor.ql-blank::before { color: rgba(160,120,255,0.2) !important; font-style: normal !important; }
.ql-editor h1, .ql-editor h2, .ql-editor h3 { font-family: var(--font-head) !important; color: var(--text) !important; }
.ql-editor a { color: var(--primary) !important; }
.ql-editor blockquote { border-left-color: var(--primary) !important; color: var(--text-muted) !important; }
.ql-editor img { border-radius: 8px; max-width: 100%; }

/* Action Bar */
.action-bar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 48px; background: var(--surface);
    border-top: 1px solid var(--border); flex-shrink: 0;
}
.action-left { display: flex; align-items: center; }
.action-right { display: flex; gap: 10px; }
.save-status { font-size: 12px; color: var(--text-muted); }

.btn-action {
    display: flex; align-items: center; gap: 6px;
    padding: 10px 20px; border: none; border-radius: 10px;
    font-size: 13px; font-weight: 600; cursor: pointer;
    font-family: var(--font-body); transition: all 0.2s;
}
.btn-action.draft { background: var(--surface-bright); color: var(--text); border: 1px solid var(--border); }
.btn-action.draft:hover { border-color: var(--text-muted); }
.btn-action.publish { background: var(--primary); color: #fff; }
.btn-action.publish:hover { transform: translateY(-1px); box-shadow: 0 4px 20px rgba(168,85,247,0.3); }
.btn-action.delete { background: transparent; color: var(--error); border: 1px solid var(--error); }
.btn-action.delete:hover { background: rgba(255, 92, 92, 0.1); }
