/* =====================================================================
   editor.css
   - Inline editing, modals, and admin UI
====================================================================== */

/* [editor.css] Editable region highlighting */
[contenteditable="true"]:focus {
  outline: 2px solid rgba(0, 123, 255, 0.4);
  background-color: rgba(0, 123, 255, 0.05);
}

/* [editor.css] Inline edit toolbar */
.inline-toolbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #1b2733;
  color: #fff;
  padding: 8px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  z-index: 1000;
}
.inline-toolbar button {
  background: #374a60;
  border: none;
  color: #fff;
  margin-left: 6px;
  padding: 6px 10px;
  border-radius: 3px;
  cursor: pointer;
}
.inline-toolbar button:hover {
  background: #4c6480;
}

/* [editor.css] Edit icon (“pencil”) button */
.edit-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(27,39,51,0.75);
  border-radius: 50%;
  color: #fff;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  z-index: 900;
}
.edit-btn:hover {
  background: rgba(27,39,51,0.9);
}

/* [editor.css] Edit modal overlay + window */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1100;
}
.modal {
  background: #fff;
  border-radius: 6px;
  width: 90%;
  max-width: 640px;
  padding: 24px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}
.modal h2 {
  margin-top: 0;
}
.modal button.close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: transparent;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
}

/* [editor.css] Form fields in edit modal */
.modal form label {
  display: block;
  margin-top: 10px;
  font-weight: 600;
}
.modal form input[type="text"],
.modal form textarea {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 3px;
  margin-top: 4px;
  font-size: 0.95rem;
  font-family: inherit;
}
.modal form textarea {
  min-height: 120px;
  resize: vertical;
}

/* [editor.css] Save/Delete buttons */
.modal form .actions {
  margin-top: 18px;
  text-align: right;
}
.modal form .actions button {
  padding: 6px 12px;
  font-size: 0.9rem;
  border-radius: 4px;
  border: none;
  cursor: pointer;
}
.modal form .actions .save {
  background-color: #2d7be8;
  color: #fff;
}
.modal form .actions .delete {
  background-color: #e83f2d;
  color: #fff;
}
.modal form .actions button:hover {
  opacity: 0.9;
}

/* [editor.css] Preview overlay for uploaded images */
.image-preview {
  position: relative;
  display: inline-block;
  margin-top: 8px;
}
.image-preview img {
  max-width: 100%;
  border: 1px solid #ccc;
  border-radius: 3px;
}
.image-preview .remove {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1rem;
  cursor: pointer;
}
.image-preview .remove:hover {
  background: rgba(0,0,0,0.8);
}

/* [editor.css] Notifications and confirmations */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #1b2733;
  color: #fff;
  padding: 10px 16px;
  border-radius: 4px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.3);
  z-index: 1200;
  animation: fadeIn 0.3s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}