/* === BƯỚC 2: LAYOUT GRID (CHIA CỘT) === */

/* 1. Global / Editor portal layout */
.onyx-editor-portal {
    background: #f9fafb;
}

/* Quick Post Portal - Force scrollable */
.onyx-quick-post-portal {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    height: auto !important;
    min-height: calc(100vh - 80px) !important;
    max-height: none !important;
}

.onyx-quick-post-portal.onyx-editor-portal--app {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    height: auto !important;
    min-height: calc(100vh - 80px) !important;
    max-height: none !important;
}

/* LOGIN mode (no scroll, centered) */
/* Full screen background override for WordPress containers */
body:has(.onyx-editor-portal--login),
body.page:has(.onyx-editor-portal--login),
html:has(.onyx-editor-portal--login) {
    height: 100vh;
    overflow: hidden;
}

body:has(.onyx-editor-portal--login) #page,
body.page:has(.onyx-editor-portal--login) #page {
    min-height: 100vh;
    background: radial-gradient(circle at top left, #e0f2fe 0, #f9fafb 45%, #eef2ff 100%);
}

body:has(.onyx-editor-portal--login) .site-content,
body.page:has(.onyx-editor-portal--login) .site-content,
body:has(.onyx-editor-portal--login) .entry-content,
body.page:has(.onyx-editor-portal--login) .entry-content {
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

.onyx-editor-portal--login {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    padding: 24px 16px;
    background: radial-gradient(circle at top left, #e0f2fe 0, #f9fafb 45%, #eef2ff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    margin: 0;
}

.onyx-editor-portal--login .onyx-container {
    max-width: 420px;
    width: 100%;
    margin: 0 auto;
    padding: 0;
}

/* Hide footer + prevent scroll ONLY on login view */
body.page-template-page-editor .onyx-editor-portal--login ~ footer#colophon,
body.page-template-page-editor footer#colophon:has(+ .onyx-editor-portal--login),
body:has(.onyx-editor-portal--login) footer#colophon,
body:has(.onyx-editor-portal--login) .site-footer {
    display: none !important;
}

body.page-template-page-editor:has(.onyx-editor-portal--login),
body:has(.onyx-editor-portal--login) {
    overflow: hidden;
}

/* Hide header on login if needed */
body:has(.onyx-editor-portal--login) #masthead,
body:has(.onyx-editor-portal--login) .site-header {
    position: relative;
    z-index: 1;
}

/* APP mode (editor inside): normal scrolling */
.onyx-editor-portal--app {
    min-height: calc(100vh - 80px);
    padding: 40px 16px 80px;
    background: #f9fafb;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Fix scroll for Quick Post - override home page overflow hidden */
/* Override for all possible body classes - MUST be after home page CSS */
body:has(.onyx-quick-post-portal),
body.home:has(.onyx-quick-post-portal),
body.page:has(.onyx-quick-post-portal),
body.single:has(.onyx-quick-post-portal),
body:has(.onyx-quick-post-wrapper),
body.home:has(.onyx-quick-post-wrapper) {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    height: auto !important;
    max-height: none !important;
}

/* Override html element */
html:has(body:has(.onyx-quick-post-portal)),
html:has(body.home:has(.onyx-quick-post-portal)),
html:has(body:has(.onyx-quick-post-wrapper)),
html:has(body.home:has(.onyx-quick-post-wrapper)) {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    height: auto !important;
}

/* Override site-content and page wrapper */
body:has(.onyx-quick-post-portal) .site-content,
body.home:has(.onyx-quick-post-portal) .site-content,
body:has(.onyx-quick-post-wrapper) .site-content,
body.home:has(.onyx-quick-post-wrapper) .site-content {
    overflow-y: visible !important;
    height: auto !important;
    max-height: none !important;
}

body:has(.onyx-quick-post-portal) #page,
body.home:has(.onyx-quick-post-portal) #page,
body:has(.onyx-quick-post-wrapper) #page,
body.home:has(.onyx-quick-post-wrapper) #page {
    overflow-y: visible !important;
    height: auto !important;
    max-height: none !important;
}

/* Ensure Quick Post wrapper can scroll */
.onyx-quick-post-wrapper {
    overflow-y: visible !important;
    overflow-x: hidden !important;
    height: auto !important;
    min-height: 0 !important;
}

.onyx-quick-post-container {
    overflow-y: visible !important;
    overflow-x: hidden !important;
    height: auto !important;
}

.onyx-editor-portal--app .onyx-container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
}

/* =========================================================
   2. EDITOR APP – Modern UI (Onyx style)
   Scope: only when logged in (.onyx-editor-portal--app)
   ========================================================= */
.onyx-editor-portal--app {
    --oe-bg: #f8fafc;
    --oe-card: #ffffff;
    --oe-text: #0f172a;
    --oe-muted: #64748b;
    --oe-border: rgba(148, 163, 184, 0.35);
    --oe-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
    --oe-shadow-sm: 0 10px 26px rgba(15, 23, 42, 0.08);
    --oe-accent: #D4F238;
    --oe-brand: #2D3142;
    --oe-radius: 14px;
    --oe-radius-lg: 18px;
}

.onyx-editor-portal--app .editor-header {
    margin-bottom: 22px;
    padding: 18px 20px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid var(--oe-border);
    border-radius: var(--oe-radius-lg);
    box-shadow: var(--oe-shadow-sm);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

.onyx-editor-portal--app .editor-header h1 {
    font-size: 34px;
    letter-spacing: -0.03em;
    color: var(--oe-text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.onyx-editor-portal--app .editor-user-info {
    color: var(--oe-muted);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.onyx-editor-portal--app .editor-user-info a {
    color: var(--oe-brand);
    font-weight: 600;
    text-decoration: none;
}

.onyx-editor-portal--app .editor-user-info a:hover {
    text-decoration: underline;
}

/* Buttons in editor-user-info should use same style as list actions */
.onyx-editor-portal--app .editor-list-header .editor-user-info .btn-quick-post {
    margin-right: 0;
}

.onyx-editor-portal--app .editor-list-header .editor-user-info .quick-post-btn {
    margin-right: 0;
}

/* Layout selector */
.onyx-editor-portal--app .layout-selector-section {
    background: var(--oe-card);
    border: 1px solid var(--oe-border);
    border-radius: var(--oe-radius-lg);
    padding: 18px 18px 14px;
    box-shadow: var(--oe-shadow-sm);
    margin-bottom: 18px;
}

.onyx-editor-portal--app .layout-selector-section label {
    font-size: 14px;
    font-weight: 600;
    color: var(--oe-text);
    margin-bottom: 10px;
}

.onyx-editor-portal--app .layout-selector-section p {
    margin-top: 8px !important;
    color: var(--oe-muted) !important;
    font-size: 13px !important;
}

.onyx-editor-portal--app .layout-style-select {
    max-width: 360px;
    border-radius: 12px;
    border: 1px solid var(--oe-border);
    padding: 12px 14px;
    font-size: 14px;
    background: rgba(248, 250, 252, 0.92);
}

.onyx-editor-portal--app .layout-style-select:focus {
    border-color: var(--oe-brand);
    box-shadow: 0 0 0 4px rgba(212, 242, 56, 0.18);
}

/* Main card */
.onyx-editor-portal--app .main-column {
    background: var(--oe-card);
    border: 1px solid var(--oe-border);
    border-radius: var(--oe-radius-lg);
    box-shadow: var(--oe-shadow);
    padding: 22px;
}

/* Builder layout */
.onyx-editor-portal--app .editor-builder-grid {
    display: grid;
    grid-template-columns: minmax(520px, 1fr) 340px;
    gap: 18px;
    align-items: start;
    margin-top: 10px;
}

.onyx-editor-portal--app .preview-layout {
    border: 1px solid var(--oe-border);
    border-radius: var(--oe-radius-lg);
    padding: 22px 26px 28px;
    background: radial-gradient(circle at top, rgba(248,250,252,0.95), #ffffff);
    min-height: 640px;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.08);
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
}

/* ============================================================
 * STRUCTURE PANEL - Modern Redesign
 * ============================================================ */

/* Structure panel container */
.onyx-editor-portal--app .editor-structure-panel {
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid var(--oe-border);
    border-radius: var(--oe-radius-lg);
    box-shadow: var(--oe-shadow-sm);
    overflow: hidden;
    position: sticky;
    top: 18px;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 100px);
}

/* Structure panel header */
.onyx-editor-portal--app .structure-panel-header {
    background: linear-gradient(135deg, var(--oe-brand) 0%, #1a1d29 100%);
    color: #fff;
    padding: 16px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.structure-panel-header-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.onyx-editor-portal--app .structure-panel-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
}

.onyx-editor-portal--app .structure-panel-header h3 > * {
    flex-shrink: 0;
}

.onyx-editor-portal--app .structure-panel-header h3 > .block-count-indicator {
    flex-shrink: 1;
    min-width: auto;
}

.onyx-editor-portal--app .block-count-indicator {
    font-size: 12px;
    font-weight: 500;
    opacity: 0.85;
    background: rgba(255, 255, 255, 0.15);
    padding: 2px 8px;
    border-radius: 12px;
}

.onyx-editor-portal--app .btn-panel-mode {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    border-radius: 8px;
    cursor: pointer;
    padding: 6px 10px;
    transition: all 0.2s ease;
    font-size: 12px;
    position: relative;
}

.onyx-editor-portal--app .btn-panel-mode:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

.onyx-editor-portal--app .btn-toggle-panel {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    border-radius: 8px;
    cursor: pointer;
    padding: 6px 10px;
    transition: all 0.2s ease;
    font-size: 12px;
}

.onyx-editor-portal--app .btn-toggle-panel:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

/* Panel mode dropdown */
.panel-mode-menu {
    position: fixed;
    background: #fff;
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
    padding: 6px;
    min-width: 180px;
    z-index: 10000;
    display: none;
}

.panel-mode-menu.show {
    display: block;
}

.panel-mode-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #334155;
    transition: all 0.15s ease;
}

.panel-mode-menu-item:hover {
    background: #f1f5f9;
    color: var(--oe-brand);
}

.panel-mode-menu-item.active {
    background: rgba(45, 49, 66, 0.1);
    color: var(--oe-brand);
    font-weight: 600;
}

.panel-mode-menu-item-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

/* Panel modes */
.onyx-editor-portal--app .editor-structure-panel.mode-sidebar {
    position: sticky;
    top: 18px;
    max-height: calc(100vh - 100px);
}

.onyx-editor-portal--app .editor-structure-panel.mode-fixed {
    position: fixed;
    top: 18px;
    right: 18px;
    max-height: calc(100vh - 100px);
    z-index: 999;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.2);
    width: 320px; /* Fixed width for draggable */
}

.onyx-editor-portal--app .editor-structure-panel.mode-fixed .structure-panel-header {
    cursor: move;
    -webkit-user-select: none;
    user-select: none;
}

.onyx-editor-portal--app .editor-structure-panel.mode-fixed .structure-panel-header:active {
    cursor: grabbing;
}

/* Structure panel content */
.onyx-editor-portal--app .structure-panel-content {
    padding: 0;
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    max-height: 1000px;
    opacity: 1;
    transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
}

/* Search wrapper */
.structure-search-wrapper {
    padding: 12px 14px;
    border-bottom: 1px solid var(--oe-border);
    background: #f8fafb;
    position: relative;
}

.structure-search-input {
    width: 100%;
    padding: 8px 32px 8px 12px;
    border: 1px solid var(--oe-border);
    border-radius: 8px;
    font-size: 13px;
    background: #fff;
    transition: all 0.2s ease;
}

.structure-search-input:focus {
    outline: none;
    border-color: var(--oe-brand);
    box-shadow: 0 0 0 3px rgba(45, 49, 66, 0.1);
}

.structure-search-clear {
    position: absolute;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    font-size: 14px;
    line-height: 1;
    transition: color 0.2s ease;
}

.structure-search-clear:hover {
    color: #64748b;
}

/* Structure list */
.structure-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px 14px;
    min-height: 100px;
}

/* Empty state */
.structure-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #94a3b8;
}

.structure-empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.structure-empty-text {
    font-size: 15px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 6px;
}

.structure-empty-hint {
    font-size: 12px;
    color: #94a3b8;
}

/* Modern card-based structure item */
.onyx-editor-portal--app .structure-item {
    background: #fff;
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 12px;
    margin-bottom: 10px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
    transition: all 0.2s ease;
    overflow: visible;
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

.onyx-editor-portal--app .structure-item.has-open-menu {
    z-index: 100000;
}

.onyx-editor-portal--app .structure-item:hover {
    border-color: rgba(45, 49, 66, 0.4);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1);
    transform: translateY(-1px);
}

.onyx-editor-portal--app .structure-item.filtered-out {
    display: none !important;
}

/* Structure item header */
.structure-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    gap: 10px;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}

.structure-item-main {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

/* Drag handle */
.structure-item-drag-handle {
    cursor: grab !important;
    color: #94a3b8;
    font-size: 16px;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
}

.structure-item-drag-handle:hover {
    background: #f1f5f9;
    color: #64748b;
    cursor: grabbing !important;
}

/* Icon wrapper */
.structure-item-icon-wrapper {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 10px;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.05);
    transition: all 0.2s ease;
}

.structure-item:hover .structure-item-icon-wrapper {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(15, 23, 42, 0.1);
}

.structure-item-icon {
    font-size: 22px;
    line-height: 1;
    filter: grayscale(0.1);
}

/* Structure item info */
.structure-item-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.structure-item-label {
    font-weight: 600;
    color: #111827;
    font-size: 14px;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    -webkit-user-select: none;
    user-select: none;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    line-height: 1.4;
}

.structure-item-label:hover {
    color: var(--oe-brand);
}

/* Structure item actions */
.onyx-editor-portal--app .structure-item-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
    min-width: 0;
    position: relative;
    z-index: 1;
}

.onyx-editor-portal--app .structure-item-actions .btn-actions-menu {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    background: #fff;
    padding: 0;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    color: #64748b;
    line-height: 1;
}

.onyx-editor-portal--app .structure-item-actions .btn-actions-menu:hover {
    border-color: var(--oe-brand);
    background: #f8fafb;
    color: var(--oe-brand);
    transform: scale(1.05);
}

/* Actions menu dropdown */
.structure-item-actions-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background: #fff;
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
    padding: 4px;
    min-width: 160px;
    z-index: 10000;
    display: none;
}

.structure-item-actions-menu.show {
    display: block;
}

.btn-action-item {
    width: 100%;
    padding: 8px 12px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #334155;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.15s ease;
}

.btn-action-item:hover {
    background: #f1f5f9;
    color: var(--oe-brand);
}

.btn-action-item.is-disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: transparent;
}

.btn-action-item.is-disabled:hover {
    background: transparent;
    color: #334155;
}


/* Structure list scrollbar */
.structure-list::-webkit-scrollbar {
    width: 6px;
}

.structure-list::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.structure-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.structure-list::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Collapsible structure panel */
.onyx-editor-portal--app .editor-structure-panel.collapsed .structure-panel-content {
    max-height: 0;
    opacity: 0;
    padding: 0;
    overflow: hidden;
}

.onyx-editor-portal--app .editor-structure-panel.collapsed {
    max-height: fit-content;
}

/* Add block button */
.onyx-editor-portal--app .btn-add-block {
    width: calc(100% - 28px);
    margin: 12px 14px;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    background: linear-gradient(135deg, var(--oe-accent) 0%, #c4d82a 100%);
    color: #0b1220;
    font-weight: 700;
    letter-spacing: 0.02em;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(212, 242, 56, 0.2);
}

.onyx-editor-portal--app .btn-add-block:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(212, 242, 56, 0.3);
    filter: brightness(1.02);
}

.onyx-editor-portal--app .btn-add-block:active {
    transform: translateY(0);
}

/* Block type dropdown (Add Content Block) */
/* Block type dropdown (Add Content Block) */
.block-type-menu {
    position: fixed;
    min-width: 220px;
    padding: 8px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(148, 163, 184, 0.35);
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.18);
    z-index: 100000; /* above WP admin bar + TinyMCE */
    display: none;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

.block-type-menu.show {
    display: block;
}

.block-type-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    cursor: pointer;
    color: #0f172a;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.15s ease, transform 0.05s ease;
    -webkit-user-select: none;
    user-select: none;
}

.block-type-option:hover {
    background: rgba(212, 242, 56, 0.35);
}

.block-type-option:active {
    transform: translateY(1px);
}

.block-type-option-icon {
    font-size: 18px;
    width: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Fields / inputs (scoped to editor) */
.onyx-editor-portal--app .form-field-wrapper input[type="text"],
.onyx-editor-portal--app .form-field-wrapper input[type="url"],
.onyx-editor-portal--app .form-field-wrapper textarea {
    border-radius: 12px;
    border: 1px solid var(--oe-border);
    background: rgba(248,250,252,0.92);
    padding: 12px 14px;
    font-size: 14px;
}

.onyx-editor-portal--app .form-field-wrapper input[type="text"]:focus,
.onyx-editor-portal--app .form-field-wrapper input[type="url"]:focus,
.onyx-editor-portal--app .form-field-wrapper textarea:focus {
    outline: none;
    border-color: var(--oe-brand);
    box-shadow: 0 0 0 4px rgba(212, 242, 56, 0.18);
    background: #fff;
}

/* Submit bar */
.onyx-editor-portal--app .editor-submit-section {
    margin-top: 18px;
    padding: 16px;
    border: 1px solid var(--oe-border);
    border-radius: var(--oe-radius-lg);
    background: rgba(255,255,255,0.92);
    box-shadow: var(--oe-shadow-sm);
}

.onyx-editor-portal--app .preview-full-btn {
    background: #0ea5e9;
    color: #fff;
    border-radius: 12px;
}

.onyx-editor-portal--app .visible-submit-btn {
    background: var(--oe-brand) !important;
    border-radius: 12px !important;
}

@media (max-width: 1100px) {
    .onyx-editor-portal--app .editor-builder-grid {
        grid-template-columns: 1fr;
    }
    .onyx-editor-portal--app .editor-structure-panel {
        position: relative;
        top: 0;
    }
}

/* =========================================================
   3. LIST PAGE – Modern UI (Onyx style)
   ========================================================= */
.onyx-editor-portal--app .editor-list-container {
    padding: 0;
}

.onyx-editor-portal--app .editor-list-header {
    background: rgba(255,255,255,0.92);
    border: 1px solid var(--oe-border);
    border-radius: var(--oe-radius-lg);
    padding: 24px 28px;
    box-shadow: var(--oe-shadow-sm);
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.onyx-editor-portal--app .editor-list-header h1 {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.02em;
}

.onyx-editor-portal--app .editor-list-actions {
    background: rgba(255,255,255,0.92);
    border: 1px solid var(--oe-border);
    border-radius: var(--oe-radius-lg);
    padding: 20px 24px;
    box-shadow: var(--oe-shadow-sm);
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.onyx-editor-portal--app .list-actions-left {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex: 1;
    flex-wrap: wrap;
}

.onyx-editor-portal--app .list-actions-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.onyx-editor-portal--app .status-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.onyx-editor-portal--app .status-filter {
    border-radius: 999px;
    border: 1.5px solid rgba(148,163,184,0.35);
    background: rgba(255,255,255,0.9);
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.onyx-editor-portal--app .status-filter:hover {
    border-color: var(--oe-brand);
    color: var(--oe-brand);
    background: rgba(212, 242, 56, 0.1);
}

.onyx-editor-portal--app .status-filter.active {
    background: var(--oe-brand);
    border-color: var(--oe-brand);
    color: #ffffff;
}

.onyx-editor-portal--app .search-box {
    position: relative;
    flex: 1;
    min-width: 250px;
    max-width: 400px;
}

.onyx-editor-portal--app .search-input {
    width: 100%;
    padding: 10px 16px 10px 40px;
    border: 1.5px solid rgba(148,163,184,0.35);
    border-radius: 10px;
    font-size: 14px;
    background: rgba(248,250,252,0.9);
    transition: all 0.2s ease;
    color: #0f172a;
}

.onyx-editor-portal--app .search-input:focus {
    outline: none;
    border-color: var(--oe-brand);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(212, 242, 56, 0.15);
}

.onyx-editor-portal--app .search-input::placeholder {
    color: #94a3b8;
}

.onyx-editor-portal--app .btn-quick-post,
.onyx-editor-portal--app .btn-create-new,
.onyx-editor-portal--app .btn-delete-all {
    border-radius: 10px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.onyx-editor-portal--app .btn-quick-post {
    background: #f1f5f9;
    color: #2D3142;
    border: 1.5px solid rgba(148,163,184,0.3);
}

.onyx-editor-portal--app .btn-quick-post:hover {
    background: #e2e8f0;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.onyx-editor-portal--app .btn-create-new {
    background: var(--oe-brand);
    color: #ffffff;
    border: none;
}

.onyx-editor-portal--app .btn-create-new::before {
    content: '+';
    display: inline-block;
    margin-right: 6px;
    font-weight: 700;
    font-size: 16px;
    line-height: 1;
    color: #ffffff;
}

.onyx-editor-portal--app .btn-create-new:hover {
    background: #1e293b;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(45, 49, 66, 0.3);
}

.onyx-editor-portal--app .btn-create-new:hover::before {
    color: #ffffff;
}

.onyx-editor-portal--app .btn-delete-all {
    background: #fee2e2;
    color: #dc2626;
    border: 1.5px solid #fecaca;
}

.onyx-editor-portal--app .btn-delete-all:hover {
    background: #fecaca;
    color: #b91c1c;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.onyx-editor-portal--app .btn-delete-all:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.onyx-editor-portal--app .posts-list {
    display: grid;
    gap: 20px;
}

.onyx-editor-portal--app .post-item {
    border-radius: var(--oe-radius-lg);
    border: 1px solid var(--oe-border);
    box-shadow: var(--oe-shadow-sm);
    background: rgba(255,255,255,0.92);
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    gap: 0;
}

.onyx-editor-portal--app .post-item:hover {
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
    transform: translateY(-2px);
}

.onyx-editor-portal--app .post-item-thumbnail {
    width: 200px;
    min-width: 200px;
    height: 220px;
    overflow: hidden;
    background: #f1f5f9;
    flex-shrink: 0;
}

.onyx-editor-portal--app .post-item-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.onyx-editor-portal--app .post-item-content {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.onyx-editor-portal--app .post-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.onyx-editor-portal--app .post-title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.4;
    flex: 1;
}

.onyx-editor-portal--app .post-title a {
    color: #0f172a;
    text-decoration: none;
    transition: color 0.2s ease;
}

.onyx-editor-portal--app .post-title a:hover {
    color: var(--oe-brand);
}

.onyx-editor-portal--app .post-status {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    flex-shrink: 0;
}

.onyx-editor-portal--app .post-status.status-publish {
    background: #dcfce7;
    color: #166534;
}

.onyx-editor-portal--app .post-status.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.onyx-editor-portal--app .post-status.status-draft {
    background: #e2e8f0;
    color: #475569;
}
.onyx-editor-portal--app .post-status.status-deleted {
    background: #ef4444;
    color: #ffffff;
}

.onyx-editor-portal--app .post-summary {
    margin: 0;
    color: #64748b;
    font-size: 14px;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.onyx-editor-portal--app .post-item-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 13px;
    color: #94a3b8;
}

.onyx-editor-portal--app .post-item-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.onyx-editor-portal--app .post-item-meta svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
}

.onyx-editor-portal--app .post-item-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid rgba(148,163,184,0.15);
}

.onyx-editor-portal--app .btn-action {
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    color: #64748b;
}

.onyx-editor-portal--app .btn-action:hover {
    background: #f1f5f9;
    color: #0f172a;
    transform: translateY(-1px);
}

.onyx-editor-portal--app .btn-action.btn-edit {
    color: #0ea5e9;
}

.onyx-editor-portal--app .btn-action.btn-edit:hover {
    background: #e0f2fe;
    color: #0284c7;
}

.onyx-editor-portal--app .btn-action.btn-preview {
    color: #8b5cf6;
}

.onyx-editor-portal--app .btn-action.btn-preview:hover {
    background: #f3e8ff;
    color: #7c3aed;
}

.onyx-editor-portal--app .btn-action.btn-delete {
    color: #ef4444;
}

.onyx-editor-portal--app .btn-action.btn-delete:hover {
    background: #fee2e2;
    color: #dc2626;
}

.onyx-editor-portal--app .btn-action:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.onyx-editor-portal--app .no-posts {
    text-align: center;
    padding: 60px 20px;
    background: rgba(255,255,255,0.92);
    border: 1px solid var(--oe-border);
    border-radius: var(--oe-radius-lg);
    box-shadow: var(--oe-shadow-sm);
}

.onyx-editor-portal--app .no-posts-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.onyx-editor-portal--app .no-posts h3 {
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
}

.onyx-editor-portal--app .no-posts p {
    margin: 0 0 24px;
    color: #64748b;
    font-size: 14px;
}

/* Pagination Styles */
.onyx-editor-portal--app .editor-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 40px;
    padding: 24px 0;
    border-top: 1px solid rgba(148, 163, 184, 0.15);
    flex-wrap: wrap;
}

.onyx-editor-portal--app .pagination-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: #ffffff;
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 8px;
    color: #334155;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.onyx-editor-portal--app .pagination-btn:hover:not(.disabled) {
    background: #f8fafc;
    border-color: #2D3142;
    color: #2D3142;
    transform: translateY(-1px);
}

.onyx-editor-portal--app .pagination-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #f1f5f9;
}

.onyx-editor-portal--app .pagination-btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
}

.onyx-editor-portal--app .pagination-pages {
    display: flex;
    align-items: center;
    gap: 8px;
}

.onyx-editor-portal--app .pagination-page {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 8px;
    background: #ffffff;
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 8px;
    color: #334155;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.onyx-editor-portal--app .pagination-page:hover {
    background: #f8fafc;
    border-color: #2D3142;
    color: #2D3142;
    transform: translateY(-1px);
}

.onyx-editor-portal--app .pagination-page.active {
    background: #2D3142;
    border-color: #2D3142;
    color: #ffffff;
    font-weight: 600;
}

.onyx-editor-portal--app .pagination-dots {
    padding: 0 8px;
    color: #94a3b8;
    font-size: 14px;
}

.onyx-editor-portal--app .pagination-info {
    margin-left: auto;
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}

@media (max-width: 768px) {
    .onyx-editor-portal--app .editor-pagination {
        flex-direction: column;
        gap: 12px;
    }
    
    .onyx-editor-portal--app .pagination-info {
        margin-left: 0;
        order: -1;
        width: 100%;
        text-align: center;
    }
    
    .onyx-editor-portal--app .pagination-pages {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .onyx-editor-portal--app .pagination-btn {
        flex: 1;
        justify-content: center;
        min-width: 120px;
    }
}

.onyx-editor-portal--app .no-posts .btn-quick-post,
.onyx-editor-portal--app .no-posts .btn-create-new {
    margin: 0 8px;
}

/* Responsive */
@media (max-width: 768px) {
    .onyx-editor-portal--app .editor-list-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .onyx-editor-portal--app .editor-list-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .onyx-editor-portal--app .list-actions-left {
        flex-direction: column;
        width: 100%;
    }
    
    .onyx-editor-portal--app .search-box {
        max-width: 100%;
    }
    
    .onyx-editor-portal--app .list-actions-right {
        width: 100%;
        flex-direction: column;
    }
    
    .onyx-editor-portal--app .list-actions-right .btn-quick-post,
    .onyx-editor-portal--app .list-actions-right .btn-create-new {
        width: 100%;
        justify-content: center;
    }
    
    .onyx-editor-portal--app .post-item {
        flex-direction: column;
    }
    
    .onyx-editor-portal--app .post-item-thumbnail {
        width: 100%;
        height: 200px;
    }
    
    .onyx-editor-portal--app .post-item-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .onyx-editor-portal--app .post-item-actions {
        flex-wrap: wrap;
    }
    
    .onyx-editor-portal--app .post-item-actions .btn-action {
        flex: 1;
        justify-content: center;
        min-width: 100px;
    }
}

/* === LOGIN FORM – Onyx "Studio" style (light) === */
.editor-login-box {
    background: rgba(255, 255, 255, 0.92);
    border-radius: 20px;
    padding: 44px 40px 34px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    box-shadow: 0 22px 60px rgba(15, 23, 42, 0.18);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    text-align: left;
    min-height: 420px; /* Prevent form from shifting when error appears */
    position: relative;
    box-sizing: border-box;
}

.editor-login-brand {
    display: inline-block;
    font-weight: 800;
    letter-spacing: 0.18em;
    font-size: 14px;
    color: #0f172a;
    padding-bottom: 10px;
    margin-bottom: 18px;
    border-bottom: 2px solid #D4F238; /* Onyx accent */
}

.editor-login-title {
    margin: 0 0 8px;
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: #111827;
    text-align: center;
}

.editor-login-subtitle {
    margin: 0 0 26px;
    font-size: 14px;
    color: #64748b;
    text-align: center;
}

.editor-login-box form p {
    margin-bottom: 18px;
    text-align: left;
}

.editor-login-box label {
    display: inline-block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 13px;
    color: #334155;
}

.editor-login-box input[type="password"],
.editor-login-box select {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    display: block;
    margin: 0 auto;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.45);
    font-size: 16px;
    background-color: rgba(248, 250, 252, 0.92);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
    font-family: inherit;
    color: #111827;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
}

.editor-login-box select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23334155' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 12px;
    padding-right: 40px;
}

.editor-login-box select:hover {
    border-color: rgba(148, 163, 184, 0.65);
    background-color: #ffffff;
}

.editor-login-box input[type="password"]:focus,
.editor-login-box select:focus {
    outline: none;
    border-color: #2D3142;
    background-color: #ffffff;
    box-shadow: 0 0 0 4px rgba(212, 242, 56, 0.22);
}

.editor-login-box input[type="password"]::placeholder {
    color: #94a3b8;
}

.editor-login-box select option {
    padding: 12px 16px;
    background-color: #ffffff;
    color: #111827;
}

.editor-login-box select option:first-child {
    color: #94a3b8;
    font-style: italic;
}

.editor-login-box #rememberme {
    margin-right: 6px;
}

/* Center the remember-me row */
.editor-login-box label[for="rememberme"] {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    margin: 0;
    width: 100%;
    color: #64748b;
}

.editor-login-box label[for="rememberme"] input {
    margin: 0;
}

.editor-login-box .submit {
    margin-top: 8px;
}

.editor-login-box input[type="submit"] {
    width: 100%;
    padding: 14px 18px;
    background: #2D3142;
    color: #ffffff;
    border: none;
    border-radius: 14px;
    font-size: 14px;
    cursor: pointer;
    font-weight: 600;
    letter-spacing: 0.04em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 14px 34px rgba(45, 49, 66, 0.25);
    transition: transform 0.12s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.editor-login-box input[type="submit"]:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 46px rgba(45, 49, 66, 0.28);
    background: #23252E;
}

.editor-login-box input[type="submit"]:active {
    transform: translateY(0);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.2);
}

.editor-login-footnote {
    display: block;
    margin-top: 18px;
    font-size: 12px;
    color: #94a3b8;
    text-align: center;
}

.login-error {
    background: #fef2f2;
    color: #b91c1c;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    border: 1px solid #fecaca;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Error message in login form - position to prevent layout shift */
.editor-login-box #login-error-message {
    margin-top: 12px;
    margin-bottom: 0;
}

.editor-login-box form {
    position: relative;
}

.login-status {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
}

.login-status.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.login-status.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
    padding: 10px 12px;
    border-radius: 10px;
    margin-bottom: 18px;
    border-left: 4px solid #ef4444;
    font-size: 13px;
}

/* 2. Khung lưới - Main column full width */
.editor-grid-layout {
    display: block;
    /* Single column, full width */
}

/* 3. Header Editor */
.editor-header {
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.editor-header h1 {
    margin: 0;
    color: #333;
}

.editor-user-info {
    color: #666;
}

.editor-user-info a {
    color: #0066cc;
    text-decoration: none;
}

.editor-user-info a:hover {
    text-decoration: underline;
}

/* 4. Layout Selector */
.layout-selector-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #eee;
}

.layout-selector-section label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #333;
    font-size: 16px;
}

.layout-style-select {
    width: 100%;
    max-width: 300px;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 15px;
    background: #fff;
    cursor: pointer;
}

.layout-style-select:focus {
    outline: none;
    border-color: #0066cc;
}

/* 5. Main Column (Full width) */
.main-column {
    background: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    width: 100%;
    max-width: 100%;
}

/* 4. Sidebar removed - no longer needed */
.sidebar-column {
    display: none;
}

/* Các khối xám giả lập Widget */
.mock-widget {
    background: #e0e0e0;
    height: 150px;
    /* Chiều cao cố định */
    margin-bottom: 20px;
    border-radius: 8px;
    opacity: 0.6;
    border: 2px dashed #ccc;
    /* Viền nét đứt để biết là hàng giả */
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #888;
}

.w-short {
    height: 80px;
}

.w-long {
    height: 300px;
}

/* Form inputs styling */
input[type="text"],
textarea {
    width: 100%;
    padding: 10px;
    box-sizing: border-box;
}

/* === LIVE PREVIEW EDITOR === */
.preview-live-editor {
    pointer-events: auto !important;
    margin-top: 30px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

.editor-preview-area {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}


.preview-layout {
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 30px;
    min-height: 600px;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    overflow-y: auto;
}

/* Preview Layout Wrapper */
.preview-layout-wrapper {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Preview Field Slots */
.preview-field-slot {
    margin-bottom: 32px;
    position: relative;
    z-index: 1;
    border-radius: 12px;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease, transform 0.12s ease;
    padding: 12px 16px;
}

.preview-field-slot.active {
    border: 1.5px solid rgba(59, 130, 246, 0.6);
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.18), 0 14px 30px rgba(15, 23, 42, 0.10);
    background: linear-gradient(180deg, rgba(239, 246, 255, 0.65), rgba(255, 255, 255, 0.98));
    transform: translateY(-1px);
    padding: 14px 18px;
}

/* Ensure WYSIWYG editor slots have higher z-index and are clickable */
.preview-field-slot .wysiwyg-wrapper,
.preview-field-slot .wp-editor-wrap {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

.preview-field-slot .wysiwyg-wrapper *,
.preview-field-slot .wp-editor-wrap * {
    pointer-events: auto !important;
}

/* Hide Code/Text tab in WYSIWYG editors - only show Visual mode */
.preview-field-slot .wp-editor-wrap .wp-editor-tabs,
.preview-field-slot .wp-switch-editor,
.preview-field-slot .wp-editor-tabs .wp-switch-editor.switch-html {
    display: none !important;
}

/* Ensure Visual mode is active and visible */
.preview-field-slot .wp-editor-wrap .wp-editor-container {
    border-top: 1px solid #ddd;
}

.preview-field-slot .wp-editor-wrap .mce-tinymce {
    border-top: none;
}

/* Custom Form Fields in Preview */
.preview-field-slot .form-field-wrapper {
    display: block !important;
    margin-bottom: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

.preview-field-slot .form-field-wrapper label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
    color: #333;
    font-size: 14px;
}

.preview-field-slot .form-field-wrapper input[type="text"],
.preview-field-slot .form-field-wrapper input[type="url"],
.preview-field-slot .form-field-wrapper textarea {
    width: 100%;
    max-width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
    overflow-x: hidden;
    word-wrap: break-word;
}

.preview-field-slot .form-field-wrapper.moved-to-preview {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Section Controls */
.section-header-controls {
    margin-bottom: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.preview-field-slot .section-header {
    font-size: 12px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
    font-weight: 600;
}

.field-placeholder,
.field-empty {
    min-height: 40px;
}

.field-empty {
    background: #f5f5f5;
    border: 2px dashed #ddd;
    border-radius: 4px;
    padding: 15px;
    color: #999;
    font-style: italic;
    text-align: center;
}


/* === STANDARD NEWS LAYOUT (7:3) === */
.preview-standard-layout .standard-layout-wrapper {
    display: grid;
    grid-template-columns: 70% 28%;
    gap: 2%;
    align-items: start;
    /* Preview layout with sidebar, but actual form is full width */
}

.preview-standard-layout .standard-main-content {
    /* Main content area */
    position: relative;
}

.preview-standard-layout .standard-sidebar {
    background: #f5f5f5;
    padding: 20px;
    border-radius: 6px;
    min-height: 400px;
    position: sticky;
    top: 20px;
    display: block;
    /* Sidebar in preview only, not in actual form */
}

.preview-standard-layout .standard-sidebar .sidebar-placeholder {
    color: #999;
    font-style: italic;
    text-align: center;
    padding: 40px 20px;
}

/* Title in Standard Layout */
.preview-standard-layout .title-slot input {
    font-size: 32px;
    font-weight: bold;
    padding: 15px;
    width: 100%;
    border: 2px solid #ddd;
    border-radius: 6px;
    color: #333;
}

.preview-standard-layout .title-slot input:focus {
    border-color: #0066cc;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

/* Hero Image in Standard */
.preview-standard-layout .hero-image-slot {
    margin: 20px 0;
}


/* Summary in Standard */
.preview-standard-layout .summary-slot textarea {
    font-size: 16px;
    line-height: 1.6;
    padding: 15px;
    width: 100%;
    min-height: 100px;
    border: 2px solid #ddd;
    border-left: 4px solid #0066cc;
    border-radius: 4px;
    background: #f8f9fa;
}

/* Sections in Standard */
.preview-standard-layout .section-slot {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 20px;
}

.section-component-selector {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin: 10px 0;
}

.section-component-selector label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: #555;
    cursor: pointer;
}

.section-component-selector input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}

.remove-section-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    margin-top: 10px;
}

.remove-section-btn:hover {
    background: #c82333;
}

.add-section-container {
    margin: 20px 0;
    text-align: center;
}

.add-section-container.fixed-bottom {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 15px 25px;
    border-radius: 10px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    text-align: center;
    border: 2px solid #e0e0e0;
}

.add-section-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
}

.add-section-btn:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.add-section-btn:active {
    transform: translateY(0);
}

.section-limit-message {
    color: #dc3545;
    font-size: 14px;
    padding: 10px;
    background: #f8d7da;
    border-radius: 4px;
    border: 1px solid #f5c6cb;
}

.preview-standard-layout .section-slot .section-title-input {
    font-size: 22px;
    font-weight: 600;
    padding: 12px;
    width: 100%;
    margin-bottom: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
}

.preview-standard-layout .section-slot .section-content-input {
    font-size: 15px;
    line-height: 1.7;
    padding: 15px;
    width: 100%;
    min-height: 120px;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    margin-bottom: 15px;
}

/* Section Image Field - Remove double border */
.preview-standard-layout .section-slot .section-image-field {
    /* Placeholder wrapper - no border */
    border: none;
    padding: 0;
    background: transparent;
}


/* Conclusion in Standard */
.preview-standard-layout .conclusion-slot {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    border-radius: 6px;
    padding: 20px;
    margin-top: 30px;
}

.preview-standard-layout .conclusion-slot textarea {
    font-size: 15px;
    line-height: 1.7;
    padding: 15px;
    width: 100%;
    min-height: 100px;
    border: 2px solid #ffc107;
    border-radius: 4px;
    background: #fff;
    color: #856404;
}

/* === FEATURE ARTICLE LAYOUT === */
.preview-feature-layout .feature-layout-wrapper {
    max-width: 900px;
    margin: 0 auto;
}

.preview-feature-layout .feature-hero {
    margin-bottom: 40px;
}


.preview-feature-layout .feature-title input {
    font-size: 42px;
    font-weight: bold;
    padding: 20px;
    width: 100%;
    text-align: center;
    border: 2px solid #ddd;
    border-radius: 8px;
    margin: 30px 0;
}

.preview-feature-layout .feature-summary textarea {
    font-size: 20px;
    font-style: italic;
    line-height: 1.8;
    padding: 25px;
    width: 100%;
    min-height: 120px;
    border: 2px solid #ddd;
    border-left: 5px solid #0066cc;
    border-radius: 4px;
    background: #f8f9fa;
    margin-bottom: 40px;
}

.preview-feature-layout .feature-section {
    margin: 40px 0;
    padding: 30px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.preview-feature-layout .feature-section .feature-section-title-input {
    font-size: 28px;
    font-weight: 600;
    padding: 15px;
    width: 100%;
    margin-bottom: 20px;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
}

.preview-feature-layout .feature-section .feature-section-content-input {
    font-size: 17px;
    line-height: 1.8;
    padding: 20px;
    width: 100%;
    min-height: 150px;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
}

.preview-feature-layout .feature-section .section-image-field {
    border: 2px dashed #ddd;
    border-radius: 4px;
    padding: 15px;
    background: #fafafa;
    min-height: 200px;
    display: block !important;
    width: 100%;
    margin: 15px 0;
}

.preview-feature-layout .feature-conclusion {
    margin-top: 50px;
    padding: 30px;
    background: #fff3cd;
    border-left: 5px solid #ffc107;
    border-radius: 8px;
}

/* === MAGAZINE LAYOUT === */
.preview-magazine-layout .magazine-layout-wrapper {
    max-width: 1000px;
    margin: 0 auto;
}

.preview-magazine-layout .magazine-title input {
    font-size: 36px;
    font-weight: bold;
    padding: 20px;
    width: 100%;
    text-align: center;
    border: 2px solid #ddd;
    border-radius: 8px;
    margin-bottom: 30px;
}

.preview-magazine-layout .magazine-hero-summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.preview-magazine-layout .magazine-section {
    margin: 30px 0;
    padding: 25px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.preview-magazine-layout .magazine-section-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}

.preview-magazine-layout .magazine-section-content .section-title-input {
    font-size: 24px;
    font-weight: 600;
    padding: 12px;
    width: 100%;
    margin-bottom: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
}

.preview-magazine-layout .magazine-section-content .section-content-input {
    font-size: 15px;
    line-height: 1.7;
    padding: 15px;
    width: 100%;
    min-height: 150px;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
}

.preview-magazine-layout .magazine-section-image .section-image-field {
    border: 2px dashed #ddd;
    border-radius: 4px;
    padding: 15px;
    background: #fafafa;
    min-height: 200px;
    display: block !important;
    width: 100%;
}

.preview-magazine-layout .magazine-conclusion {
    margin-top: 40px;
    padding: 25px;
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    border-radius: 8px;
    text-align: center;
}

/* Preview Content Styling */
.preview-title {
    font-size: 28px;
    font-weight: bold;
    color: #333;
    margin-bottom: 15px;
    line-height: 1.3;
}

.preview-summary {
    font-size: 16px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
    padding: 15px;
    background: #f0f0f0;
    border-left: 4px solid #0066cc;
}

.preview-hero-image {
    width: 100%;
    height: 300px;
    background: #e0e0e0;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    margin-bottom: 25px;
    border: 2px dashed #ccc;
}

.preview-hero-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

.preview-section-item {
    margin-bottom: 30px;
    padding: 20px;
    background: #fff;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.preview-section-title {
    font-size: 22px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
}

.preview-section-content {
    font-size: 15px;
    color: #555;
    line-height: 1.7;
    margin-bottom: 15px;
}

.preview-section-image {
    width: 100%;
    max-height: 250px;
    background: #e0e0e0;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    margin-top: 15px;
    border: 2px dashed #ccc;
    min-height: 150px;
}

.preview-section-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

.preview-conclusion {
    margin-top: 30px;
    padding: 20px;
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    border-radius: 6px;
}

.preview-conclusion-title {
    font-size: 20px;
    font-weight: 600;
    color: #856404;
    margin-bottom: 10px;
}

.preview-conclusion-content {
    font-size: 15px;
    color: #856404;
    line-height: 1.7;
}

/* Empty state */
.preview-empty {
    text-align: center;
    color: #999;
    padding: 60px 20px;
    font-style: italic;
}

/* Submit Button */
.editor-submit-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 3px solid #eee;
    text-align: center;
}

.editor-submit-section {
    margin: 0;
    text-align: center;
}

.editor-submit-section input[type="submit"],
.editor-submit-section .visible-submit-btn {
    background: #0066cc !important;
    color: #fff !important;
    border: none !important;
    padding: 15px 40px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
    cursor: pointer;
    transition: all 0.3s ease;
}

.editor-submit-section input[type="submit"]:hover,
.editor-submit-section .visible-submit-btn:hover {
    background: #0052a3 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
    .editor-grid-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .editor-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .main-column {
        padding: 20px;
    }
    
    .preview-standard-layout .standard-layout-wrapper {
        grid-template-columns: 1fr;
    }
    
    .preview-magazine-layout .magazine-hero-summary-grid,
    .preview-magazine-layout .magazine-section-grid {
        grid-template-columns: 1fr;
    }
    
    .preview-feature-layout .feature-title input,
    .preview-feature-layout .feature-title input {
        font-size: 28px;
    }
    
    .preview-standard-layout .title-slot input {
        font-size: 24px;
    }
}

/* ============================================================
 * FULL PREVIEW MODAL - Complete Redesign
 * ============================================================ */

.full-preview-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.full-preview-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    cursor: pointer;
}

.full-preview-content {
    position: relative;
    z-index: 10001;
    width: 100%;
    max-width: 1000px;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.full-preview-header {
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #1f2937;
    color: #ffffff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.full-preview-header h2 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.close-preview-btn {
    background: #ef4444;
    color: #ffffff;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.2s ease;
}

.close-preview-btn:hover {
    background: #dc2626;
}

.full-preview-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    background: #f9fafb;
}

.full-preview-body-inner {
    width: 100%;
    max-width: 100%;
    background: #ffffff;
    padding: 40px;
    min-height: 100%;
}

/* ============================================================
 * PREVIEW ARTICLE STRUCTURE
 * ============================================================ */

.preview-article {
    max-width: 800px;
    margin: 0 auto;
}

/* Empty State */
.preview-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.preview-empty-state p {
    margin: 0;
    font-size: 16px;
}

.preview-empty-state-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.preview-empty-state-sub {
    margin-top: 8px;
    font-size: 13px;
    color: #9ca3af;
}

/* ============================================================
 * ARTICLE HEADER (Title)
 * ============================================================ */

.preview-article-header {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 2px solid #e5e7eb;
}

.preview-article-title {
    font-size: 42px;
    font-weight: 800;
    line-height: 1.2;
    margin: 0;
    color: #111827;
    letter-spacing: -0.02em;
}

/* ============================================================
 * HERO IMAGE
 * ============================================================ */

.preview-hero-wrapper {
    margin: 0 0 32px 0;
    padding: 0;
    border-radius: 12px;
    overflow: hidden;
    background: #f3f4f6;
}

.preview-hero-img {
    width: 100%;
    height: auto;
    display: block;
    margin: 0;
}

.preview-hero-caption {
    margin: 12px 0 0 0;
    padding: 0 4px;
    font-size: 14px;
    color: #6b7280;
    font-style: italic;
    text-align: center;
    line-height: 1.5;
}

/* ============================================================
 * SUMMARY
 * ============================================================ */

.preview-summary-wrapper {
    margin: 0 0 40px 0;
    padding: 20px 24px;
    background: #f0f9ff;
    border-left: 4px solid #0ea5e9;
    border-radius: 8px;
}

.preview-summary-text {
    margin: 0;
    font-size: 18px;
    line-height: 1.7;
    color: #1e40af;
    font-weight: 400;
}

/* ============================================================
 * CONTENT BLOCKS CONTAINER
 * ============================================================ */

.preview-blocks-container {
    margin: 0 0 40px 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

.content-blocks-area {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

.preview-block-item {
    margin: 0 0 32px 0;
    padding: 0;
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

.preview-block-item:last-child {
    margin-bottom: 0;
}

/* Block Heading */
.preview-block-heading {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 16px 0;
    color: #111827;
    padding: 0;
}

/* Block Text Content */
.preview-block-text {
    font-size: 16px;
    line-height: 1.8;
    color: #374151;
    margin: 0;
    padding: 0;
}

.preview-block-text p {
    margin: 0 0 16px 0;
}

.preview-block-text p:last-child {
    margin-bottom: 0;
}

.preview-block-text h1,
.preview-block-text h2,
.preview-block-text h3,
.preview-block-text h4,
.preview-block-text h5,
.preview-block-text h6 {
    margin-top: 24px;
    margin-bottom: 12px;
    font-weight: 600;
    color: #111827;
}

.preview-block-text h1 { font-size: 32px; }
.preview-block-text h2 { font-size: 28px; }
.preview-block-text h3 { font-size: 24px; }
.preview-block-text h4 { font-size: 20px; }
.preview-block-text h5 { font-size: 18px; }
.preview-block-text h6 { font-size: 16px; }

.preview-block-text ul,
.preview-block-text ol {
    margin: 16px 0;
    padding-left: 24px;
}

.preview-block-text li {
    margin: 8px 0;
}

.preview-block-text a {
    color: #2563eb;
    text-decoration: underline;
}

.preview-block-text a:hover {
    color: #1d4ed8;
}

/* Block Image */
.preview-block-image-wrapper {
    margin: 24px 0;
    padding: 0;
    border-radius: 12px;
    overflow: hidden;
    background: #f3f4f6;
}

.preview-block-image {
    width: 100%;
    height: auto;
    display: block;
    margin: 0;
}

.preview-block-image-caption {
    display: block;
    margin: 12px 0 0 0;
    padding: 8px 12px;
    font-size: 14px;
    color: #6b7280;
    font-style: italic;
    text-align: center;
    line-height: 1.5;
    width: 100%;
    box-sizing: border-box;
}

/* ============================================================
 * YOUTUBE VIDEO
 * ============================================================ */

.preview-video-wrapper {
    margin: 40px 0;
    padding: 0;
}

.preview-video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    border-radius: 12px;
    background: #000000;
}

.preview-video-iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* ============================================================
 * CONCLUSION
 * ============================================================ */

.preview-conclusion-wrapper {
    margin: 48px 0 0 0;
    padding: 24px;
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    border-radius: 8px;
}

.preview-conclusion-content {
    font-size: 16px;
    line-height: 1.8;
    color: #92400e;
    margin: 0;
    padding: 0;
}

.preview-conclusion-content p {
    margin: 0 0 16px 0;
}

.preview-conclusion-content p:last-child {
    margin-bottom: 0;
}

/* ============================================================
 * RESPONSIVE
 * ============================================================ */

@media (max-width: 768px) {
    .full-preview-content {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .full-preview-body-inner {
        padding: 24px 20px;
    }

    .preview-article-title {
        font-size: 32px;
    }

    .preview-summary-text {
        font-size: 16px;
    }

    .preview-block-heading {
        font-size: 24px;
    }

    .preview-block-text {
        font-size: 15px;
    }
}

/* Preview Button (editor footer) */
.preview-full-btn {
    background: #0ea5e9;
    color: #ffffff;
    border: none;
    padding: 12px 24px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    margin-left: 12px;
    transition: background 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
}

.preview-full-btn:hover {
    background: #0284c7;
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.35);
}

.editor-submit-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.editor-submit-left,
.editor-submit-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.save-draft-btn {
    padding: 8px 14px;
    border-radius: 6px;
    border: 1px solid #d0e2ff;
    background: #f0f6ff;
    color: #1d4ed8;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease, box-shadow 0.1s ease;
}

.save-draft-btn:hover {
    background: #e0edff;
    border-color: #a5c4ff;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}

.save-draft-btn:active {
    transform: translateY(0);
    box-shadow: none;
}

.draft-status {
    font-size: 12px;
    color: #6b7280;
    min-width: 120px;
    text-align: left;
}

.draft-status.draft-status-dirty {
    color: #b45309;
}

.draft-status.draft-status-saving {
    color: #2563eb;
}

.draft-status.draft-status-saved {
    color: #15803d;
}

.draft-status.draft-status-error {
    color: #b91c1c;
}

/* Hide textarea completely - TinyMCE will use its own iframe */
.wysiwyg-wrapper textarea.block-text-input {
    visibility: hidden !important;
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    overflow: hidden !important;
}

/* Ensure wysiwyg-wrapper has proper size */
.wysiwyg-wrapper {
    width: 100% !important;
    min-height: 300px !important;
    position: relative;
}

/* Ensure TinyMCE iframe is visible and has proper size */
.wysiwyg-wrapper .mce-tinymce,
.wysiwyg-wrapper .wp-editor-wrap {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
    min-height: 300px !important;
}

/* Ensure TinyMCE iframe has proper height */
.wysiwyg-wrapper .mce-tinymce iframe,
.wysiwyg-wrapper .wp-editor-wrap .mce-tinymce iframe {
    min-height: 300px !important;
    height: 300px !important;
    width: 100% !important;
}

/* Ensure editor container has proper size */
.wysiwyg-wrapper .wp-editor-container {
    min-height: 300px !important;
    width: 100% !important;
}

/* Ensure block field wrapper doesn't constrain size */
.preview-block .block-field-wrapper .wysiwyg-wrapper {
    width: 100% !important;
    min-height: 300px !important;
}

/* Loading placeholder for WYSIWYG */
.wysiwyg-loading {
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: opacity 0.3s;
    min-height: 300px;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
}

.wysiwyg-loading[style*="display: none"] {
    display: none !important;
}

/* Hide conclusion TinyMCE in hidden container to prevent duplicate editors */
#onyx-form-fields .form-field-wrapper[data-field-key="conclusion"] .wp-editor-wrap,
#onyx-form-fields .form-field-wrapper[data-field-key="conclusion"] .mce-tinymce,
#onyx-form-fields .form-field-wrapper[data-field-key="conclusion"] .wp-editor-container {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
}

/* Structure Item Layout */
.structure-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 8px;
    will-change: transform;
    transition: none; /* Disable transitions during drag for better performance */
    -webkit-user-select: none; /* Prevent text selection during drag (Safari) */
    user-select: none; /* Prevent text selection during drag */
}

/* Drag Handle Icon */
.structure-item-drag-handle {
    cursor: grab !important;
    color: #999;
    font-size: 18px;
    padding: 4px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
    flex-shrink: 0;
    pointer-events: auto !important;
    -webkit-user-select: none;
    user-select: none;
    touch-action: none; /* Prevent touch scrolling on mobile */
}

.structure-item-drag-handle:hover {
    background: #f0f0f0;
    color: #666;
    cursor: grabbing !important;
}

.structure-item-drag-handle:active {
    cursor: grabbing !important;
    background: #e0e0e0;
}

.structure-item:hover .structure-item-drag-handle {
    color: #666;
}

/* Ensure handle is always clickable */
.structure-item-drag-handle * {
    pointer-events: none; /* Prevent child elements from blocking */
}

.structure-item.dragging {
    opacity: 0.6;
    cursor: grabbing !important;
    transform: scale(0.98);
    z-index: 1000;
    pointer-events: none; /* Prevent interference during drag */
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    /* Keep element visible enough for browser to create drag image */
    /* Browser will create drag image from this element automatically */
}

.structure-item:not(.dragging) {
    transition: transform 0.2s ease-out, opacity 0.2s ease-out; /* Smooth transition when not dragging */
}

/* Placeholder for drag-drop */
.structure-item-placeholder {
    background: #e3f2fd;
    border: 2px dashed #2196f3;
    border-radius: 6px;
    margin-bottom: 8px;
    opacity: 0.6;
    animation: placeholderPulse 1.5s ease-in-out infinite;
}

@keyframes placeholderPulse {
    0%, 100% {
        opacity: 0.4;
        border-color: #2196f3;
    }
    50% {
        opacity: 0.7;
        border-color: #1976d2;
    }
}

/* Smooth transition for items when reordering */
.structure-item {
    transition: transform 0.2s ease-out, opacity 0.2s ease-out;
}

/* Structure Item Icon and Label */
.structure-item-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.structure-item-label {
    flex: 1;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
}

.structure-item-label:hover {
    color: #0073aa;
}

/* Structure item action buttons */
.structure-item-actions .btn-item-action.is-disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.structure-item-actions .btn-item-action.btn-duplicate {
    font-weight: 700;
}

/* Info toast for undo */
.ajax-message-info {
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.28);
    color: #1e3a8a;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.ajax-message-undo {
    margin-left: 10px;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid rgba(30, 58, 138, 0.25);
    background: rgba(255, 255, 255, 0.55);
    color: #1e3a8a;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.ajax-message-undo:hover {
    background: rgba(255, 255, 255, 0.75);
}

/* Editable label input */
.structure-item-label-edit {
    flex: 1;
    padding: 4px 8px;
    border: 2px solid #0073aa !important;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    outline: none;
    background: white;
    color: #333;
    font-family: inherit;
}

.structure-item-label-edit:focus {
    border-color: #005a87 !important;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

.structure-item-actions {
    display: flex;
    gap: 5px;
    flex-shrink: 0;
}

/* Ensure buttons don't block drag but still work for clicks */
.structure-item .structure-item-actions {
    pointer-events: auto;
}

.structure-item .structure-item-actions button {
    pointer-events: auto;
}

/* =========================================================
   FORM VALIDATION STYLES
   ========================================================= */

/* Validation error state */
.validation-error {
    border-color: #dc3545 !important;
    background-color: #fff5f5 !important;
}

.validation-error:focus {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1) !important;
    outline: none;
}

/* Validation error message */
.validation-error-message {
    display: block;
    margin-top: 6px;
    padding: 8px 12px;
    background-color: #fee;
    border: 1px solid #fcc;
    border-radius: 6px;
    color: #c33;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Validation error for input fields */
input.validation-error,
textarea.validation-error,
select.validation-error {
    border-color: #dc3545 !important;
    background-color: #fff5f5 !important;
}

input.validation-error:focus,
textarea.validation-error:focus,
select.validation-error:focus {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1) !important;
}

/* Validation error for blocks area */
.content-blocks-area.validation-error {
    border: 2px dashed #dc3545;
    border-radius: 8px;
    padding: 20px;
    background-color: #fff5f5;
}

.content-blocks-area.validation-error .validation-error-message {
    margin-top: 0;
}

/* Validation error for preview field slots */
.preview-field-slot.validation-error {
    border: 2px dashed #dc3545;
    border-radius: 8px;
    padding: 12px;
    background-color: #fff5f5;
}

/* Validation success state (optional, for future use) */
.validation-success {
    border-color: #28a745 !important;
}

.validation-success:focus {
    border-color: #28a745 !important;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1) !important;
}

/* =========================================================
   AJAX MESSAGES AND LOADING STATES
   ========================================================= */

/* AJAX Loading State */
.ajax-loading {
    position: relative;
    opacity: 0.7;
    cursor: not-allowed !important;
    pointer-events: none;
}

.ajax-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    margin: auto;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
}

@keyframes spin {
    0% { transform: translateY(-50%) rotate(0deg); }
    100% { transform: translateY(-50%) rotate(360deg); }
}

/* AJAX Message Container (stack) */
.ajax-message-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
    max-width: min(420px, calc(100vw - 40px));
    pointer-events: none; /* messages will enable pointer events */
}

.ajax-message {
    position: relative;
    max-width: 400px;
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 14px 38px rgba(15, 23, 42, 0.18);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
    opacity: 0;
    transform: translateY(-6px);
    transition: all 0.22s ease-out;
    pointer-events: none;
}

.ajax-message.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Success Message */
.ajax-message-success {
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.28);
    color: #064e3b;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.ajax-message-success::before {
    content: '✓';
    display: inline-block;
    width: 20px;
    height: 20px;
    line-height: 20px;
    text-align: center;
    background-color: #28a745;
    color: white;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
    flex-shrink: 0;
}

/* Error Message */
.ajax-message-error {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.28);
    color: #7f1d1d;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.ajax-message-error::before {
    content: '✕';
    display: inline-block;
    width: 20px;
    height: 20px;
    line-height: 20px;
    text-align: center;
    background-color: #dc3545;
    color: white;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
    flex-shrink: 0;
}

/* Message Close Button */
.ajax-message-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    line-height: 1;
    opacity: 0.7;
    flex-shrink: 0;
    transition: opacity 0.2s;
}

.ajax-message-close:hover {
    opacity: 1;
}

.ajax-message-close:focus {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* Message Text */
.ajax-message-text {
    flex: 1;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
}

/* ============================================================
 * Media (Hero / Block) Meta Fields
 * ============================================================ */
.image-meta-fields {
    margin-top: 12px;
    padding: 10px;
    border: 1px solid #e5e7eb;
    background: #fafafa;
    border-radius: 8px;
}

.image-meta-row {
    margin-top: 10px;
}

.image-meta-row:first-child {
    margin-top: 0;
}

.image-meta-label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 700;
    color: #374151;
}

.hero-image-alt,
.hero-image-caption,
.hero-image-size {
    width: 100%;
    padding: 8px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
}

.image-meta-hint {
    margin: 6px 0 0 0;
    font-size: 12px;
    color: #6b7280;
}

/* ============================================================
 * KEYBOARD SHORTCUTS
 * ============================================================ */

/* Help Button */
.keyboard-shortcuts-help-btn {
    padding: 8px 14px;
    border-radius: 6px;
    border: 1px solid #d0e2ff;
    background: #f0f6ff;
    color: #1d4ed8;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
    margin-left: 10px;
}

.keyboard-shortcuts-help-btn:hover {
    background: #e0edff;
    border-color: #a5c4ff;
    transform: translateY(-1px);
}

/* Selected Block Highlight - Subtle style for keyboard navigation */
.preview-block.selected,
[data-block-id].selected {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
    background: rgba(59, 130, 246, 0.05);
    border-radius: 6px;
    transition: outline 0.15s ease, background 0.15s ease;
}

/* Keyboard Shortcuts Modal */
.keyboard-shortcuts-modal {
    position: fixed;
    inset: 0;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.keyboard-shortcuts-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    cursor: pointer;
}

.keyboard-shortcuts-modal-content {
    position: relative;
    z-index: 10002;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.keyboard-shortcuts-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f9fafb;
}

.keyboard-shortcuts-modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 8px;
}

.keyboard-shortcuts-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background 0.2s ease, color 0.2s ease;
}

.keyboard-shortcuts-modal-close:hover {
    background: #e5e7eb;
    color: #111827;
}

.keyboard-shortcuts-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.keyboard-shortcut-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f3f4f6;
}

.keyboard-shortcut-item:last-child {
    border-bottom: none;
}

.keyboard-shortcut-item kbd {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #374151;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    min-width: 24px;
    justify-content: center;
    margin: 0 2px;
}

.keyboard-shortcut-item span {
    color: #6b7280;
    font-size: 14px;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
    .keyboard-shortcuts-modal-content {
        max-width: 95%;
    }

    .keyboard-shortcuts-modal-header {
        padding: 16px 20px;
    }

    .keyboard-shortcuts-modal-body {
        padding: 20px;
    }

    .keyboard-shortcut-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* ============================================================
 * QUICK POST - Fast Article Creation
 * Modern, clean, professional UI
 * ============================================================ */

.onyx-quick-post-page {
    background: #f9fafb;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.onyx-quick-post-wrapper {
    width: 100%;
    min-height: 100vh;
    padding: 0;
}

.onyx-quick-post-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Header */
.quick-post-header {
    margin-bottom: 48px;
    padding: 32px;
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.quick-post-header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.quick-post-user-info {
    font-size: 14px;
    color: #64748b;
}

.quick-post-user-info a {
    color: #2D3142;
    text-decoration: none;
    font-weight: 600;
}

.quick-post-user-info a:hover {
    text-decoration: underline;
}

.quick-post-header-content {
    flex: 1;
}

.quick-post-title {
    font-size: 36px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: -0.02em;
}

.quick-post-icon {
    font-size: 40px;
    line-height: 1;
}

.quick-post-subtitle {
    font-size: 16px;
    color: #64748b;
    margin: 0;
}

.quick-post-back-btn {
    padding: 12px 24px;
    background: #f1f5f9;
    color: #2D3142;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.quick-post-back-btn:hover {
    background: #e2e8f0;
    color: #1e293b;
    transform: translateY(-1px);
}

.quick-post-btn {
    padding: 10px 20px;
    background: #D4F238;
    color: #2D3142;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
    border: 1px solid rgba(212, 242, 56, 0.3);
    display: inline-block;
}

.quick-post-btn:hover {
    background: #c4e228;
    color: #1e293b;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(212, 242, 56, 0.3);
}

/* Template Selection Section */
.quick-post-templates {
    margin-bottom: 48px;
}

.section-title {
    font-size: 28px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 32px 0;
    letter-spacing: -0.01em;
}

.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}

.template-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
    transition: all 0.3s ease;
    border: 2px solid transparent;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.template-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
    border-color: rgba(212, 242, 56, 0.3);
}

.template-card.selected {
    border-color: #D4F238;
    box-shadow: 0 12px 28px rgba(212, 242, 56, 0.2);
}

.template-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.template-icon {
    font-size: 32px;
    line-height: 1;
}

.template-name {
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.template-preview {
    background: #f8fafc;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    min-height: 200px;
    border: 1px solid rgba(148, 163, 184, 0.15);
}

.preview-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.preview-title {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.3;
}

.preview-summary {
    font-size: 14px;
    color: #64748b;
    line-height: 1.5;
}

.preview-hero {
    width: 100%;
    height: 80px;
    background: linear-gradient(135deg, #e0f2fe 0%, #cfe2ff 100%);
    border-radius: 8px;
}

.preview-hero.large {
    height: 120px;
}

.preview-image {
    width: 100%;
    height: 60px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 6px;
}

.preview-text {
    font-size: 13px;
    color: #475569;
    line-height: 1.6;
}

.template-description {
    font-size: 14px;
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 20px;
    flex: 1;
}

.template-select-btn {
    width: 100%;
    padding: 14px 24px;
    background: #2D3142;
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: auto;
}

.template-select-btn:hover {
    background: #1e293b;
    transform: translateY(-1px);
}

.template-select-btn:active {
    transform: translateY(0);
}

.template-preview-btn {
    text-decoration: none;
    display: block;
    text-align: center;
    padding: 14px 24px;
    background: #f1f5f9;
    color: #2D3142;
    border: 1.5px solid rgba(148, 163, 184, 0.3);
    border-radius: 10px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.template-preview-btn:hover {
    background: #e2e8f0;
    border-color: #D4F238;
    color: #0f172a;
    transform: translateY(-1px);
}

.template-preview-btn:active {
    transform: translateY(0);
}

.template-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.template-actions .template-select-btn {
    margin-top: 0;
}

/* Form Section */
.quick-post-form-section {
    background: #ffffff;
    border-radius: 18px;
    padding: 40px;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08);
}

/* Template 2: Dark form section */
.quick-post-form-template2 .quick-post-form-section,
.quick-post-form-visual .quick-post-form-section {
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
}

.form-header {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 2px solid #f1f5f9;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.back-to-templates-btn {
    padding: 10px 20px;
    background: #f1f5f9;
    color: #2D3142;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.back-to-templates-btn:hover {
    background: #e2e8f0;
    transform: translateY(-1px);
}

.form-title {
    font-size: 28px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    flex: 1;
    letter-spacing: -0.01em;
}

/* Form Groups */
.form-group {
    margin-bottom: 28px;
}

.form-label {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 10px;
}

.form-label .required {
    color: #ef4444;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid rgba(148, 163, 184, 0.3);
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    color: #0f172a;
    background: #ffffff;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: #D4F238;
    box-shadow: 0 0 0 3px rgba(212, 242, 56, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form-textarea.wysiwyg-textarea {
    min-height: 200px;
}

/* Image Upload */
.image-upload-area {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.image-preview {
    width: 100%;
    max-width: 600px;
    min-height: 200px;
    background: #f8fafc;
    border: 2px dashed rgba(148, 163, 184, 0.3);
    border-radius: 12px;
    display: none;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Template 2: Dark image preview */
.quick-post-form-template2 .image-preview,
.quick-post-form-visual .image-preview {
    background: rgba(15, 23, 42, 0.5) !important;
    border-color: rgba(229, 231, 235, 0.2) !important;
}

.image-preview.has-image {
    display: flex;
    border-style: solid;
    padding: 0;
}

.image-preview img {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: contain;
}

.image-upload-btn,
.image-remove-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    align-self: flex-start;
}

.image-upload-btn {
    background: #2D3142;
    color: #ffffff;
}

.image-upload-btn:hover {
    background: #1e293b;
    transform: translateY(-1px);
}

.image-remove-btn {
    background: #f1f5f9;
    color: #64748b;
}

.image-remove-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

/* Template 2: Dark buttons */
.quick-post-form-template2 .image-upload-btn,
.quick-post-form-visual .image-upload-btn {
    background: rgba(212, 242, 56, 0.1) !important;
    color: #D4F238 !important;
    border: 1px solid rgba(212, 242, 56, 0.3) !important;
}

.quick-post-form-template2 .image-upload-btn:hover,
.quick-post-form-visual .image-upload-btn:hover {
    background: rgba(212, 242, 56, 0.2) !important;
    border-color: #D4F238 !important;
}

.quick-post-form-template2 .image-remove-btn,
.quick-post-form-visual .image-remove-btn {
    background: rgba(239, 68, 68, 0.1) !important;
    color: #ef4444 !important;
    border: 1px solid rgba(239, 68, 68, 0.3) !important;
}

.quick-post-form-template2 .image-remove-btn:hover,
.quick-post-form-visual .image-remove-btn:hover {
    background: rgba(239, 68, 68, 0.2) !important;
    border-color: #ef4444 !important;
}

/* Content Blocks */
.content-blocks-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 16px;
}

.content-block-item {
    background: #f8fafc;
    border: 1.5px solid rgba(148, 163, 184, 0.2);
    border-radius: 12px;
    padding: 20px;
    position: relative;
}

.content-block-item.block-type-heading {
    background: #ffffff;
}

.content-block-item.block-type-text {
    background: #ffffff;
}

.content-block-item.block-type-image {
    background: #ffffff;
}

.block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.block-type-label {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.block-remove-btn {
    padding: 6px 12px;
    background: #fee2e2;
    color: #dc2626;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.block-remove-btn:hover {
    background: #fecaca;
}

.block-content {
    width: 100%;
}

.block-content input,
.block-content textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    color: #0f172a;
    background: #ffffff;
}

.block-content input:focus,
.block-content textarea:focus {
    outline: none;
    border-color: #D4F238;
    box-shadow: 0 0 0 2px rgba(212, 242, 56, 0.1);
}

.block-image-preview {
    width: 100%;
    max-width: 400px;
    margin-top: 12px;
    border-radius: 8px;
    overflow: hidden;
    display: none;
}

.block-image-preview.has-image {
    display: block;
}

.block-image-preview img {
    width: 100%;
    height: auto;
}

.add-block-btn {
    padding: 12px 20px;
    background: #f1f5f9;
    color: #2D3142;
    border: 1.5px dashed rgba(148, 163, 184, 0.3);
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.add-block-btn:hover {
    background: #e2e8f0;
    border-color: #D4F238;
    color: #0f172a;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 16px;
    margin-top: 40px;
    padding-top: 32px;
    border-top: 2px solid #f1f5f9;
    flex-wrap: wrap;
}

.btn-primary,
.btn-secondary,
.btn-draft {
    padding: 14px 32px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: #2D3142;
    color: #ffffff;
    flex: 1;
    min-width: 180px;
}

.btn-primary:hover {
    background: #1e293b;
}

.btn-draft {
    background: #f1f5f9;
    color: #2D3142;
    border: 1.5px solid rgba(148,163,184,0.3);
    flex: 1;
    min-width: 180px;
}

.btn-draft:hover {
    background: #e2e8f0;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.btn-primary:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: #f1f5f9;
    color: #2D3142;
    min-width: 140px;
}

.btn-secondary:hover {
    background: #e2e8f0;
    transform: translateY(-1px);
}

/* Status Message */
.form-status {
    margin-top: 24px;
    padding: 16px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
}

.form-status.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.form-status.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.form-status.info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

/* === QUICK POST – TEMPLATE 1 STYLE LAYOUT (EDITOR VIEW) === */

.quick-post-form-template1 .qp-template1-layout {
    background: #ffffff;
    border-radius: 18px;
    overflow: hidden;
}

/* Template 2: Dark layout - no white background */
.quick-post-form-template2 .qp-template1-layout,
.quick-post-form-visual .qp-template1-layout {
    background: transparent !important;
    border-radius: 0 !important;
}

.quick-post-form-template1 .qp-article-header {
    padding: 40px 40px 28px;
    border-bottom: 3px solid #D4F238;
    background: #ffffff;
}

.quick-post-form-template1 .qp-article-category-badge {
    display: inline-block;
    padding: 6px 16px;
    background: #2D3142;
    color: #D4F238;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 20px;
    border-radius: 4px;
}

.quick-post-form-template1 .qp-article-title-wrapper {
    margin-bottom: 16px;
}

.quick-post-form-template1 .qp-article-title-input {
    font-size: 34px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.02em;
    border-radius: 0;
    border: none;
    border-bottom: 2px solid rgba(148, 163, 184, 0.35);
    padding: 6px 0 10px;
    width: 100%;
}

.quick-post-form-template1 .qp-article-title-input:focus {
    border-color: #2D3142;
    box-shadow: none;
}

.quick-post-form-template1 .qp-article-meta {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-top: 10px;
    font-size: 13px;
    color: #64748b;
    flex-wrap: wrap;
}

.quick-post-form-template1 .qp-article-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.quick-post-form-template1 .qp-article-meta-hint {
    opacity: 0.9;
}

.quick-post-form-template1 .qp-article-hero-section {
    width: 100%;
}

/* Template 2: Dark hero section */
.quick-post-form-template2 .qp-article-hero-section,
.quick-post-form-visual .qp-article-hero-section {
    background: transparent !important;
    padding: 40px 0 !important;
}

.quick-post-form-template1 .qp-hero-group-inner {
    margin: 0;
    padding: 0 40px 0;
}

/* Template 2: Dark hero group */
.quick-post-form-template2 .qp-hero-group-inner,
.quick-post-form-visual .qp-hero-group-inner {
    padding: 0 !important;
}

.quick-post-form-template1 .qp-hero-upload-area {
    margin-top: 18px;
}

.quick-post-form-template1 .qp-article-hero-preview {
    width: 100%;
    height: 420px;
    max-width: 100%;
    border-radius: 8px;
    border: 2px dashed #cbd5e1;
    background: #f8fafc;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.quick-post-form-template1 .qp-article-hero-preview:hover {
    border-color: #94a3b8;
    background: #f1f5f9;
}

.quick-post-form-template1 .qp-article-hero-preview.has-image {
    border: none;
    background: transparent;
    padding: 0;
}

.quick-post-form-template1 .qp-article-hero-preview.has-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

/* Hero skeleton placeholder */
.hero-skeleton-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    height: 100%;
    color: #94a3b8;
    text-align: center;
    padding: 40px;
}

.hero-skeleton-placeholder svg {
    width: 64px;
    height: 64px;
    opacity: 0.5;
    margin-bottom: 8px;
}

.hero-skeleton-text {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
    color: #64748b;
}

.hero-skeleton-hint {
    margin: 0;
    font-size: 13px;
    color: #94a3b8;
    font-weight: 400;
}

/* Hide skeleton when image is loaded */
.quick-post-form-template1 .qp-article-hero-preview.has-image .hero-skeleton-placeholder {
    display: none;
}

.quick-post-form-template1 .qp-hero-buttons-row {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.quick-post-form-template1 .qp-article-summary-section {
    padding: 28px 40px 32px;
    background: #ffffff;
}

/* Template 2: Dark summary section */
.quick-post-form-template2 .qp-article-summary-section,
.quick-post-form-visual .qp-article-summary-section {
    background: transparent !important;
    padding: 40px 0 !important;
}

.quick-post-form-template1 .qp-article-summary {
    border-left: 4px solid #2D3142;
    padding: 14px 20px;
    background: #ffffff;
}

.quick-post-form-template1 .qp-article-summary-label {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    margin-bottom: 4px;
}

.quick-post-form-template1 .qp-article-summary-input {
    border: none;
    padding: 0;
    background: transparent;
    font-size: 17px;
    line-height: 1.7;
    color: #475569;
    font-style: italic;
}

.quick-post-form-template1 .qp-article-summary-input:focus {
    box-shadow: none;
}

.quick-post-form-template1 .qp-article-body {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.9fr);
    gap: 40px;
    padding: 34px 40px 36px;
    background: #ffffff;
}

/* Template 2: Dark body */
.quick-post-form-template2 .qp-article-body,
.quick-post-form-visual .qp-article-body {
    background: transparent !important;
    padding: 0 !important;
    display: block !important;
}

.quick-post-form-template2 .qp-article-content,
.quick-post-form-visual .qp-article-content {
    background: transparent !important;
}

.quick-post-form-template2 .qp-article-sidebar,
.quick-post-form-visual .qp-article-sidebar {
    display: none !important;
}

.quick-post-form-template1 .qp-article-content {
    min-width: 0;
}

.quick-post-form-template1 .qp-blocks-group {
    margin-bottom: 32px;
}

.quick-post-form-template1 .qp-blocks-label {
    margin-bottom: 14px;
}

.quick-post-form-template1 .qp-content-blocks-container {
    margin-top: 4px;
}

.quick-post-form-template1 .qp-conclusion-group {
    margin-top: 32px;
}

.quick-post-form-template1 .qp-conclusion-label {
    margin-bottom: 10px;
}

/* Conclusion styling removed - using default textarea styles */

.quick-post-form-template1 .qp-video-group {
    margin-top: 28px;
}

.quick-post-form-template1 .qp-video-label {
    margin-bottom: 8px;
}

.quick-post-form-template1 .qp-article-video {
    padding: 16px 18px 14px;
    border-radius: 10px;
    background: #f9fafb;
    border: 1px solid rgba(148, 163, 184, 0.35);
}

/* Template 2: Dark video group */
.quick-post-form-template2 .qp-article-video,
.quick-post-form-visual .qp-article-video {
    background: rgba(15, 23, 42, 0.3) !important;
    border-color: rgba(229, 231, 235, 0.2) !important;
}

.quick-post-form-template1 .qp-video-input {
    width: 100%;
}

.quick-post-form-template1 .qp-video-hint {
    margin: 8px 0 0;
    font-size: 12px;
    color: #64748b;
}

.quick-post-form-template1 .qp-article-sidebar {
    border-left: 1px solid #e5e7eb;
    padding-left: 28px;
}

.quick-post-form-template1 .qp-sidebar-widget {
    margin-bottom: 26px;
    padding-bottom: 18px;
    border-bottom: 1px solid #e5e7eb;
}

.quick-post-form-template1 .qp-sidebar-widget:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.quick-post-form-template1 .qp-sidebar-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #0f172a;
    margin: 0 0 8px;
}

.quick-post-form-template1 .qp-sidebar-text {
    font-size: 13px;
    line-height: 1.7;
    color: #64748b;
    margin: 0;
}

/* ============================================
   Template 2 (Visual Story) - Dark Layout
   ============================================ */

/* Full page dark background when Template 2 is selected */
body:has(.quick-post-form-template2),
body:has(.quick-post-form-visual) {
    background: #020617 !important;
}

body:has(.quick-post-form-template2) .onyx-quick-post-wrapper,
body:has(.quick-post-form-visual) .onyx-quick-post-wrapper {
    background: #020617;
    min-height: 100vh;
}

body:has(.quick-post-form-template2) .onyx-quick-post-container,
body:has(.quick-post-form-visual) .onyx-quick-post-container {
    background: #020617;
}

.quick-post-form-template2,
.quick-post-form-visual {
    background: #020617;
    color: #e5e7eb;
}

.quick-post-form-template2 .qp-template1-layout,
.quick-post-form-visual .qp-template1-layout {
    background: #020617;
    border-color: rgba(229, 231, 235, 0.1);
}

.quick-post-form-template2 .qp-article-header,
.quick-post-form-visual .qp-article-header {
    background: transparent !important;
    border-bottom-color: rgba(229, 231, 235, 0.15);
    color: #e5e7eb;
    padding: 0 0 40px 0;
}

.quick-post-form-template2 .qp-article-header-top,
.quick-post-form-visual .qp-article-header-top {
    background: transparent !important;
}

.quick-post-form-template2 .qp-article-category-badge,
.quick-post-form-visual .qp-article-category-badge {
    background: rgba(212, 242, 56, 0.2) !important;
    color: #D4F238 !important;
    border: 1px solid rgba(212, 242, 56, 0.3) !important;
    border-radius: 2px !important;
}

.quick-post-form-template2 .qp-article-title-input,
.quick-post-form-visual .qp-article-title-input {
    font-size: 64px !important;
    font-weight: 300 !important;
    line-height: 1.1 !important;
    color: #ffffff !important;
    border-bottom-color: rgba(229, 231, 235, 0.3) !important;
    letter-spacing: -0.01em !important;
    padding: 10px 0 !important;
    background: transparent !important;
    border: none !important;
    border-bottom: 2px solid rgba(229, 231, 235, 0.3) !important;
}

.quick-post-form-template2 .qp-article-title-input:focus,
.quick-post-form-visual .qp-article-title-input:focus {
    border-bottom-color: #D4F238 !important;
    box-shadow: none !important;
}

.quick-post-form-template2 .qp-article-title-input::placeholder,
.quick-post-form-visual .qp-article-title-input::placeholder {
    color: rgba(255, 255, 255, 0.5) !important;
}

.quick-post-form-template2 .qp-article-meta,
.quick-post-form-visual .qp-article-meta {
    color: #9ca3af;
}

.quick-post-form-template2 .form-input,
.quick-post-form-visual .form-input {
    background: rgba(15, 23, 42, 0.5);
    border-color: rgba(229, 231, 235, 0.2);
    color: #e5e7eb;
}

.quick-post-form-template2 .form-input:focus,
.quick-post-form-visual .form-input:focus {
    background: rgba(15, 23, 42, 0.7);
    border-color: #bbf7d0;
    color: #e5e7eb;
}

.quick-post-form-template2 .form-input::placeholder,
.quick-post-form-visual .form-input::placeholder {
    color: #6b7280;
}

.quick-post-form-template2 .form-label,
.quick-post-form-visual .form-label {
    color: #d1d5db;
}

.quick-post-form-template2 .qp-article-summary-section,
.quick-post-form-visual .qp-article-summary-section {
    background: rgba(15, 23, 42, 0.3);
    border-color: rgba(229, 231, 235, 0.1);
}

.quick-post-form-template2 .qp-article-summary,
.quick-post-form-visual .qp-article-summary {
    background: rgba(15, 23, 42, 0.5);
    border-left-color: #bbf7d0;
    color: #e5e7eb;
}

.quick-post-form-template2 .qp-article-summary-input,
.quick-post-form-visual .qp-article-summary-input {
    color: #e5e7eb;
}

.quick-post-form-template2 .qp-article-summary-label,
.quick-post-form-visual .qp-article-summary-label {
    color: #9ca3af;
}

.quick-post-form-template2 .qp-article-hero-preview,
.quick-post-form-visual .qp-article-hero-preview {
    background: rgba(15, 23, 42, 0.5);
    border-color: rgba(229, 231, 235, 0.2);
}

/* Conclusion textarea styling removed - using default textarea styles */

.quick-post-form-template2 .qp-video-input,
.quick-post-form-visual .qp-video-input {
    background: rgba(15, 23, 42, 0.5);
    border-color: rgba(229, 231, 235, 0.2);
    color: #e5e7eb;
}

.quick-post-form-template2 .qp-video-input:focus,
.quick-post-form-visual .qp-video-input:focus {
    background: rgba(15, 23, 42, 0.7);
    border-color: #bbf7d0;
}

.quick-post-form-template2 .quick-post-block-toolbar,
.quick-post-form-visual .quick-post-block-toolbar {
    background: rgba(15, 23, 42, 0.6);
    border-color: rgba(229, 231, 235, 0.2);
}

.quick-post-form-template2 .qp-toolbar-btn,
.quick-post-form-visual .qp-toolbar-btn {
    background: rgba(15, 23, 42, 0.8);
    border-color: rgba(229, 231, 235, 0.3);
    color: #e5e7eb;
}

.quick-post-form-template2 .qp-toolbar-btn:hover,
.quick-post-form-visual .qp-toolbar-btn:hover {
    background: rgba(15, 23, 42, 1);
    border-color: #bbf7d0;
}

.quick-post-form-template2 .content-block-item,
.quick-post-form-visual .content-block-item {
    background: rgba(15, 23, 42, 0.4);
    border-color: rgba(229, 231, 235, 0.2);
}

.quick-post-form-template2 .content-block-item .form-input,
.quick-post-form-visual .content-block-item .form-input {
    background: rgba(15, 23, 42, 0.6);
    color: #e5e7eb;
}

.quick-post-form-template2 .content-block-item .form-input:focus,
.quick-post-form-visual .content-block-item .form-input:focus {
    background: rgba(15, 23, 42, 0.8);
    border-color: #bbf7d0;
}

/* Template 2: Full-width section blocks (not cards) */
.quick-post-form-template2 .content-blocks-container,
.quick-post-form-visual .content-blocks-container {
    max-width: 100%;
    margin: 0;
    padding: 0;
}

.quick-post-form-template2 .content-block-item,
.quick-post-form-visual .content-block-item {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 60px 50px;
    margin: 0;
    max-width: 100%;
    width: 100%;
    border-bottom: 1px solid rgba(229, 231, 235, 0.1);
}

.quick-post-form-template2 .content-block-item:last-child,
.quick-post-form-visual .content-block-item:last-child {
    border-bottom: none;
}

/* Template 2: Heading blocks - large, centered, yellow-green */
.quick-post-form-template2 .content-block-item.block-type-heading,
.quick-post-form-visual .content-block-item.block-type-heading {
    text-align: center;
    padding: 80px 50px;
}

.quick-post-form-template2 .content-block-item.block-type-heading .block-label,
.quick-post-form-visual .content-block-item.block-type-heading .block-label {
    color: #D4F238;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 16px;
    font-weight: 700;
}

.quick-post-form-template2 .content-block-item.block-type-heading input,
.quick-post-form-visual .content-block-item.block-type-heading input {
    font-size: 42px;
    font-weight: 300;
    line-height: 1.3;
    color: #D4F238;
    text-align: center;
    background: transparent;
    border: none;
    border-bottom: 2px solid rgba(212, 242, 56, 0.3);
    padding: 10px 0;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.quick-post-form-template2 .content-block-item.block-type-heading input:focus,
.quick-post-form-visual .content-block-item.block-type-heading input:focus {
    border-bottom-color: #D4F238;
    outline: none;
}

.quick-post-form-template2 .content-block-item.block-type-heading input::placeholder,
.quick-post-form-visual .content-block-item.block-type-heading input::placeholder {
    color: rgba(212, 242, 56, 0.5);
}

/* Template 2: Text blocks - large, readable, max-width 800px (normal text, no box) */
.quick-post-form-template2 .content-block-item.block-type-text,
.quick-post-form-visual .content-block-item.block-type-text {
    max-width: 800px;
    margin: 0 auto;
    padding: 60px 50px;
}

.quick-post-form-template2 .content-block-item.block-type-text .block-label,
.quick-post-form-visual .content-block-item.block-type-text .block-label {
    color: #9ca3af;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 20px;
    font-weight: 600;
}

.quick-post-form-template2 .content-block-item.block-type-text textarea,
.quick-post-form-visual .content-block-item.block-type-text textarea {
    font-size: 21px;
    line-height: 1.9;
    color: #e5e7eb;
    background: transparent;
    border: none;
    padding: 0;
    width: 100%;
    min-height: 200px;
    font-family: 'Georgia', 'Times New Roman', serif;
}

.quick-post-form-template2 .content-block-item.block-type-text textarea:focus,
.quick-post-form-visual .content-block-item.block-type-text textarea:focus {
    outline: none;
    background: transparent;
}

.quick-post-form-template2 .content-block-item.block-type-text textarea::placeholder,
.quick-post-form-visual .content-block-item.block-type-text textarea::placeholder {
    color: rgba(229, 231, 235, 0.4);
}

/* Template 2: Quote Block - yellow box with attribution */
.quick-post-form-template2 .content-block-item.block-type-quote,
.quick-post-form-visual .content-block-item.block-type-quote {
    max-width: 800px;
    margin: 80px auto;
    padding: 60px 50px;
    border-left: 4px solid #D4F238;
    background: rgba(212, 242, 56, 0.05);
}

.quick-post-form-template2 .content-block-item.block-type-quote .block-label,
.quick-post-form-visual .content-block-item.block-type-quote .block-label {
    color: #9ca3af;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 20px;
    font-weight: 600;
}

.quick-post-form-template2 .content-block-item.block-type-quote .block-quote-text,
.quick-post-form-visual .content-block-item.block-type-quote .block-quote-text {
    margin-bottom: 20px;
}

.quick-post-form-template2 .content-block-item.block-type-quote .block-quote-text textarea,
.quick-post-form-visual .content-block-item.block-type-quote .block-quote-text textarea {
    font-size: 28px;
    line-height: 1.6;
    color: #ffffff;
    font-style: italic;
    background: transparent;
    border: none;
    padding: 0;
    width: 100%;
    min-height: 120px;
    font-family: 'Georgia', 'Times New Roman', serif;
}

.quick-post-form-template2 .content-block-item.block-type-quote .block-quote-text textarea:focus,
.quick-post-form-visual .content-block-item.block-type-quote .block-quote-text textarea:focus {
    outline: none;
    background: transparent;
}

.quick-post-form-template2 .content-block-item.block-type-quote .block-quote-text textarea::placeholder,
.quick-post-form-visual .content-block-item.block-type-quote .block-quote-text textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
}

.quick-post-form-template2 .content-block-item.block-type-quote .block-quote-author,
.quick-post-form-visual .content-block-item.block-type-quote .block-quote-author {
    margin-top: 20px;
}

.quick-post-form-template2 .content-block-item.block-type-quote .block-quote-author input,
.quick-post-form-visual .content-block-item.block-type-quote .block-quote-author input {
    font-size: 16px;
    color: #D4F238;
    font-weight: 600;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(212, 242, 56, 0.3);
    padding: 4px 0;
    width: 100%;
}

.quick-post-form-template2 .content-block-item.block-type-quote .block-quote-author input:focus,
.quick-post-form-visual .content-block-item.block-type-quote .block-quote-author input:focus {
    outline: none;
    border-bottom-color: #D4F238;
}

.quick-post-form-template2 .content-block-item.block-type-quote .block-quote-author input::placeholder,
.quick-post-form-visual .content-block-item.block-type-quote .block-quote-author input::placeholder {
    color: rgba(212, 242, 56, 0.5);
}

/* Template 2: Image blocks - full-width */
.quick-post-form-template2 .content-block-item.block-type-image,
.quick-post-form-visual .content-block-item.block-type-image {
    padding: 0;
    margin: 80px 0;
    max-width: 100%;
}

.quick-post-form-template2 .content-block-item.block-type-image .block-label,
.quick-post-form-visual .content-block-item.block-type-image .block-label {
    color: #9ca3af;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 20px;
    padding: 0 50px;
    font-weight: 600;
}

.quick-post-form-template2 .content-block-item.block-type-image .block-image-preview,
.quick-post-form-visual .content-block-item.block-type-image .block-image-preview {
    width: 100%;
    height: 600px;
    background: rgba(15, 23, 42, 0.5);
    border: 2px dashed rgba(229, 231, 235, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.quick-post-form-template2 .content-block-item.block-type-image .block-image-preview img,
.quick-post-form-visual .content-block-item.block-type-image .block-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.quick-post-form-template2 .content-block-item.block-type-image .block-image-caption,
.quick-post-form-visual .content-block-item.block-type-image .block-image-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    padding: 40px 50px;
    color: #ffffff;
}

.quick-post-form-template2 .content-block-item.block-type-image .block-image-caption input,
.quick-post-form-visual .content-block-item.block-type-image .block-image-caption input {
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 16px;
    line-height: 1.6;
    font-style: italic;
    width: 100%;
    padding: 0;
}

.quick-post-form-template2 .content-block-item.block-type-image .block-image-caption input::placeholder,
.quick-post-form-visual .content-block-item.block-type-image .block-image-caption input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

/* Template 2: Header and labels - improve contrast */
.quick-post-form-template2 .quick-post-header,
.quick-post-form-visual .quick-post-header {
    background: rgba(15, 23, 42, 0.4) !important;
    color: #e5e7eb !important;
    border-bottom: 1px solid rgba(229, 231, 235, 0.1);
    box-shadow: none;
}

.quick-post-form-template2 .quick-post-title,
.quick-post-form-visual .quick-post-title {
    color: #ffffff !important;
}

.quick-post-form-template2 .quick-post-subtitle,
.quick-post-form-visual .quick-post-subtitle {
    color: #9ca3af !important;
}

.quick-post-form-template2 .quick-post-back-btn,
.quick-post-form-visual .quick-post-back-btn {
    background: rgba(15, 23, 42, 0.6) !important;
    color: #d1d5db !important;
    border-color: rgba(229, 231, 235, 0.2) !important;
}

.quick-post-form-template2 .quick-post-back-btn:hover,
.quick-post-form-visual .quick-post-back-btn:hover {
    background: rgba(15, 23, 42, 0.8) !important;
    color: #D4F238 !important;
    border-color: #D4F238 !important;
}

.quick-post-form-template2 .form-label,
.quick-post-form-visual .form-label {
    color: #d1d5db !important;
    font-weight: 600;
}

.quick-post-form-template2 .form-label-hint,
.quick-post-form-visual .form-label-hint {
    color: #9ca3af !important;
}

.quick-post-form-template2 .qp-article-meta,
.quick-post-form-visual .qp-article-meta {
    color: #9ca3af !important;
}

.quick-post-form-template2 .qp-article-meta-item,
.quick-post-form-visual .qp-article-meta-item {
    color: #9ca3af !important;
}

.quick-post-form-template2 .form-header,
.quick-post-form-visual .form-header {
    background: transparent !important;
    border-bottom: 1px solid rgba(229, 231, 235, 0.1) !important;
}

.quick-post-form-template2 .form-title,
.quick-post-form-visual .form-title {
    color: #ffffff !important;
}

.quick-post-form-template2 .back-to-templates-btn,
.quick-post-form-visual .back-to-templates-btn {
    background: rgba(15, 23, 42, 0.6) !important;
    color: #9ca3af !important;
    border-color: rgba(229, 231, 235, 0.2) !important;
}

.quick-post-form-template2 .back-to-templates-btn:hover,
.quick-post-form-visual .back-to-templates-btn:hover {
    background: rgba(15, 23, 42, 0.8) !important;
    color: #D4F238 !important;
    border-color: #D4F238 !important;
}

/* Template 2: Form inputs - dark theme */
.quick-post-form-template2 .form-input,
.quick-post-form-visual .form-input {
    background: rgba(15, 23, 42, 0.5) !important;
    border-color: rgba(229, 231, 235, 0.2) !important;
    color: #e5e7eb !important;
}

.quick-post-form-template2 .form-input:focus,
.quick-post-form-visual .form-input:focus {
    background: rgba(15, 23, 42, 0.7) !important;
    border-color: #D4F238 !important;
    color: #ffffff !important;
}

.quick-post-form-template2 .form-input::placeholder,
.quick-post-form-visual .form-input::placeholder {
    color: rgba(229, 231, 235, 0.4) !important;
}

/* Template 2: Form sections - dark theme */
.quick-post-form-template2 .qp-article-header-section,
.quick-post-form-visual .qp-article-header-section {
    background: rgba(15, 23, 42, 0.3) !important;
    border-color: rgba(229, 231, 235, 0.1) !important;
}

.quick-post-form-template2 .qp-article-category-badge,
.quick-post-form-visual .qp-article-category-badge {
    background: rgba(212, 242, 56, 0.2) !important;
    color: #D4F238 !important;
    border-color: rgba(212, 242, 56, 0.3) !important;
}

/* Template 2: Buttons */
.quick-post-form-template2 button,
.quick-post-form-visual button {
    color: #e5e7eb;
}

.quick-post-form-template2 .block-remove-btn,
.quick-post-form-visual .block-remove-btn {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
}

.quick-post-form-template2 .block-remove-btn:hover,
.quick-post-form-visual .block-remove-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
}

.quick-post-form-template2 .block-image-upload,
.quick-post-form-visual .block-image-upload {
    background: rgba(212, 242, 56, 0.1);
    border-color: rgba(212, 242, 56, 0.3);
    color: #D4F238;
}

.quick-post-form-template2 .block-image-upload:hover,
.quick-post-form-visual .block-image-upload:hover {
    background: rgba(212, 242, 56, 0.2);
    border-color: #D4F238;
}

/* Template 2: Split Layout Blocks */
.quick-post-form-template2 .block-type-split,
.quick-post-form-visual .block-type-split {
    max-width: 100%;
    margin: 0;
    padding: 60px 50px;
}

.quick-post-form-template2 .block-split-container,
.quick-post-form-visual .block-split-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.quick-post-form-template2 .block-split-text textarea,
.quick-post-form-visual .block-split-text textarea {
    font-size: 18px;
    line-height: 1.8;
    color: #d1d5db;
    background: rgba(15, 23, 42, 0.3);
    border: none;
    border-left: 3px solid rgba(212, 242, 56, 0.3);
    padding: 20px 24px;
    width: 100%;
    min-height: 200px;
    font-family: 'Georgia', 'Times New Roman', serif;
}

.quick-post-form-template2 .block-split-text textarea:focus,
.quick-post-form-visual .block-split-text textarea:focus {
    border-left-color: #D4F238;
    outline: none;
    background: rgba(15, 23, 42, 0.5);
}

.quick-post-form-template2 .block-split-text textarea::placeholder,
.quick-post-form-visual .block-split-text textarea::placeholder {
    color: rgba(229, 231, 235, 0.4);
}

.quick-post-form-template2 .block-split-image .block-image-preview,
.quick-post-form-visual .block-split-image .block-image-preview {
    width: 100%;
    height: 400px;
    background: rgba(15, 23, 42, 0.5);
    border: 2px dashed rgba(229, 231, 235, 0.2);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.quick-post-form-template2 .block-split-image .block-image-preview img,
.quick-post-form-visual .block-split-image .block-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

@media (max-width: 768px) {
    .quick-post-form-template2 .block-split-container,
    .quick-post-form-visual .block-split-container {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}

/* Block Toolbar - under Body Content heading */
.quick-post-block-toolbar {
    margin: 16px 0 8px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #f1f5f9;
    border: 1px solid rgba(148, 163, 184, 0.4);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    position: sticky;
    top: 12px;
    z-index: 10;
}

.quick-post-block-toolbar .qp-toolbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.6);
    background: #ffffff;
    color: #1e293b;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.quick-post-block-toolbar .qp-toolbar-btn:hover {
    background: #1e3a8a;
    border-color: #1e3a8a;
    color: #f9fafb;
}

.quick-post-block-toolbar .qp-toolbar-icon {
    width: 18px;
    text-align: center;
    font-size: 14px;
}

.quick-post-block-toolbar .qp-toolbar-label {
    flex: 0 1 auto;
    white-space: nowrap;
}

@media (max-width: 640px) {
    .quick-post-block-toolbar {
        margin-top: 4px;
        padding: 8px 10px;
        position: static; /* Disable sticky on small screens for simplicity */
        display: none; /* mobile dùng FAB thay vì toolbar inline */
    }

    .quick-post-block-toolbar .qp-toolbar-btn {
        flex: 1 1 100%;
        justify-content: center;
    }
}

/* Floating FAB for Add Block (mobile only) */
.quick-post-fab {
    position: fixed;
    right: 24px;
    bottom: 96px; /* keep above chat widgets / other FABs */
    z-index: 10020;
    display: none; /* hidden by default, shown via media query */
}

.quick-post-fab-main {
    width: 48px;
    height: 48px;
    border-radius: 999px;
    border: none;
    background: #111827;
    color: #f9fafb;
    font-size: 24px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.6);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.quick-post-fab-main:hover {
    background: #1f2937;
    transform: translateY(-2px);
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.7);
}

.quick-post-fab-menu {
    margin-bottom: 8px;
    display: none;
    flex-direction: column;
    gap: 6px;
}

.quick-post-fab.open .quick-post-fab-menu {
    display: flex;
}

.quick-post-fab-item {
    min-width: 160px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.7);
    background: rgba(15, 23, 42, 0.96);
    color: #e5e7eb;
    font-size: 12px;
    text-align: left;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.5);
}

.quick-post-fab-item:hover {
    background: #1e3a8a;
    border-color: rgba(191, 219, 254, 0.85);
    color: #f9fafb;
}

@media (max-width: 768px) {
    .quick-post-fab {
        right: 16px;
        bottom: 96px; /* still above chat button on mobile */
        display: block; /* show FAB on mobile */
    }

    .quick-post-fab-main {
        width: 44px;
        height: 44px;
        font-size: 22px;
    }

    .quick-post-fab-item {
        min-width: 150px;
        font-size: 11px;
    }
}

/* Responsive adjustments for Template 1 Quick Post */
@media (max-width: 1024px) {
    .quick-post-form-template1 .qp-article-body {
        grid-template-columns: 1fr;
        padding: 28px 24px 30px;
    }

    .quick-post-form-template1 .qp-article-sidebar {
        border-left: none;
        padding-left: 0;
        border-top: 1px solid #e5e7eb;
        padding-top: 22px;
        margin-top: 4px;
    }
}

@media (max-width: 768px) {
    .onyx-quick-post-container {
        padding: 24px 16px;
    }

    .quick-post-header {
        padding: 24px;
        flex-direction: column;
        align-items: flex-start;
    }

    .quick-post-title {
        font-size: 28px;
    }

    .templates-grid {
        grid-template-columns: 1fr;
    }

    .quick-post-form-section {
        padding: 24px;
    }

    .form-actions {
        flex-direction: column;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
    }

    .quick-post-form-template1 .qp-article-header {
        padding: 28px 20px 20px;
    }

    .quick-post-form-template1 .qp-hero-group-inner {
        padding: 0 20px;
    }

    .quick-post-form-template1 .qp-article-summary-section {
        padding: 20px;
    }

    .quick-post-form-template1 .qp-article-body {
        padding: 22px 20px 26px;
    }

    .quick-post-block-toolbar {
        right: 16px;
        bottom: 16px;
        left: 16px;
        flex-direction: row;
        overflow-x: auto;
        justify-content: center;
    }

    .quick-post-block-toolbar .qp-toolbar-btn {
        min-width: 150px;
        white-space: nowrap;
    }
}


/* --- Article list thumbnail refinements (prevent layout break + nicer crop) --- */
.onyx-editor-portal--app .post-item {
    align-items: stretch;
}

.onyx-editor-portal--app .post-item-thumbnail {
    width: 220px;
    min-width: 220px;
    height: auto;
    align-self: stretch;
    display: flex;
    overflow: hidden;
    background: #f1f5f9;
    flex-shrink: 0;
    border-right: 1px solid rgba(15, 23, 42, 0.06);
}

.onyx-editor-portal--app .post-item-thumbnail img {
    width: 100%;
    height: 100%;
    flex: 1;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
    filter: saturate(1.05) contrast(1.02);
    will-change: transform;
}

.onyx-editor-portal--app .post-item:hover .post-item-thumbnail img {
    transform: scale(1.03);
}

.onyx-editor-portal--app .post-item-thumbnail-placeholder {
    width: 100%;
    height: 100%;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(15, 23, 42, 0.35);
    background: linear-gradient(135deg, #f8fafc, #eef2f7);
}

@media (max-width: 768px) {
    .onyx-editor-portal--app .post-item-thumbnail {
        width: 100%;
        min-width: 100%;
        height: 220px;
        align-self: auto;
        display: block;
        border-right: 0;
        border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    }
}