/* --------------------------------------------------------------------------
   RyanDev — Visual In-Context Editor & Floating Admin Bar Styles
   -------------------------------------------------------------------------- */

.ryandev-admin-floating-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  min-height: 52px;
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(59, 130, 246, 0.35);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 20px;
  font-family: var(--font-sans, system-ui, -apple-system, sans-serif);
  color: #ffffff;
  animation: slideDownBar 0.3s ease;
}

@keyframes slideDownBar {
  from { transform: translateY(-100%); }
  to { transform: translateY(0); }
}

body.admin-bar-visible {
  padding-top: 110px !important;
}

@media (min-width: 900px) {
  body.admin-bar-visible {
    padding-top: 52px !important;
  }
}

.admin-bar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.admin-badge-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: #60a5fa;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.admin-bar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-bar-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.825rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  text-decoration: none;
}

.admin-bar-btn-edit {
  background: #2563eb;
  color: #ffffff;
  border-color: #3b82f6;
}

.admin-bar-btn-edit:hover {
  background: #1d4ed8;
  box-shadow: 0 0 12px rgba(37, 99, 235, 0.5);
}

.admin-bar-btn-edit.active {
  background: #059669;
  border-color: #10b981;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.5);
}

.admin-bar-btn-save {
  background: #10b981;
  color: #ffffff;
  border-color: #34d399;
}

.admin-bar-btn-save:hover {
  background: #059669;
}

.admin-bar-btn-outline {
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  border-color: rgba(255, 255, 255, 0.2);
}

.admin-bar-btn-outline:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

/* Éléments en Mode Édition Visuelle */
body.visual-edit-mode [data-editable="true"] {
  outline: 2px dashed rgba(59, 130, 246, 0.45);
  outline-offset: 4px;
  cursor: text !important;
  border-radius: 4px;
  transition: outline-color 0.2s ease, background-color 0.2s ease;
}

body.visual-edit-mode [data-editable="true"]:hover {
  outline: 2px dashed #3b82f6;
  background-color: rgba(59, 130, 246, 0.08);
}

body.visual-edit-mode [data-editable="true"]:focus {
  outline: 2px solid #60a5fa;
  background-color: rgba(59, 130, 246, 0.12);
}

/* Wrapper pour images éditables */
.editable-image-wrapper {
  position: relative;
  display: inline-block;
  cursor: pointer;
}

.editable-image-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.75);
  border-radius: inherit;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 700;
  z-index: 10;
}

body.visual-edit-mode .editable-image-wrapper:hover .editable-image-overlay {
  display: flex;
}

.editable-image-overlay span {
  background: #2563eb;
  padding: 4px 10px;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* Toast de notification */
.visual-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #0f172a;
  color: #ffffff;
  border: 1px solid #10b981;
  padding: 14px 22px;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  z-index: 999999;
  animation: popIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes popIn {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Badges Crayons ✏️ en direct sur les vraies pages */
body.visual-edit-mode [data-editable="true"] {
  position: relative;
  outline: 2px dashed #3b82f6 !important;
  outline-offset: 4px;
  cursor: text !important;
  border-radius: 6px;
  transition: all 0.2s ease;
}

body.visual-edit-mode [data-editable="true"]::after {
  content: '✏️';
  position: absolute;
  top: -12px;
  right: -12px;
  background: #2563eb;
  color: #ffffff;
  font-size: 11px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.5);
  pointer-events: none;
  z-index: 99;
}
