/* Slide-in drawer that hosts the admin field-builder. Right-aligned panel
   with a translucent backdrop. The .field-drawer--open class drives both
   the backdrop fade and the panel slide via CSS transitions. */

.field-drawer {
  position: fixed;
  inset: 0;
  z-index: 1000;
  pointer-events: none;
}

.field-drawer[hidden] {
  display: none;
}

.field-drawer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 18, 23, 0.5);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.field-drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(720px, 100vw);
  background: white;
  box-shadow: -8px 0 24px rgba(15, 18, 23, 0.15);
  transform: translateX(100%);
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
  pointer-events: none;
}

.field-drawer--open {
  pointer-events: auto;
}

.field-drawer--open .field-drawer__backdrop {
  opacity: 1;
}

.field-drawer--open .field-drawer__panel {
  transform: translateX(0);
  pointer-events: auto;
}

.field-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--light-border-color, #e0e0e0);
  background: #f8f9fa;
}

.field-drawer__title {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 600;
}

.field-drawer__close {
  background: transparent;
  border: 0;
  font-size: 2.4rem;
  line-height: 1;
  width: 3.2rem;
  height: 3.2rem;
  border-radius: 50%;
  cursor: pointer;
  color: #495057;
  transition: background-color 0.15s ease;
}

.field-drawer__close:hover {
  background: rgba(15, 18, 23, 0.08);
}

.field-drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem 2rem 3rem;
}

/* Drawer-specific overrides for the field-builder partial — strip the page
   header chrome rules that show.html.erb relies on, tighten spacing. */
.field-drawer .field-form-content > .form-section {
  padding: 1.25rem 0;
  border-bottom: 1px solid #f0f0f0;
}

.field-drawer .field-form-content > .form-section:last-of-type {
  border-bottom: 0;
}

.field-drawer .form-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--light-border-color, #e0e0e0);
}

.field-drawer .form-actions .danger-zone {
  margin-left: auto;
}

body.field-drawer-locked {
  overflow: hidden;
}
