/* ========================================================
   Enhanced Post Editor v2.0 Styles
   ======================================================== */

/* ═══ COLOR-CODED SECTION BOXES ═══ */
.editor-section-box {
  position: relative;
  margin-bottom: 16px;
  padding: 16px 20px;
  border-radius: 12px;
  border: 1px solid var(--border, #30363d);
  background: var(--bg-secondary, #0d1117);
  transition: border-color 0.3s, box-shadow 0.3s;
}

.editor-section-box:hover {
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.2);
}

.section-box-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border, #30363d);
}

.section-box-icon {
  font-size: 16px;
  line-height: 1;
}

/* Section: Info (title/category) — Blue accent */
.editor-section-box.section-info {
  border-left: 3px solid #58a6ff;
  background: linear-gradient(135deg, rgba(88, 166, 255, 0.04), transparent);
}
.section-info .section-box-header {
  color: #58a6ff;
  border-bottom-color: rgba(88, 166, 255, 0.2);
}

/* Section: Content (toolbar + editor) — Purple accent */
.editor-section-box.section-content {
  border-left: 3px solid #a78bfa;
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.04), transparent);
  padding: 0;
}
.section-content .section-box-header {
  color: #a78bfa;
  border-bottom-color: rgba(167, 139, 250, 0.2);
  padding: 16px 20px 10px;
  margin-bottom: 0;
}

/* Section: Media (featured image) — Amber accent */
.editor-section-box.section-media {
  border-left: 3px solid #f59e0b;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.04), transparent);
}
.section-media .section-box-header {
  color: #f59e0b;
  border-bottom-color: rgba(245, 158, 11, 0.2);
}

/* Section: SEO Meta — Green accent */
.editor-section-box.section-seo {
  border-left: 3px solid #34d399;
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.04), transparent);
}
.section-seo .section-box-header {
  color: #34d399;
  border-bottom-color: rgba(52, 211, 153, 0.2);
}

/* Section: Keywords — Cyan accent */
.editor-section-box.section-keywords {
  border-left: 3px solid #22d3ee;
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.04), transparent);
}
.section-keywords .section-box-header {
  color: #22d3ee;
  border-bottom-color: rgba(34, 211, 238, 0.2);
}

/* Section: Schema — Rose accent */
.editor-section-box.section-schema {
  border-left: 3px solid #fb7185;
  background: linear-gradient(135deg, rgba(251, 113, 133, 0.04), transparent);
}
.section-schema .section-box-header {
  color: #fb7185;
  border-bottom-color: rgba(251, 113, 133, 0.2);
}

/* Section: Regenerate — Orange accent */
.editor-section-box.section-regen {
  border-left: 3px solid #fb923c;
  background: linear-gradient(135deg, rgba(251, 146, 60, 0.04), transparent);
  margin-top: 20px;
}
.section-regen .section-box-header {
  color: #fb923c;
  border-bottom-color: rgba(251, 146, 60, 0.2);
}

/* Section: Prompt — Gray accent */
.editor-section-box.section-prompt {
  border-left: 3px solid #8b949e;
  background: linear-gradient(135deg, rgba(139, 148, 158, 0.04), transparent);
}
.section-prompt .section-box-header {
  color: #8b949e;
  border-bottom-color: rgba(139, 148, 158, 0.2);
}

/* ═══ SEO FIELD LABELS ═══ */
.seo-field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #34d399;
  margin-bottom: 6px;
  margin-top: 12px;
}

.seo-field-label .seo-limit {
  font-weight: 400;
  font-size: 11px;
  color: #8b949e;
}

/* ═══ EDITOR TOOLBAR ═══ */
.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 8px;
  background: var(--bg-tertiary, #161b22);
  border: 1px solid var(--border, #30363d);
  border-radius: 10px 10px 0 0;
  border-bottom: none;
  position: sticky;
  top: 0;
  z-index: 10;
}

.editor-toolbar .tb-group {
  display: flex;
  gap: 2px;
  align-items: center;
}

.editor-toolbar .tb-sep {
  width: 1px;
  height: 24px;
  background: var(--border, #30363d);
  margin: 0 6px;
}

.editor-toolbar button {
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary, #8b949e);
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  transition: all 0.15s;
  white-space: nowrap;
}

.editor-toolbar button:hover {
  background: var(--bg-secondary, #0d1117);
  color: var(--text-primary, #e6edf3);
  border-color: var(--border, #30363d);
}

.editor-toolbar button.active,
.editor-toolbar button:active {
  background: var(--accent, #58a6ff);
  color: white;
  border-color: var(--accent, #58a6ff);
}

.editor-toolbar .tb-insert-group {
  margin-left: auto;
  display: flex;
  gap: 4px;
}

.editor-toolbar .tb-insert-btn {
  padding: 6px 12px;
  background: linear-gradient(135deg, #238636, #2ea043);
  color: white;
  border-radius: 6px;
  font-weight: 600;
  font-size: 12px;
  border: none;
}

.editor-toolbar .tb-insert-btn:hover {
  background: linear-gradient(135deg, #2ea043, #3fb950);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(46, 160, 67, 0.3);
}

.editor-toolbar .tb-insert-btn.image-btn {
  background: linear-gradient(135deg, #8b5cf6, #a855f7);
}

.editor-toolbar .tb-insert-btn.image-btn:hover {
  background: linear-gradient(135deg, #a855f7, #c084fc);
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

.editor-toolbar .tb-insert-btn.photo-btn {
  background: linear-gradient(135deg, #0ea5e9, #06b6d4);
}

.editor-toolbar .tb-insert-btn.photo-btn:hover {
  background: linear-gradient(135deg, #06b6d4, #22d3ee);
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.3);
}

/* ═══ SPLIT VIEW CONTROLS ═══ */
.split-mode-bar {
  display: flex;
  gap: 4px;
  padding: 6px 8px;
  background: var(--bg-secondary, #0d1117);
  border: 1px solid var(--border, #30363d);
  border-top: none;
  justify-content: center;
}

.split-mode-btn {
  padding: 4px 14px;
  border: 1px solid var(--border, #30363d);
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary, #8b949e);
  cursor: pointer;
  font-size: 12px;
  transition: all 0.15s;
}

.split-mode-btn.active {
  background: var(--accent, #58a6ff);
  color: white;
  border-color: var(--accent, #58a6ff);
}

/* ═══ SPLIT EDITOR CONTAINER ═══ */
.editor-split-container {
  display: flex;
  gap: 0;
  border: 1px solid var(--border, #30363d);
  border-top: none;
  border-radius: 0 0 10px 10px;
  overflow: hidden;
  min-height: 500px;
}

.editor-split-pane {
  width: 50%;
  transition: width 0.3s ease;
  position: relative;
}

.editor-split-pane.editor-pane {
  border-right: 1px solid var(--border, #30363d);
}

#edit_content {
  width: 100% !important;
  height: 100% !important;
  min-height: 500px;
  border: none !important;
  border-radius: 0 !important;
  resize: vertical;
  padding: 16px;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-primary, #e6edf3);
  background: var(--bg-primary, #0d1117);
  outline: none;
  tab-size: 2;
}

.enhanced-preview-pane {
  padding: 20px;
  overflow-y: auto;
  max-height: 600px;
  background: var(--bg-primary, #0d1117);
  color: var(--text-primary, #e6edf3);
  font-size: 15px;
  line-height: 1.8;
}

.enhanced-preview-pane h1,
.enhanced-preview-pane h2,
.enhanced-preview-pane h3 {
  color: var(--text-primary, #e6edf3);
  margin-top: 24px;
  margin-bottom: 12px;
}

.enhanced-preview-pane img {
  max-width: 100%;
  border-radius: 8px;
  margin: 12px 0;
}

.enhanced-preview-pane a {
  color: var(--accent, #58a6ff);
}

.enhanced-preview-pane blockquote {
  border-left: 4px solid var(--accent, #58a6ff);
  margin: 16px 0;
  padding: 12px 20px;
  background: rgba(88, 166, 255, 0.05);
  border-radius: 0 8px 8px 0;
}

.enhanced-preview-pane table {
  border-collapse: collapse;
  width: 100%;
  margin: 16px 0;
}

.enhanced-preview-pane table th,
.enhanced-preview-pane table td {
  border: 1px solid var(--border, #30363d);
  padding: 8px 12px;
  text-align: left;
}

.enhanced-preview-pane table th {
  background: var(--bg-tertiary, #161b22);
}

/* ═══ PRODUCT INSERTION DRAWER ═══ */
.product-insert-drawer {
  position: fixed;
  top: 0;
  right: -440px;
  width: 440px;
  height: 100vh;
  background: var(--bg-secondary, #0d1117);
  border-left: 2px solid #238636;
  z-index: 1000;
  transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  box-shadow: -5px 0 25px rgba(0, 0, 0, 0.5), -2px 0 12px rgba(35, 134, 54, 0.15);
}

.product-insert-drawer.open {
  right: 0;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border, #30363d);
  background: linear-gradient(135deg, rgba(35, 134, 54, 0.15), rgba(46, 160, 67, 0.05));
}

.drawer-header h3 {
  margin: 0;
  font-size: 16px;
  color: #3fb950;
}

.drawer-close {
  padding: 6px 10px;
  background: transparent;
  border: 1px solid var(--border, #30363d);
  border-radius: 6px;
  color: var(--text-secondary, #8b949e);
  cursor: pointer;
  font-size: 16px;
}

.drawer-close:hover {
  background: #da3633;
  color: white;
  border-color: #da3633;
}

.drawer-search {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border, #30363d);
}

.drawer-search input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border, #30363d);
  border-radius: 8px;
  background: var(--bg-primary, #0d1117);
  color: var(--text-primary, #e6edf3);
  font-size: 13px;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

/* Product Items in Drawer */
.product-insert-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border, #30363d);
  border-radius: 10px;
  margin-bottom: 8px;
  background: var(--bg-primary, #0d1117);
  transition: all 0.15s;
  align-items: flex-start;
}

.product-insert-item:hover {
  border-color: var(--accent, #58a6ff);
  background: rgba(88, 166, 255, 0.03);
}

.product-insert-item.inserted {
  border-color: #238636;
  background: rgba(35, 134, 54, 0.05);
}

.product-insert-img {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-tertiary, #161b22);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.product-insert-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.product-insert-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary, #e6edf3);
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-insert-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 11px;
}

.product-insert-price {
  color: #3fb950;
  font-weight: 700;
}

.product-insert-brand {
  color: #8b949e;
  background: var(--bg-tertiary, #161b22);
  padding: 1px 6px;
  border-radius: 4px;
}

.product-insert-cat {
  color: #7d8590;
  font-style: italic;
}

.product-insert-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}

.product-insert-actions button {
  padding: 4px 10px;
  border: 1px solid var(--border, #30363d);
  border-radius: 6px;
  background: var(--bg-tertiary, #161b22);
  color: var(--text-secondary, #8b949e);
  cursor: pointer;
  font-size: 11px;
  white-space: nowrap;
  transition: all 0.15s;
}

.product-insert-actions button:hover {
  border-color: var(--accent, #58a6ff);
  color: var(--text-primary, #e6edf3);
}

.btn-insert-product:hover {
  background: rgba(35, 134, 54, 0.2) !important;
  border-color: #238636 !important;
  color: #3fb950 !important;
}

.btn-insert-link:hover {
  background: rgba(88, 166, 255, 0.1) !important;
  border-color: #58a6ff !important;
}

.btn-insert-img:hover {
  background: rgba(139, 92, 246, 0.1) !important;
  border-color: #8b5cf6 !important;
}

.inserted-badge {
  font-size: 10px;
  color: #3fb950;
  text-align: center;
}

/* ═══ IMAGE GALLERY PANEL ═══ */
.image-gallery-panel {
  position: fixed;
  top: 0;
  right: -500px;
  width: 500px;
  height: 100vh;
  background: var(--bg-secondary, #0d1117);
  border-left: 2px solid #8b5cf6;
  z-index: 1000;
  transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  box-shadow: -5px 0 25px rgba(0, 0, 0, 0.5), -2px 0 12px rgba(139, 92, 246, 0.15);
}

.image-gallery-panel.open {
  right: 0;
}

.gallery-gen-form {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border, #30363d);
}

.gallery-gen-form textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border, #30363d);
  border-radius: 8px;
  background: var(--bg-primary, #0d1117);
  color: var(--text-primary, #e6edf3);
  font-size: 13px;
  resize: none;
  margin-bottom: 8px;
}

.gallery-gen-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.gallery-gen-row select {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid var(--border, #30363d);
  border-radius: 6px;
  background: var(--bg-primary, #0d1117);
  color: var(--text-primary, #e6edf3);
  font-size: 12px;
}

.gallery-gen-row button {
  padding: 8px 16px;
  background: linear-gradient(135deg, #8b5cf6, #a855f7);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  transition: all 0.15s;
}

.gallery-gen-row button:hover {
  background: linear-gradient(135deg, #a855f7, #c084fc);
  transform: translateY(-1px);
}

.gallery-status {
  font-size: 12px;
  padding: 6px 0;
}

.gallery-status.generating { color: #f59e0b; }
.gallery-status.success { color: #3fb950; }
.gallery-status.error { color: #f87171; }

.gallery-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.gallery-image-card {
  border: 1px solid var(--border, #30363d);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-primary, #0d1117);
  transition: all 0.2s;
}

.gallery-image-card:hover {
  border-color: #a855f7;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.2);
}

.gallery-image-wrap {
  aspect-ratio: 1;
  overflow: hidden;
}

.gallery-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.gallery-image-card:hover .gallery-image-wrap img {
  transform: scale(1.05);
}

.gallery-image-info {
  padding: 10px;
}

.gallery-image-prompt {
  font-size: 11px;
  color: var(--text-muted, #7d8590);
  margin-bottom: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gallery-image-actions {
  display: flex;
  gap: 4px;
}

.gallery-image-actions button {
  flex: 1;
  padding: 5px 8px;
  border: 1px solid var(--border, #30363d);
  border-radius: 5px;
  background: var(--bg-tertiary, #161b22);
  color: var(--text-secondary, #8b949e);
  cursor: pointer;
  font-size: 10px;
  transition: all 0.15s;
}

.btn-gallery-insert:hover {
  background: rgba(35, 134, 54, 0.2);
  border-color: #238636;
  color: #3fb950;
}

.btn-gallery-featured:hover {
  background: rgba(245, 158, 11, 0.2);
  border-color: #f59e0b;
  color: #fbbf24;
}

.btn-gallery-copy:hover {
  background: rgba(88, 166, 255, 0.1);
  border-color: #58a6ff;
  color: #58a6ff;
}

/* ═══ PRODUCT PHOTO BROWSER ═══ */
.product-photo-panel {
  position: fixed;
  top: 0;
  right: -460px;
  width: 460px;
  height: 100vh;
  background: var(--bg-secondary, #0d1117);
  border-left: 2px solid #06b6d4;
  z-index: 1000;
  transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  box-shadow: -5px 0 25px rgba(0, 0, 0, 0.5), -2px 0 12px rgba(6, 182, 212, 0.15);
}

.product-photo-panel.open {
  right: 0;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.photo-card {
  border: 1px solid var(--border, #30363d);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-primary, #0d1117);
  transition: all 0.2s;
}

.photo-card:hover {
  border-color: #22d3ee;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(6, 182, 212, 0.2);
}

.photo-card-img {
  aspect-ratio: 1;
  overflow: hidden;
}

.photo-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-card-info {
  padding: 8px;
}

.photo-card-name {
  font-size: 10px;
  color: var(--text-muted, #7d8590);
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 4px;
}

.photo-card-actions {
  display: flex;
  gap: 4px;
}

.photo-card-actions button {
  flex: 1;
  padding: 4px;
  border: 1px solid var(--border, #30363d);
  border-radius: 4px;
  background: var(--bg-tertiary, #161b22);
  color: var(--text-secondary, #8b949e);
  cursor: pointer;
  font-size: 11px;
  transition: all 0.15s;
}

.photo-card-actions button:hover {
  border-color: var(--accent, #58a6ff);
  color: var(--text-primary, #e6edf3);
}

/* ═══ OVERLAY BACKDROP ═══ */
.editor-drawer-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  backdrop-filter: blur(2px);
}

.editor-drawer-backdrop.show {
  display: block;
}

/* ═══ TOAST ═══ */
.editor-toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  z-index: 10000;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

.editor-toast.show {
  transform: translateX(-50%) translateY(0);
}

.editor-toast-success {
  background: #238636;
  color: white;
}

.editor-toast-error {
  background: #da3633;
  color: white;
}

.editor-toast-info {
  background: #1f6feb;
  color: white;
}

/* ═══ ENHANCED FEATURES INFO BAR ═══ */
.editor-features-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(88, 166, 255, 0.05);
  border: 1px solid rgba(88, 166, 255, 0.15);
  border-radius: 8px;
  margin-bottom: 16px;
  align-items: center;
}

.editor-features-bar .feature-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--bg-tertiary, #161b22);
  border: 1px solid var(--border, #30363d);
  border-radius: 20px;
  font-size: 11px;
  color: var(--text-secondary, #8b949e);
}

.editor-features-bar .feature-chip kbd {
  padding: 1px 5px;
  background: var(--bg-primary, #0d1117);
  border: 1px solid var(--border, #30363d);
  border-radius: 3px;
  font-size: 10px;
  font-family: monospace;
}

/* ═══ EDITOR SECTION ENHANCEMENTS ═══ */
.editor-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.editor-meta-grid > div {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.editor-meta-grid label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary, #8b949e);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.editor-meta-grid input {
  padding: 10px 14px;
  border: 1px solid var(--border, #30363d);
  border-radius: 8px;
  background: var(--bg-primary, #0d1117);
  color: var(--text-primary, #e6edf3);
  font-size: 14px;
}

/* ═══ FEATURED IMAGE ENHANCED ═══ */
.featured-image-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--border, #30363d);
  border-radius: 10px;
  background: var(--bg-primary, #0d1117);
  transition: all 0.3s;
}

.featured-image-section:has(.featured-image-preview img) {
  border-color: rgba(245, 158, 11, 0.4);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.03), transparent);
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.05);
}

.featured-image-preview {
  aspect-ratio: 16/9;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-tertiary, #161b22);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  color: var(--text-muted, #484f58);
  border: 2px dashed var(--border, #30363d);
  transition: border-color 0.3s;
}

.featured-image-preview:has(img) {
  border: 2px solid #f59e0b;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.15);
}

.featured-image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.featured-image-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ═══ RESPONSIVE ═══ */
@media (max-width: 900px) {
  .editor-split-container {
    flex-direction: column;
  }
  
  .editor-split-pane {
    width: 100% !important;
  }
  
  .editor-split-pane.editor-pane {
    border-right: none;
    border-bottom: 1px solid var(--border, #30363d);
  }
  
  .product-insert-drawer,
  .image-gallery-panel,
  .product-photo-panel {
    width: 100%;
    right: -100%;
  }
  
  .editor-toolbar .tb-insert-group {
    width: 100%;
    margin-left: 0;
    margin-top: 6px;
    justify-content: flex-start;
  }
  
  .featured-image-section {
    grid-template-columns: 1fr;
  }
  
  .editor-meta-grid {
    grid-template-columns: 1fr;
  }
}

/* ═══ COLOR-CODED TOOLBAR BUTTONS ═══ */
/* All toolbar buttons get a subtle colored background + border to be clearly visible */
.editor-toolbar button[data-action="heading"],
.editor-toolbar button[data-action="h2"],
.editor-toolbar button[data-action="h3"],
.editor-toolbar button[data-action="h4"] {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.25);
  font-weight: 700;
}
.editor-toolbar button[data-action="heading"]:hover,
.editor-toolbar button[data-action="h2"]:hover,
.editor-toolbar button[data-action="h3"]:hover,
.editor-toolbar button[data-action="h4"]:hover {
  background: rgba(245, 158, 11, 0.25);
  border-color: rgba(245, 158, 11, 0.5);
  color: #fcd34d;
}

.editor-toolbar button[data-action="bold"],
.editor-toolbar button[data-action="italic"],
.editor-toolbar button[data-action="strikethrough"] {
  color: #a5b4fc;
  background: rgba(165, 180, 252, 0.10);
  border: 1px solid rgba(165, 180, 252, 0.20);
  font-weight: 700;
}
.editor-toolbar button[data-action="bold"]:hover,
.editor-toolbar button[data-action="italic"]:hover,
.editor-toolbar button[data-action="strikethrough"]:hover {
  background: rgba(165, 180, 252, 0.22);
  border-color: rgba(165, 180, 252, 0.45);
  color: #c7d2fe;
}

.editor-toolbar button[data-action="link"] {
  color: #60a5fa;
  background: rgba(96, 165, 250, 0.10);
  border: 1px solid rgba(96, 165, 250, 0.22);
}
.editor-toolbar button[data-action="link"]:hover {
  background: rgba(96, 165, 250, 0.22);
  border-color: rgba(96, 165, 250, 0.45);
  color: #93bbfd;
}

.editor-toolbar button[data-action="ul"],
.editor-toolbar button[data-action="ol"],
.editor-toolbar button[data-action="checklist"] {
  color: #34d399;
  background: rgba(52, 211, 153, 0.10);
  border: 1px solid rgba(52, 211, 153, 0.22);
}
.editor-toolbar button[data-action="ul"]:hover,
.editor-toolbar button[data-action="ol"]:hover,
.editor-toolbar button[data-action="checklist"]:hover {
  background: rgba(52, 211, 153, 0.22);
  border-color: rgba(52, 211, 153, 0.45);
  color: #6ee7b7;
}

.editor-toolbar button[data-action="blockquote"] {
  color: #c084fc;
  background: rgba(192, 132, 252, 0.10);
  border: 1px solid rgba(192, 132, 252, 0.22);
}
.editor-toolbar button[data-action="blockquote"]:hover {
  background: rgba(192, 132, 252, 0.22);
  border-color: rgba(192, 132, 252, 0.45);
}

.editor-toolbar button[data-action="code"],
.editor-toolbar button[data-action="codeblock"] {
  color: #fb923c;
  background: rgba(251, 146, 60, 0.10);
  border: 1px solid rgba(251, 146, 60, 0.22);
}
.editor-toolbar button[data-action="code"]:hover,
.editor-toolbar button[data-action="codeblock"]:hover {
  background: rgba(251, 146, 60, 0.22);
  border-color: rgba(251, 146, 60, 0.45);
  color: #fdba74;
}

.editor-toolbar button[data-action="table"] {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.10);
  border: 1px solid rgba(56, 189, 248, 0.22);
}
.editor-toolbar button[data-action="table"]:hover {
  background: rgba(56, 189, 248, 0.22);
  border-color: rgba(56, 189, 248, 0.45);
}

/* ═══ ENHANCED PRODUCT ITEM COLORS ═══ */
.product-insert-item.inserted {
  border-color: #238636;
  background: rgba(35, 134, 54, 0.08);
  position: relative;
}

.product-insert-item.inserted::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: linear-gradient(180deg, #3fb950, #238636);
  border-radius: 10px 0 0 10px;
}

.product-insert-item:hover .product-insert-img {
  box-shadow: 0 0 12px rgba(88, 166, 255, 0.15);
}

.product-insert-price {
  color: #3fb950;
  font-weight: 700;
  font-size: 13px;
}

/* ═══ PRODUCT LOCATOR BAR (LEFT PANE — above textarea) ═══ */
/* Shows colored badges for each product in the text so user can find them */
.product-locator-bar {
  display: none; /* shown by JS when products exist */
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.12), rgba(139, 92, 246, 0.03));
  border-bottom: 2px solid rgba(167, 139, 250, 0.3);
  border-radius: 8px 8px 0 0;
}

.product-locator-label {
  font-size: 11px;
  font-weight: 700;
  color: #a78bfa;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-right: 4px;
  white-space: nowrap;
}

.product-locator-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(167, 139, 250, 0.12);
  border: 1px solid rgba(167, 139, 250, 0.35);
  border-radius: 20px;
  color: #c4b5fd;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.product-locator-badge:hover {
  background: rgba(167, 139, 250, 0.25);
  border-color: #a78bfa;
  color: #e9d5ff;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

.product-locator-badge .plb-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  background: #7c3aed;
  color: white;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
}

.product-locator-badge .plb-name {
  font-weight: 600;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-locator-badge .plb-line {
  font-size: 9px;
  color: #7d8590;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

/* ═══ CLEAN PRODUCT CARD IN PREVIEW (RIGHT PANE) ═══ */
/* Preview shows article as it will look on the blog — clean, full opacity, no debug markers */
.preview-product-card {
  display: flex;
  gap: 16px;
  padding: 20px;
  margin: 20px 0;
  align-items: center;
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  border: 2px solid rgba(167, 139, 250, 0.4);
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.preview-product-card .preview-product-img {
  width: 130px;
  height: 130px;
  object-fit: cover;
  border-radius: 10px;
  flex-shrink: 0;
  border: 1px solid rgba(167, 139, 250, 0.3);
}

.preview-product-card .preview-product-body {
  flex: 1;
  min-width: 0;
}

.preview-product-card .preview-product-title {
  font-weight: 700;
  font-size: 17px;
  color: #c4b5fd;
  margin-bottom: 6px;
}

.preview-product-card .preview-product-brand {
  font-size: 12px;
  color: #7d8590;
  margin-bottom: 6px;
}

.preview-product-card .preview-product-price {
  font-size: 20px;
  font-weight: 700;
  color: #a78bfa;
  margin-bottom: 10px;
}

.preview-product-card .preview-product-desc {
  font-size: 13px;
  color: #8b949e;
  margin-bottom: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.preview-product-card .preview-product-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: #7c3aed;
  color: white;
  border-radius: 8px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.2s;
}

.preview-product-card .preview-product-cta:hover {
  background: #8b5cf6;
}

/* Style existing product-recommendation divs that pass through from markdown */
.enhanced-preview-pane .product-recommendation {
  display: flex;
  gap: 16px;
  padding: 20px;
  margin: 24px 0;
  align-items: center;
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  border: 2px solid rgba(167, 139, 250, 0.4);
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.enhanced-preview-pane .product-recommendation-img {
  width: 130px;
  height: 130px;
  object-fit: cover;
  border-radius: 10px;
  flex-shrink: 0;
  border: 1px solid rgba(167, 139, 250, 0.3);
}

.enhanced-preview-pane .product-recommendation-body {
  flex: 1;
  min-width: 0;
}

.enhanced-preview-pane .product-recommendation-title {
  font-weight: 700;
  font-size: 17px;
  color: #c4b5fd;
  margin: 0 0 6px;
}

.enhanced-preview-pane .product-recommendation-brand {
  font-size: 12px;
  color: #7d8590;
  margin: 0 0 6px;
}

.enhanced-preview-pane .product-recommendation-price {
  font-size: 20px;
  font-weight: 700;
  color: #a78bfa;
  margin: 0 0 10px;
}

.enhanced-preview-pane .product-recommendation-desc {
  font-size: 13px;
  color: #8b949e;
  margin: 0 0 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.enhanced-preview-pane .product-recommendation-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: #7c3aed;
  color: white !important;
  border-radius: 8px;
  text-decoration: none !important;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.2s;
}

.enhanced-preview-pane .product-recommendation-cta:hover {
  background: #8b5cf6;
}

/* Inline product links highlighting */
.product-inline-link {
  color: #c4b5fd !important;
  background: rgba(167, 139, 250, 0.15);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid rgba(167, 139, 250, 0.35);
  text-decoration: none !important;
  font-weight: 600;
  transition: all 0.2s;
}

.product-inline-link:hover {
  background: rgba(167, 139, 250, 0.30);
  border-color: rgba(167, 139, 250, 0.6);
  color: #e9d5ff !important;
}

/* ═══ ACTIVE EDITOR TEXTAREA ═══ */
#edit_content {
  border-left: 3px solid rgba(167, 139, 250, 0.3) !important;
  background: linear-gradient(90deg, rgba(167, 139, 250, 0.03), var(--bg-primary, #0d1117) 80px) !important;
}
#edit_content:focus {
  box-shadow: inset 0 0 0 1px rgba(167, 139, 250, 0.25);
  background: linear-gradient(90deg, rgba(167, 139, 250, 0.06), #0a0e14 80px) !important;
  border-left-color: rgba(167, 139, 250, 0.6) !important;
}

/* ═══ SPLIT EDITOR DIVIDER ═══ */
.editor-split-pane.editor-pane {
  border-right: 2px solid rgba(167, 139, 250, 0.2) !important;
}

/* ═══ PREVIEW PANE VISUAL ═══ */
.enhanced-preview-pane {
  border-left: 3px solid rgba(88, 166, 255, 0.2);
  background: linear-gradient(90deg, rgba(88, 166, 255, 0.02), var(--bg-primary, #0d1117) 80px);
}

/* ═══ EDITOR SECTION LABELS ═══ */
.editor-meta-grid label {
  font-size: 12px;
  font-weight: 600;
  color: #8b949e;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ═══ DRAWER/PANEL HEADER COLORS ═══ */
.image-gallery-panel .drawer-header {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(168, 85, 247, 0.05));
  border-bottom-color: rgba(139, 92, 246, 0.2);
}

.image-gallery-panel .drawer-header h3 {
  color: #c4b5fd;
}

.product-photo-panel .drawer-header {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.15), rgba(14, 165, 233, 0.05));
  border-bottom-color: rgba(6, 182, 212, 0.2);
}

.product-photo-panel .drawer-header h3 {
  color: #67e8f9;
}

/* ═══ ENHANCED GALLERY ACTION BUTTONS ═══ */
.btn-gallery-insert {
  background: transparent;
  border-color: rgba(35, 134, 54, 0.3);
  color: #3fb950;
}

.btn-gallery-featured {
  background: transparent;
  border-color: rgba(245, 158, 11, 0.3);
  color: #fbbf24;
}

.btn-gallery-copy {
  background: transparent;
  border-color: rgba(88, 166, 255, 0.3);
  color: #58a6ff;
}

/* ═══ PHOTO CARD ACTION COLORS ═══ */
.photo-card-actions .btn-photo-insert {
  border-color: rgba(35, 134, 54, 0.3);
  color: #3fb950;
}

.photo-card-actions .btn-photo-insert:hover {
  background: rgba(35, 134, 54, 0.15);
  border-color: #238636;
}

.photo-card-actions .btn-photo-featured {
  border-color: rgba(245, 158, 11, 0.3);
  color: #fbbf24;
}

.photo-card-actions .btn-photo-featured:hover {
  background: rgba(245, 158, 11, 0.15);
  border-color: #f59e0b;
}

.photo-card-actions .btn-photo-copy {
  border-color: rgba(6, 182, 212, 0.3);
  color: #22d3ee;
}

.photo-card-actions .btn-photo-copy:hover {
  background: rgba(6, 182, 212, 0.15);
  border-color: #06b6d4;
}

/* ═══ EDITOR WORD COUNT BAR ═══ */
.editor-word-count {
  display: flex;
  justify-content: space-between;
  padding: 6px 16px;
  background: var(--bg-tertiary, #161b22);
  border-top: 1px solid var(--border, #30363d);
  font-size: 11px;
  color: var(--text-muted, #7d8590);
}

.editor-word-count .wc-count {
  color: #58a6ff;
  font-weight: 600;
}

.editor-word-count .wc-label {
  color: #8b949e;
}

/* ═══ PULSE ANIMATION FOR ACTIVE PANELS ═══ */
@keyframes panelGlow {
  0%, 100% { box-shadow: -5px 0 25px rgba(0, 0, 0, 0.5); }
  50% { box-shadow: -5px 0 30px rgba(0, 0, 0, 0.6); }
}

.product-insert-drawer.open,
.image-gallery-panel.open,
.product-photo-panel.open {
  animation: panelGlow 3s ease-in-out infinite;
}

/* ═══ SMOOTH SCROLLBAR STYLING ═══ */
.drawer-body::-webkit-scrollbar,
.gallery-body::-webkit-scrollbar,
.enhanced-preview-pane::-webkit-scrollbar {
  width: 6px;
}

.drawer-body::-webkit-scrollbar-track,
.gallery-body::-webkit-scrollbar-track,
.enhanced-preview-pane::-webkit-scrollbar-track {
  background: transparent;
}

.drawer-body::-webkit-scrollbar-thumb,
.gallery-body::-webkit-scrollbar-thumb,
.enhanced-preview-pane::-webkit-scrollbar-thumb {
  background: rgba(139, 148, 158, 0.3);
  border-radius: 3px;
}

.drawer-body::-webkit-scrollbar-thumb:hover,
.gallery-body::-webkit-scrollbar-thumb:hover,
.enhanced-preview-pane::-webkit-scrollbar-thumb:hover {
  background: rgba(139, 148, 158, 0.5);
}
