/* ==========================================================================
   BVM Guarded Visual Editor Stylesheet
   Strictly preserves theme design tokens, fonts, colors, and layout integrity
   ========================================================================== */

/* Activation Floating Pill */
.bvm-activation-pill {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 999999;
  background: #111827;
  color: #ea580c;
  padding: 10px 20px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  border: 1.5px solid #ea580c;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.bvm-activation-pill:hover {
  transform: scale(1.06);
  box-shadow: 0 12px 30px rgba(234, 88, 12, 0.3);
  color: #fff;
  background: #ea580c;
}

/* Bottom Editor Toolbar */
.bvm-editor-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999999;
  background: #0f172a;
  color: #f8fafc;
  border-top: 2px solid #ea580c;
  box-shadow: 0 -4px 25px rgba(0, 0, 0, 0.4);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  padding: 12px 24px;
}
.bvm-bar-inner {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.bvm-bar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}
.bvm-badge {
  background: #ea580c;
  color: #fff;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.bvm-status {
  font-size: 13px;
  color: #cbd5e1;
}
.bvm-bar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Action Buttons in Toolbar */
.bvm-btn {
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  transition: all 0.2s ease;
  font-family: inherit;
}
.bvm-btn-save {
  background: #16a34a;
  color: #fff;
}
.bvm-btn-save:hover:not(:disabled) {
  background: #15803d;
  transform: translateY(-1px);
}
.bvm-btn-save:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.bvm-btn-save.has-changes {
  background: #ea580c;
  animation: bvm-pulse 2s infinite;
}
@keyframes bvm-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(234, 88, 12, 0.5); }
  50% { box-shadow: 0 0 0 8px rgba(234, 88, 12, 0); }
}
.bvm-btn-discard {
  background: #334155;
  color: #f1f5f9;
}
.bvm-btn-discard:hover {
  background: #475569;
}
.bvm-btn-exit {
  background: transparent;
  color: #94a3b8;
  border: 1px solid #334155;
}
.bvm-btn-exit:hover {
  background: #1e293b;
  color: #fff;
}

/* Guarded Editable Text Highlights */
[data-bvm-editable-text="true"] {
  transition: outline 0.15s ease, background-color 0.15s ease;
  border-radius: 4px;
}
[data-bvm-editable-text="true"]:hover {
  outline: 1.5px dashed rgba(234, 88, 12, 0.45) !important;
  cursor: text;
}
[data-bvm-editable-text="true"]:focus {
  outline: 2px solid #ea580c !important;
  background: rgba(234, 88, 12, 0.05) !important;
}

/* Guarded Block / Card Hover Toolbar */
.bvm-block-bar {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 100;
  display: none;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(8px);
  padding: 4px 6px;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.12);
  gap: 4px;
}
*:hover > .bvm-block-bar {
  display: flex;
}
.bvm-bb-btn {
  background: #1e293b;
  color: #f8fafc;
  border: 1px solid #334155;
  padding: 3px 7px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1.2;
}
.bvm-bb-btn:hover {
  background: #ea580c;
  border-color: #ea580c;
  color: #fff;
}
.bvm-bb-del:hover {
  background: #dc2626;
  border-color: #dc2626;
}

/* Image Change Badges */
.bvm-img-badge {
  position: absolute;
  bottom: 10px;
  right: 10px;
  z-index: 90;
  background: rgba(15, 23, 42, 0.9);
  color: #fff;
  border: 1px solid #ea580c;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  transition: all 0.2s ease;
}
.bvm-img-badge:hover {
  background: #ea580c;
  transform: scale(1.05);
}

/* Modals (Image & Link) */
.bvm-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999999;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.bvm-modal-overlay.open {
  display: flex;
}
.bvm-modal-box {
  background: #0f172a;
  color: #f8fafc;
  border-radius: 12px;
  width: 100%;
  max-width: 520px;
  border: 1px solid #334155;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.bvm-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #1e293b;
}
.bvm-modal-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #f8fafc;
}
.bvm-modal-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 18px;
  cursor: pointer;
}
.bvm-modal-close:hover {
  color: #fff;
}
.bvm-modal-body {
  padding: 20px;
}
.bvm-dropzone {
  border: 2px dashed #475569;
  border-radius: 8px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #1e293b;
}
.bvm-dropzone:hover {
  border-color: #ea580c;
  background: #1e293b;
}
.bvm-dropzone-icon {
  font-size: 32px;
  margin-bottom: 8px;
}
.bvm-dropzone p {
  margin: 0;
  font-size: 13px;
}
.bvm-dropzone .subtext {
  color: #94a3b8;
  font-size: 12px;
  margin-top: 4px;
}
.bvm-or-divider {
  text-align: center;
  position: relative;
  margin: 16px 0;
}
.bvm-or-divider::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: #334155;
}
.bvm-or-divider span {
  position: relative;
  background: #0f172a;
  padding: 0 10px;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
}
.bvm-field label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #cbd5e1;
  margin-bottom: 6px;
}
.bvm-input {
  width: 100%;
  padding: 10px 14px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 6px;
  color: #f8fafc;
  font-size: 13px;
  box-sizing: border-box;
}
.bvm-input:focus {
  outline: 2px solid #ea580c;
  border-color: #ea580c;
}
.bvm-preview-box {
  margin-top: 14px;
  max-height: 160px;
  overflow: hidden;
  border-radius: 6px;
  background: #1e293b;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bvm-preview-box img {
  max-height: 160px;
  width: auto;
  object-fit: cover;
}
.bvm-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid #1e293b;
  background: #0f172a;
}

/* Toast Notifications */
.bvm-toast {
  position: fixed;
  bottom: 80px;
  right: 24px;
  z-index: 99999999;
  background: #1e293b;
  color: #f8fafc;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  border-left: 4px solid #16a34a;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.25s ease;
  pointer-events: none;
}
.bvm-toast.show {
  opacity: 1;
  transform: translateY(0);
}
.bvm-toast.error {
  border-left-color: #dc2626;
}

/* When editing is active, add bottom padding so toolbar doesn't occlude footer */
body.bvm-editing-active {
  padding-bottom: 70px !important;
}