/**
 * ActiveWebs On-Page Live-Editor Styles
 * 100% isoliert, hochmodern und kollisionsfrei
 */

/* Highlights für editierbare Elemente im aktiven Modus */
body.onpage-editor-active .onpage-editable {
  position: relative !important;
  outline: 2px dashed rgba(56, 189, 248, 0.45) !important;
  outline-offset: 3px !important;
  transition: outline 0.15s ease, background-color 0.15s ease !important;
  cursor: text !important;
}

body.onpage-editor-active .onpage-editable:hover {
  outline: 2px solid #38bdf8 !important;
  background-color: rgba(56, 189, 248, 0.08) !important;
}

body.onpage-editor-active .onpage-editable:focus {
  outline: 2px solid #00d2c4 !important;
  background-color: rgba(0, 210, 196, 0.12) !important;
}

body.onpage-editor-active.onpage-preview-mode .onpage-editable {
  outline: none !important;
  background-color: transparent !important;
  cursor: default !important;
}

/* Floating Toolbar */
.onpage-editor-toolbar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999999;
  background: rgba(11, 19, 41, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(56, 189, 248, 0.4);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.65), 0 0 24px rgba(56, 189, 248, 0.25);
  border-radius: 50px;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 13px;
  color: #f8fafc;
  user-select: none;
  touch-action: none;
}

.onpage-editor-drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  padding: 4px 6px;
  margin-right: -4px;
  border-radius: 20px;
  color: #94a3b8;
  transition: color 0.2s, background 0.2s;
}

.onpage-editor-drag-handle:hover,
.onpage-editor-toolbar.is-dragging .onpage-editor-drag-handle {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
}

.onpage-editor-toolbar.is-dragging {
  cursor: grabbing !important;
  opacity: 0.92;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8), 0 0 30px rgba(56, 189, 248, 0.4) !important;
}

.onpage-editor-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: #38bdf8;
  padding-right: 8px;
  border-right: 1px solid rgba(255, 255, 255, 0.15);
}

/* Delete Trash Button on Editable Elements */
.onpage-delete-btn {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #ef4444;
  color: #ffffff;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  z-index: 99999;
  transition: transform 0.15s ease, background 0.15s ease;
}

/* Image Replace & Edit Controls */
.onpage-image-wrapper {
  position: relative !important;
  outline: 2px dashed rgba(56, 189, 248, 0.45) !important;
  outline-offset: 3px !important;
  transition: outline 0.15s ease, box-shadow 0.15s ease !important;
}

span.onpage-image-wrapper,
a.onpage-image-wrapper {
  display: inline-block;
}

body.onpage-editor-active .onpage-image-wrapper:hover {
  outline: 2px solid #38bdf8 !important;
  box-shadow: 0 4px 15px rgba(56, 189, 248, 0.25);
}

.onpage-image-controls {
  position: absolute;
  top: 8px;
  right: 8px;
  display: none;
  align-items: center;
  gap: 6px;
  z-index: 99999;
  background: rgba(11, 19, 41, 0.94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 4px 8px;
  border-radius: 20px;
  border: 1px solid rgba(56, 189, 248, 0.5);
  box-shadow: 0 4px 14px rgba(0,0,0,0.6);
  white-space: nowrap;
}

body.onpage-editor-active .onpage-image-wrapper:hover > .onpage-image-controls,
body.onpage-editor-active .onpage-image-controls:hover {
  display: flex !important;
}

.onpage-img-action-btn {
  background: transparent;
  border: none;
  color: #ffffff;
  cursor: pointer;
  font-size: 13px;
  padding: 4px 8px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
  transition: background 0.15s, transform 0.15s;
}

.onpage-img-action-btn:hover {
  background: rgba(56, 189, 248, 0.25);
  transform: scale(1.05);
}

.onpage-img-action-btn.btn-delete:hover {
  background: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

body.onpage-editor-active .onpage-editable:hover > .onpage-delete-btn,
body.onpage-editor-active .onpage-delete-btn:hover {
  display: flex !important;
}

.onpage-delete-btn:hover {
  background: #dc2626 !important;
  transform: scale(1.15);
}

body.onpage-editor-active.onpage-preview-mode .onpage-delete-btn,
body.onpage-editor-active.onpage-preview-mode .onpage-image-controls {
  display: none !important;
}

body.onpage-editor-active.onpage-preview-mode .onpage-image-wrapper {
  outline: none !important;
  box-shadow: none !important;
}

.onpage-element-deleted {
  display: none !important;
}

.onpage-editor-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #f1f5f9;
  padding: 6px 14px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.onpage-editor-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
}

.onpage-editor-btn-save {
  background: #009991 !important;
  border-color: #009991 !important;
  color: #ffffff !important;
  font-weight: 600;
}

.onpage-editor-btn-save:hover {
  background: #00b3aa !important;
}

.onpage-editor-btn-save.has-changes {
  background: #eab308 !important;
  border-color: #eab308 !important;
  color: #0f172a !important;
  animation: onpage-pulse 2s infinite;
}

@keyframes onpage-pulse {
  0% { box-shadow: 0 0 0 0 rgba(234, 179, 8, 0.6); }
  70% { box-shadow: 0 0 0 10px rgba(234, 179, 8, 0); }
  100% { box-shadow: 0 0 0 0 rgba(234, 179, 8, 0); }
}

/* Diskreter Footer-Login-Bereich (Unauffällig in den Footer integriert) */
.onpage-footer-login {
  display: block;
  text-align: center;
  padding: 8px 12px;
  margin-top: 10px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 11px;
  line-height: 1.4;
  opacity: 0.45;
  transition: opacity 0.25s ease;
  clear: both;
}

.onpage-footer-login:hover {
  opacity: 1;
}

.onpage-footer-login-link {
  color: inherit !important;
  text-decoration: none !important;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.3px;
  background: rgba(125, 125, 125, 0.08);
  border: 1px solid rgba(125, 125, 125, 0.18);
  transition: all 0.2s ease;
  cursor: pointer;
}

.onpage-footer-login-link:hover {
  color: #38bdf8 !important;
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.35);
  text-decoration: none !important;
}

.onpage-footer-login-icon {
  font-size: 10px;
  line-height: 1;
}

body.onpage-editor-active .onpage-footer-login {
  display: none !important;
}

/* Modal Login Dialog */
.onpage-editor-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  z-index: 10000000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: onpage-fade-in 0.2s ease;
}

.onpage-editor-modal-box {
  background: #0b1329;
  border: 1px solid rgba(56, 189, 248, 0.3);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  border-radius: 16px;
  padding: 28px 24px;
  width: 90%;
  max-width: 380px;
  color: #f8fafc;
  font-family: system-ui, -apple-system, sans-serif;
  text-align: center;
}

.onpage-editor-modal-box h3 {
  font-size: 18px;
  margin: 0 0 8px 0;
  font-weight: 600;
  color: #ffffff;
}

.onpage-editor-modal-box p {
  font-size: 13px;
  color: #94a3b8;
  margin: 0 0 20px 0;
}

.onpage-editor-modal-box input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 14px;
  border-radius: 8px;
  background: #050b14;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-size: 15px;
  text-align: center;
  margin-bottom: 16px;
  outline: none;
}

.onpage-editor-modal-box input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.25);
}

.onpage-editor-toast {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 10000001;
  background: #064e3b;
  border: 1px solid #10b981;
  color: #ffffff;
  padding: 12px 20px;
  border-radius: 10px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.4);
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: onpage-slide-in 0.3s ease;
}

@keyframes onpage-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes onpage-slide-in {
  from { transform: translateY(-20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
