/* Admin Page Editor - WordPress-style Layout */

.page-editor-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}

/* Two-column layout */
.page-editor-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 3rem;
  align-items: start;
}

/* Main content area */
.page-content-area {
  background: white;
  border-radius: 0.8rem;
  box-shadow: 0 0.1rem 0.3rem rgba(0, 0, 0, 0.1);
}

/* Page title input */
.title-field-wrapper {
  position: relative;
}

.page-title-input {
  width: 100%;
  border: none;
  font-size: 3.2rem;
  font-weight: 600;
  padding: 3rem 3rem 2rem 6rem;
  font-family: system-ui, -apple-system, sans-serif;
  outline: none;
}

.page-title-input::placeholder {
  color: #9ca3af;
}

.title-edit-icon {
  position: absolute;
  left: 3rem;
  top: 3.5rem;
  color: #9ca3af;
  pointer-events: none;
}

.page-title-input:focus + .title-edit-icon {
  color: #3b82f6;
}

/* Blocks Editor */
.blocks-editor {
  padding: 0 3rem 3rem 3rem;
  position: relative;
}

/* Blocks Toolbar */
.blocks-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1.6rem;
  border-bottom: 0.1rem solid #e5e7eb;
}

.blocks-toolbar-left {
  flex: 1;
}

.blocks-toolbar-right {
  display: flex;
  gap: 0.8rem;
  align-items: center;
}

/* Mode Toggle */
.mode-toggle {
  display: inline-flex;
  background: #f3f4f6;
  border-radius: 0.6rem;
  padding: 0.3rem;
  gap: 0.2rem;
}

.mode-toggle-btn {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1.2rem;
  background: transparent;
  border: none;
  border-radius: 0.4rem;
  font-size: 1.4rem;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.15s;
}

.mode-toggle-btn svg,
.mode-toggle-btn img {
  color: #6b7280;
  transition: all 0.15s;
}

.mode-toggle-btn img {
  filter: invert(47%) sepia(8%) saturate(542%) hue-rotate(182deg) brightness(94%) contrast(86%);
}

.mode-toggle-btn:hover {
  color: #374151;
}

.mode-toggle-btn:hover svg,
.mode-toggle-btn:hover img {
  color: #374151;
}

.mode-toggle-btn:hover img {
  filter: invert(24%) sepia(7%) saturate(854%) hue-rotate(182deg) brightness(95%) contrast(90%);
}

.mode-toggle-btn.active {
  background: white;
  color: #3b82f6;
  box-shadow: 0 0.1rem 0.2rem rgba(0, 0, 0, 0.1);
}

.mode-toggle-btn.active svg,
.mode-toggle-btn.active img {
  color: #3b82f6;
}

.mode-toggle-btn.active img {
  filter: invert(42%) sepia(98%) saturate(1816%) hue-rotate(203deg) brightness(101%) contrast(92%);
}

/* Toolbar Icon Buttons - Match Trix Toolbar Style */
/* TODO: Add visual distinction for disabled/enabled state (currently same opacity for both) */
.btn-toolbar-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.6rem;
  height: 3.6rem;
  background: transparent;
  border: 0.1rem solid #bbb;
  border-top-color: #ccc;
  border-bottom-color: #888;
  border-radius: 0.3rem;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}

.btn-toolbar-icon svg {
  opacity: 0.6;
}

.btn-toolbar-icon:not(:disabled) {
  background: transparent;
  color: rgba(0, 0, 0, 0.6);
}

.btn-toolbar-icon:not(:disabled) svg {
  opacity: 0.6;
}

.btn-toolbar-icon:hover:not(:disabled) {
  background: #cbeefa;
}

.btn-toolbar-icon:hover:not(:disabled) svg {
  opacity: 1;
}

.btn-toolbar-icon:disabled {
  cursor: not-allowed;
  background: transparent;
  color: rgba(0, 0, 0, 0.6);
}

.btn-toolbar-icon:disabled svg {
  opacity: 0.6;
}

/* Add Block Button and Menu */
.blocks-add-menu {
  position: relative;
}

.btn-add-block {
  background: #3b82f6 !important;
  border-color: #3b82f6 !important;
  color: white !important;
}

.btn-add-block svg,
.btn-add-block img {
  color: white !important;
  filter: brightness(0) invert(1);
}

.btn-add-block:hover:not(:disabled) {
  background: #2563eb !important;
  border-color: #2563eb !important;
  color: white !important;
  box-shadow: 0 0.1rem 0.3rem rgba(59, 130, 246, 0.3);
}

.btn-add-block:hover:not(:disabled) svg,
.btn-add-block:hover:not(:disabled) img {
  color: white !important;
  filter: brightness(0) invert(1);
}

.btn-add-block.active {
  background: #1d4ed8 !important;
  border-color: #1d4ed8 !important;
  color: white !important;
}

.btn-add-block.active svg,
.btn-add-block.active img {
  color: white !important;
  filter: brightness(0) invert(1);
}

/* Block Menu Dropdown */
.block-menu-dropdown {
  position: absolute;
  top: calc(100% + 0.8rem);
  right: 0;
  background: white;
  border: 0.1rem solid #e5e7eb;
  border-radius: 0.8rem;
  box-shadow: 0 0.4rem 1.2rem rgba(0, 0, 0, 0.15);
  min-width: 200px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-0.8rem);
  transition: all 0.2s;
  z-index: 100;
}

.block-menu-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.block-menu-item {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 1.2rem 1.6rem;
  color: #374151;
  text-decoration: none;
  font-size: 1.5rem;
  font-weight: 500;
  transition: background 0.15s;
  border-bottom: 0.1rem solid #f3f4f6;
}

.block-menu-item:last-child {
  border-bottom: none;
}

.block-menu-item:hover {
  background: #f9fafb;
}

.block-menu-item svg {
  flex-shrink: 0;
  color: #6b7280;
}

.block-menu-item:hover svg {
  color: #3b82f6;
}

/* Empty State */
.blocks-empty-state {
  text-align: center;
  padding: 6rem 2rem;
  color: #9ca3af;
}

.blocks-empty-state svg {
  margin-bottom: 2rem;
  color: #d1d5db;
}

.blocks-empty-state p {
  font-size: 1.8rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
  color: #6b7280;
}

.blocks-empty-state small {
  font-size: 1.4rem;
  color: #9ca3af;
}

/* Blocks List */
.blocks-list {
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
}

/* Block Item */
.block-item {
  border: 0.2rem solid #e5e7eb;
  border-radius: 0.8rem;
  background: #f9fafb;
  transition: all 0.2s;
  position: relative;
}

.block-item:hover {
  border-color: #3b82f6;
  box-shadow: 0 0.2rem 0.8rem rgba(59, 130, 246, 0.1);
}

/* Draft Block */
.block-item-draft {
  border-color: #f59e0b;
  border-style: dashed;
  background: #fffbeb;
}

.block-item-draft:hover {
  border-color: #d97706;
  box-shadow: 0 0.2rem 0.8rem rgba(245, 158, 11, 0.2);
}

.draft-badge {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  margin-left: 0.8rem;
  background: #f59e0b;
  color: white;
  font-size: 1.1rem;
  font-weight: 700;
  border-radius: 0.3rem;
  letter-spacing: 0.05em;
}

/* Block Header */
.block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 1.6rem;
  background: white;
  border-bottom: 0.1rem solid #e5e7eb;
  border-radius: 0.6rem 0.6rem 0 0;
}

.block-type-indicator {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 1.4rem;
  font-weight: 600;
  color: #374151;
}

.block-type-indicator svg {
  color: #3b82f6;
}

.block-type-indicator img {
  filter: invert(42%) sepia(98%) saturate(1816%) hue-rotate(203deg) brightness(101%) contrast(92%);
}

.block-header .edit-icon {
  color: #9ca3af;
  transition: color 0.15s;
}

.block-header:hover .edit-icon {
  color: #3b82f6;
}

/* Block Content */
.block-content {
  padding: 1.6rem;
  cursor: text;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: background 0.15s, box-shadow 0.15s;
  position: relative;
}

.block-content:hover {
  background: #fafafa;
}

.block-content:hover::after {
  content: 'Click to edit';
  position: absolute;
  top: 0.8rem;
  right: 1.6rem;
  font-size: 1.2rem;
  color: #9ca3af;
  font-style: italic;
  pointer-events: none;
}

.text-block-preview {
  font-size: 1.4rem;
  color: #6b7280;
  line-height: 1.6;
}

.rich-text-preview {
  /* Show full content without truncation */
}

/* Trix content in preview should inherit normal text styles */
.rich-text-preview .trix-content {
  font-size: 1.4rem;
  color: #374151;
  line-height: 1.6;
}

.rich-text-preview .trix-content h1,
.rich-text-preview .trix-content h2,
.rich-text-preview .trix-content h3 {
  font-size: 1.6rem;
  font-weight: 600;
  margin: 0.5rem 0;
  color: #111827;
}

.rich-text-preview .trix-content p {
  margin: 0.5rem 0;
}

.rich-text-preview .trix-content ul,
.rich-text-preview .trix-content ol {
  margin: 0.5rem 0;
  padding-left: 2rem;
}

.rich-text-preview .trix-content strong {
  font-weight: 600;
}

.rich-text-preview .trix-content em {
  font-style: italic;
}

.image-block-preview {
  display: flex;
  gap: 1.6rem;
  align-items: start;
}

.image-block-preview img {
  max-width: 200px;
  height: auto;
  border-radius: 0.6rem;
  box-shadow: 0 0.1rem 0.3rem rgba(0, 0, 0, 0.1);
}

.image-block-meta {
  flex: 1;
}

.image-block-meta .caption {
  font-size: 1.4rem;
  color: #374151;
  margin: 0 0 0.8rem 0;
}

.image-block-meta .alignment {
  font-size: 1.3rem;
  color: #9ca3af;
  margin: 0;
}

/* Block Actions */
.block-actions {
  display: flex;
  gap: 0.6rem;
  padding: 1rem 1.6rem;
  border-top: 0.1rem solid #e5e7eb;
  opacity: 0;
  transition: opacity 0.2s;
  background: #fafafa;
  justify-content: flex-end;
}

.block-item:hover .block-actions {
  opacity: 1;
}

.btn-icon-small {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.8rem;
  height: 2.8rem;
  background: white;
  border: 0.1rem solid #d1d5db;
  border-radius: 0.4rem;
  color: #6b7280;
  text-decoration: none;
  transition: all 0.15s;
  cursor: pointer;
}

.btn-icon-small:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
  color: #374151;
}

.btn-icon-small.btn-danger {
  color: #dc2626;
}

.btn-icon-small.btn-danger:hover {
  background: #fee2e2;
  border-color: #dc2626;
}

/* Right Sidebar */
.page-sidebar {
  position: sticky;
  top: 2rem;
}

.sidebar-section {
  background: white;
  border: 0.1rem solid #e5e7eb;
  border-radius: 0.8rem;
  margin-bottom: 1.6rem;
  overflow: hidden;
}

.sidebar-section-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.6rem;
  background: white;
  border: none;
  border-bottom: 0.1rem solid #e5e7eb;
  cursor: pointer;
  transition: background 0.15s;
}

.sidebar-section-header:hover {
  background: #f9fafb;
}

.sidebar-section-header.collapsed {
  border-bottom: none;
}

.sidebar-section-header.collapsed .chevron {
  transform: rotate(-90deg);
}

.sidebar-section-header h3 {
  font-size: 1.6rem;
  font-weight: 600;
  margin: 0;
  color: #111827;
}

.sidebar-section-header .chevron {
  transition: transform 0.2s;
  color: #9ca3af;
}

.sidebar-section-content {
  padding: 1.6rem;
}

/* Form elements in sidebar */
.sidebar-section .form-group {
  margin-bottom: 1.6rem;
}

.sidebar-section .form-group:last-child {
  margin-bottom: 0;
}

.sidebar-section label {
  display: block;
  font-size: 1.3rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.6rem;
}

.sidebar-section .checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 1.4rem;
  font-weight: 500;
  cursor: pointer;
}

.sidebar-section .form-control {
  width: 100%;
  padding: 0.8rem 1.2rem;
  font-size: 1.4rem;
  border: 0.1rem solid #d1d5db;
  border-radius: 0.4rem;
  transition: border-color 0.15s;
  box-sizing: border-box;
}

.sidebar-section .form-control:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 0.3rem rgba(59, 130, 246, 0.1);
}

.sidebar-section .form-text {
  display: block;
  font-size: 1.2rem;
  color: #6b7280;
  margin-top: 0.4rem;
}

/* Publish status */
.publish-status {
  margin-bottom: 1.6rem;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 1rem 1.2rem;
  background: #f9fafb;
  border-radius: 0.6rem;
  font-size: 1.4rem;
}

.status-label {
  font-weight: 600;
  color: #6b7280;
}

.status-value {
  font-weight: 600;
  padding: 0.3rem 1rem;
  border-radius: 0.4rem;
}

.status-value.draft {
  background: #fef3c7;
  color: #92400e;
}

.status-value.published {
  background: #d1fae5;
  color: #065f46;
}

/* Sidebar action buttons */
.form-actions-sidebar {
  margin-top: 1.6rem;
  padding-top: 1.6rem;
  border-top: 0.1rem solid #e5e7eb;
}

.btn-block {
  width: 100%;
  justify-content: center;
}

.btn-with-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
}

.btn-with-icon svg {
  flex-shrink: 0;
}

/* Unsaved changes styling for Update Page button */
.btn.has-unsaved-changes {
  background: #f59e0b !important;
  border-color: #f59e0b !important;
  color: white !important;
}

.btn.has-unsaved-changes:hover {
  background: #d97706 !important;
  border-color: #d97706 !important;
}

.hidden {
  display: none !important;
}

/* Preview Mode */
.preview-container {
  background: white;
  padding: 3rem;
  border-radius: 0.8rem;
  min-height: 40rem;
}

/* Homepage Warning */
.homepage-warning {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin-top: 1.2rem;
  margin-bottom: 1.6rem;
  padding: 1.2rem;
  background: #fef3c7;
  border: 0.1rem solid #f59e0b;
  border-radius: 0.6rem;
  font-size: 1.3rem;
  color: #92400e;
}

.homepage-warning svg {
  flex-shrink: 0;
  color: #f59e0b;
  margin-top: 0.2rem;
}

.homepage-warning span {
  flex: 1;
}

.homepage-warning strong {
  font-weight: 600;
}

/* Inline Block Editing */
.block-form-inline {
  padding: 1.6rem;
  background: white;
}

.form-actions-inline {
  display: flex;
  gap: 1rem;
  margin-top: 1.6rem;
  padding-top: 1.6rem;
  border-top: 0.1rem solid #e5e7eb;
  justify-content: flex-end;
}

/* Simplified inline actions */
.form-actions-inline-simple {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1.2rem;
  padding-top: 0;
  border-top: none;
}

.form-actions-inline-simple .btn-sm {
  padding: 0.6rem 1.2rem;
  font-size: 1.4rem;
}

.form-actions-inline-simple .or-text {
  font-size: 1.3rem;
  color: #9ca3af;
  font-style: italic;
}

.form-actions-inline-simple .link-cancel {
  font-size: 1.3rem;
  color: #6b7280;
  text-decoration: none;
  transition: color 0.15s;
}

.form-actions-inline-simple .link-cancel:hover {
  color: #374151;
  text-decoration: underline;
}

/* Inline Block Form */
.block-form-container {
  margin-bottom: 2.4rem;
  padding: 2.4rem;
  background: #f9fafb;
  border: 0.2rem solid #e5e7eb;
  border-radius: 0.8rem;
}

.block-form-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.block-form-header h3 {
  font-size: 1.8rem;
  font-weight: 600;
  margin: 0;
  color: #111827;
}

.block-form-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.2rem;
  height: 3.2rem;
  background: white;
  border: 0.1rem solid #d1d5db;
  border-radius: 0.6rem;
  color: #6b7280;
  text-decoration: none;
  transition: all 0.15s;
}

.block-form-close:hover {
  background: #fee2e2;
  border-color: #dc2626;
  color: #dc2626;
}

/* Pages Index Styles */
.pages-index-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem;
}

.pages-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 3rem;
}

.pages-header h1 {
  font-size: 3.2rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
  color: #111827;
}

.pages-subtitle {
  font-size: 1.5rem;
  color: #6b7280;
  margin: 0;
}

.pages-header .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  padding: 1rem 1.6rem;
  font-size: 1.5rem;
  font-weight: 600;
}

.pages-header .btn svg,
.pages-header .btn img {
  flex-shrink: 0;
  align-self: center;
}

.pages-header .btn img {
  filter: brightness(0) invert(1);
}

.pages-list {
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
}

.page-card {
  background: white;
  border: 0.1rem solid #e5e7eb;
  border-radius: 0.8rem;
  padding: 1.6rem 2rem;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.page-card:hover {
  border-color: #d1d5db;
  box-shadow: 0 0.2rem 0.8rem rgba(0, 0, 0, 0.05);
}

.page-info {
  flex: 1;
  min-width: 0;
}

.page-title-row {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  margin-bottom: 0.6rem;
}

.page-title {
  font-size: 1.6rem;
  font-weight: 600;
  color: #111827;
  text-decoration: none;
  transition: color 0.15s;
}

.page-title:hover {
  color: #3b82f6;
}

.page-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  font-size: 1.3rem;
  color: #6b7280;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.meta-item svg {
  flex-shrink: 0;
  color: #9ca3af;
}

.meta-category {
  padding: 0.3rem 0.8rem;
  background: #f3f4f6;
  border-radius: 0.4rem;
  font-weight: 500;
}

.status-badge {
  display: inline-block;
  padding: 0.4rem 1rem;
  border-radius: 0.5rem;
  font-size: 1.2rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.status-draft {
  background: #fef3c7;
  color: #92400e;
}

.status-published {
  background: #d1fae5;
  color: #065f46;
}

.status-scheduled {
  background: #e0e7ff;
  color: #3730a3;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-shrink: 0;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.2rem;
  height: 3.2rem;
  background: white;
  border: 0.1rem solid #d1d5db;
  border-radius: 0.6rem;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}

.btn-icon:hover {
  background: #f9fafb;
  border-color: #9ca3af;
  color: #374151;
}

.btn-icon.btn-danger {
  color: #dc2626;
}

.btn-icon.btn-danger:hover {
  background: #fee2e2;
  border-color: #dc2626;
}

.btn-icon.btn-active {
  background: #dbeafe;
  border-color: #3b82f6;
  color: #1e40af;
}

.btn-icon.btn-active:hover {
  background: #bfdbfe;
}

/* Empty State */
.pages-empty-state {
  text-align: center;
  padding: 8rem 2rem;
  background: white;
  border-radius: 0.8rem;
  border: 0.2rem dashed #e5e7eb;
}

.pages-empty-state svg,
.pages-empty-state img {
  margin-bottom: 2rem;
  color: #d1d5db;
}

.pages-empty-state img {
  filter: invert(88%) sepia(6%) saturate(269%) hue-rotate(182deg) brightness(93%) contrast(88%);
}

.pages-empty-state h2 {
  font-size: 2.4rem;
  font-weight: 600;
  margin: 0 0 1rem 0;
  color: #374151;
}

.pages-empty-state p {
  font-size: 1.6rem;
  color: #6b7280;
  margin: 0 0 2.4rem 0;
}

.pages-empty-state .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
}

.pages-empty-state .btn svg,
.pages-empty-state .btn img {
  flex-shrink: 0;
  align-self: center;
  margin: 0;
  padding: 0;
}

.pages-empty-state .btn img {
  filter: brightness(0) invert(1);
}

/* Trix Editor Styling */
trix-editor {
  width: 100%;
  margin-bottom: 1.6rem;
  box-sizing: border-box;
}

/* Responsive */
@media (max-width: 1024px) {
  .page-editor-layout {
    grid-template-columns: 1fr;
  }

  .page-sidebar {
    position: static;
    order: -1;
  }

  .blocks-editor {
    padding: 0 2rem 2rem 2rem;
  }

  .page-title-input {
    padding: 2rem 2rem 2rem 5rem;
    font-size: 2.4rem;
  }

  .title-edit-icon {
    left: 2rem;
    top: 2.5rem;
  }
}

@media (max-width: 768px) {
  .page-editor-container {
    padding: 1rem;
  }

  .page-editor-layout {
    gap: 1.6rem;
  }

  .image-block-preview {
    flex-direction: column;
  }

  .image-block-preview img {
    max-width: 100%;
  }

  .block-actions {
    position: static;
    opacity: 1;
    justify-content: flex-end;
    padding: 0 1rem 1rem 1rem;
  }

  /* Index responsive */
  .pages-index-container {
    padding: 2rem 1.5rem;
  }

  .pages-header {
    flex-direction: column;
    gap: 1.6rem;
    align-items: stretch;
  }

  .pages-header .btn {
    width: 100%;
    justify-content: center;
  }

  .page-card {
    padding: 1.5rem;
  }

  .page-card-main {
    flex-direction: column;
    gap: 1.2rem;
  }

  .page-title-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.8rem;
  }

  .page-meta {
    gap: 1rem;
  }

  .page-actions {
    flex-wrap: wrap;
  }
}

/* Editing Status Indicator */
.editing-status-indicator {
  padding: 1.2rem 1.6rem;
  margin-bottom: 1.6rem;
  border-radius: 0.6rem;
  font-size: 1.3rem;
  font-weight: 600;
  text-align: center;
  transition: all 0.2s;
}

.editing-status-indicator.status-unsaved {
  background: #fef3c7;
  color: #92400e;
  border: 0.1rem solid #f59e0b;
}

.editing-status-indicator.status-saving {
  background: #e0e7ff;
  color: #3730a3;
  border: 0.1rem solid #6366f1;
}

.editing-status-indicator.status-saved {
  background: #d1fae5;
  color: #065f46;
  border: 0.1rem solid #10b981;
}

.editing-status-indicator.status-error {
  background: #fee2e2;
  color: #991b1b;
  border: 0.1rem solid #dc2626;
}

/* Button Warning State (for unsaved changes in inline editing) */
.btn-warning {
  background: #f59e0b;
  border-color: #f59e0b;
  color: white;
}

.btn-warning:hover {
  background: #d97706;
  border-color: #d97706;
}

/* Code Block Preview */
.code-block-preview {
  position: relative;
}

.code-block-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1.2rem;
  background: #e5e7eb;
  border-radius: 0.6rem 0.6rem 0 0;
  margin-bottom: -0.4rem;
}

.code-language-badge {
  font-size: 1.2rem;
  font-weight: 600;
  text-transform: uppercase;
  color: #6b7280;
  letter-spacing: 0.05em;
}

.code-copy-button {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  padding: 0.4rem;
  cursor: pointer;
  border-radius: 0.3rem;
  transition: all 0.15s;
  color: #6b7280;
}

.code-copy-button img {
  display: block;
  opacity: 0.6;
  transition: opacity 0.15s;
}

.code-copy-button:hover {
  background: #d1d5db;
}

.code-copy-button:hover img {
  opacity: 1;
}

.code-copy-button.copied {
  color: #10b981;
}

.code-copy-button.copied img {
  opacity: 1;
  filter: invert(51%) sepia(79%) saturate(435%) hue-rotate(99deg) brightness(94%) contrast(87%);
}

.code-block-preview-content {
  position: relative;
  background: #f3f4f6;
  border-radius: 0 0 0.6rem 0.6rem;
  padding: 0;
  margin: 0;
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 1.3rem;
  line-height: 1.6;
  overflow-x: auto;
}

.code-block-preview-content code {
  display: inline-block;
  white-space: pre;
  color: #374151;
  padding: 1.2rem;
  padding-right: 2rem;
  min-width: 100%;
  box-sizing: border-box;
}


/* Code Block Form Textarea */
textarea[name="block[content]"][style*="monospace"],
textarea.code-textarea {
  font-family: 'Monaco', 'Courier New', monospace !important;
  white-space: pre;
  overflow-wrap: normal;
  overflow-x: auto;
  tab-size: 2;
  -moz-tab-size: 2;
}

/* Post Picker */
.post-picker-controls {
  display: flex;
  gap: 0.8rem;
  align-items: center;
}

.post-picker-controls .form-control {
  flex: 1;
}

.post-picker-controls .btn {
  flex-shrink: 0;
}

.post-picker-count {
  font-size: 1.3rem;
  font-weight: 600;
  color: #6b7280;
  margin: 0 0 0.4rem 0;
}

.post-picker-empty {
  font-size: 1.3rem;
  color: #9ca3af;
  font-style: italic;
  margin: 0 0 0.8rem 0;
}

.selected-posts-list {
  border: 0.1rem solid #e5e7eb;
  border-radius: 0.6rem;
  min-height: 2rem;
  background: #f9fafb;
}

.selected-post-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.8rem 1.2rem;
  background: white;
  border-bottom: 0.1rem solid #e5e7eb;
  transition: opacity 0.15s, background 0.15s;
}

.selected-post-item:first-child {
  border-radius: 0.6rem 0.6rem 0 0;
}

.selected-post-item:last-child {
  border-bottom: none;
  border-radius: 0 0 0.6rem 0.6rem;
}

.selected-post-item:only-child {
  border-radius: 0.6rem;
}

.selected-post-item.dragging {
  opacity: 0.4;
  background: #dbeafe;
}

.drag-handle {
  cursor: grab;
  color: #9ca3af;
  font-size: 1.6rem;
  line-height: 1;
  user-select: none;
  flex-shrink: 0;
}

.drag-handle:active {
  cursor: grabbing;
}

.selected-post-title {
  flex: 1;
  font-size: 1.4rem;
  color: #374151;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-category-tag {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  background: #e5e7eb;
  border-radius: 0.3rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: #6b7280;
  flex-shrink: 0;
}

.btn-remove-post {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  background: transparent;
  border: 0.1rem solid transparent;
  border-radius: 0.4rem;
  color: #9ca3af;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s;
}

.btn-remove-post:hover {
  background: #fee2e2;
  border-color: #dc2626;
  color: #dc2626;
}

.post-picker-save {
  margin-top: 0.8rem;
}
