/* Live CMS — inline editing overlay styles */

/* Editable element highlight */
[data-lcms-field].lcms-editable {
  position: relative;
  outline: 2px dashed var(--color-orange-main, #FF6009) !important;
  outline-offset: 4px;
  cursor: pointer;
  transition: outline-color 0.2s ease, box-shadow 0.2s ease;
}

[data-lcms-field].lcms-editable:hover {
  outline-color: var(--color-dark-purple, #A633AC) !important;
  box-shadow: 0 0 0 6px rgba(166, 51, 172, 0.15);
}

/* Field label badge */
.lcms-label {
  position: absolute;
  top: -20px;
  left: 0;
  background: var(--color-orange-main, #FF6009);
  color: #fff;
  font-family: 'Aeonik', system-ui, sans-serif;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  padding: 3px 8px;
  border-radius: 3px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 10000;
  opacity: 0.85;
}

/* Inline editor popup */
.lcms-editor {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  padding: 32px;
  z-index: 100001;
  width: 90%;
  max-width: 560px;
  font-family: 'Aeonik', system-ui, sans-serif;
}

.lcms-editor-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-brown, #5A1107);
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.lcms-editor textarea,
.lcms-editor input[type="text"] {
  width: 100%;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  padding: 12px 16px;
  font-family: 'Aeonik', system-ui, sans-serif;
  font-size: 16px;
  color: var(--color-brown, #5A1107);
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
}

.lcms-editor textarea:focus,
.lcms-editor input[type="text"]:focus {
  border-color: var(--color-orange-main, #FF6009);
}

.lcms-editor-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  justify-content: flex-end;
}

.lcms-btn {
  padding: 10px 24px;
  border-radius: 200px;
  font-family: 'Aeonik', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.lcms-btn-save {
  background: var(--color-orange-main, #FF6009);
  color: #fff;
  font-size: 18px;
}

.lcms-btn-save:hover {
  background: var(--color-orange-hover, #e55608);
}

.lcms-btn-save:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.lcms-btn-cancel {
  background: #f0f0f0;
  color: var(--color-brown, #5A1107);
}

.lcms-btn-cancel:hover {
  background: #e0e0e0;
}

/* Backdrop */
.lcms-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 100000;
}

/* Toast notification */
.lcms-toast {
  position: fixed;
  bottom: 32px;
  right: 32px;
  background: var(--color-brown, #5A1107);
  color: #fff;
  font-family: 'Aeonik', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 500;
  padding: 12px 24px;
  border-radius: 8px;
  z-index: 100002;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
}

.lcms-toast.lcms-toast--visible {
  opacity: 1;
  transform: translateY(0);
}

.lcms-toast--error {
  background: #c0392b !important;
}

/* Admin bar button active state */
#wp-admin-bar-live-cms-toggle .ab-item.lcms-active {
  background: var(--color-orange-main, #FF6009) !important;
  color: #fff !important;
}

/* ==========================================================================
   Onboarding coachmark (points user to "Live CMS")
   ========================================================================== */
.lcms-coachmark {
  position: fixed;
  inset: 0;
  z-index: 100003;
  pointer-events: none;
}

.lcms-coachmark .lcms-coachmark-ring {
  position: fixed;
  border-radius: 10px;
  box-shadow:
    0 0 0 2px rgba(255, 96, 9, 0.95),
    0 0 0 8px rgba(255, 96, 9, 0.18),
    0 18px 55px rgba(0, 0, 0, 0.45);
  transform-origin: center;
  animation: lcms-coachmark-pulse 1.25s ease-in-out infinite;
}

.lcms-coachmark .lcms-coachmark-bubble {
  position: fixed;
  max-width: 320px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(15, 15, 15, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.35;
  letter-spacing: 0.2px;
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.55);
  animation: lcms-coachmark-float 1.6s ease-in-out infinite;
}

.lcms-coachmark .lcms-coachmark-bubble strong {
  color: var(--color-orange-main, #FF6009);
  font-weight: 700;
}

.lcms-coachmark .lcms-coachmark-arrow {
  position: fixed;
  width: 12px;
  height: 12px;
  background: rgba(15, 15, 15, 0.92);
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  transform: rotate(45deg);
}

.lcms-coachmark.lcms-coachmark--hiding {
  animation: lcms-coachmark-fadeout 240ms ease forwards;
}

@keyframes lcms-coachmark-pulse {
  0% { transform: scale(1); }
  60% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

@keyframes lcms-coachmark-float {
  0% { transform: translateY(0); }
  55% { transform: translateY(-6px); }
  100% { transform: translateY(0); }
}

@keyframes lcms-coachmark-fadeout {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* Image info overlay */
.lcms-image-info {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  z-index: 10000;
  pointer-events: none;
}

.lcms-image-info span {
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-family: 'Aeonik', system-ui, monospace;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

/* Image preview in editor */
.lcms-image-preview {
  margin-bottom: 16px;
  border-radius: 8px;
  overflow: hidden;
  background: #f5f5f5;
  max-height: 200px;
}

.lcms-preview-img {
  width: 100%;
  height: auto;
  max-height: 200px;
  object-fit: contain;
  display: block;
}

/* Upload area */
.lcms-upload-area {
  border: 2px dashed #d0d0d0;
  border-radius: 12px;
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.lcms-upload-area:hover,
.lcms-upload-area.lcms-upload-dragover {
  border-color: var(--color-orange-main, #FF6009);
  background: rgba(255, 96, 9, 0.04);
}

.lcms-upload-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.lcms-upload-text {
  font-family: 'Aeonik', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-brown, #5A1107);
  margin: 0 0 4px;
}

.lcms-upload-hint {
  font-family: 'Aeonik', system-ui, sans-serif;
  font-size: 12px;
  color: #999;
  margin: 0;
}

.lcms-file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

/* Block-level editor — wider modal matching content width */
.lcms-editor--block {
  max-width: 780px;
  width: 95%;
}

.lcms-block-textarea {
  width: 100%;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  padding: 16px 20px;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
  background: #fafafa;
}

.lcms-block-textarea:focus {
  border-color: var(--color-orange-main, #FF6009);
  background: #fff;
}

/* Post picker search input */
.lcms-post-search {
  width: 100%;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  padding: 10px 16px;
  font-family: 'Aeonik', system-ui, sans-serif;
  font-size: 14px;
  color: var(--color-brown, #5A1107);
  outline: none;
  transition: border-color 0.2s;
}

.lcms-post-search:focus {
  border-color: var(--color-orange-main, #FF6009);
}

/* Post picker results */
.lcms-post-results {
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 4px 12px;
}

.lcms-post-item:last-child {
  border-bottom: none !important;
}

/* Image editor tabs */
.lcms-img-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 16px;
  border-bottom: 2px solid #eee;
}

.lcms-img-tab {
  flex: 1;
  padding: 10px 16px;
  font-family: 'Aeonik', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #999;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: all 0.2s;
}

.lcms-img-tab:hover {
  color: var(--color-brown, #5A1107);
}

.lcms-img-tab--active {
  color: var(--color-orange-main, #FF6009);
  border-bottom-color: var(--color-orange-main, #FF6009);
}

/* Fix inputs stretching outside modal */
.lcms-editor input[type="text"],
.lcms-editor textarea,
.lcms-block-textarea {
  box-sizing: border-box;
}
