/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* SortableJS Drag and Drop Styles */

/* The ghost element - placeholder showing where item will be dropped */
.sortable-ghost {
  opacity: 0.5;
  border: 2px dashed #3B82F6 !important;
  background-color: rgba(59, 130, 246, 0.1) !important;
}

/* The element being dragged - add tilt effect and shadow */
.sortable-drag {
  transform: rotate(3deg);
  opacity: 1;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  cursor: grabbing !important;
}

/* The element when first picked up */
.sortable-chosen {
  cursor: grabbing !important;
}

/* Make items in sortable containers look draggable */
[data-controller="sortable"] > * {
  cursor: grab;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

[data-controller="sortable"] > *:active {
  cursor: grabbing;
}

/* Collapse field details during drag for easier reordering */
/* Hide details for the item being dragged */
.sortable-ghost .field-details,
.sortable-drag .field-details,
.sortable-chosen .field-details {
  display: none !important;
}

/* Hide details for ALL items when any drag is in progress */
.is-dragging .field-details {
  display: none !important;
}

/* Collapse category group details during drag for easier reordering */
/* Hide details for the group being dragged */
.sortable-ghost .group-details,
.sortable-drag .group-details,
.sortable-chosen .group-details {
  display: none !important;
}

/* Hide details for ALL groups when any drag is in progress */
.is-dragging .group-details {
  display: none !important;
}

/* Ensure the header remains visible and compact during drag */
.sortable-drag,
.sortable-ghost {
  min-height: auto !important;
  height: auto !important;
}

/* Style the drag handle for form fields specifically */
.nested-form-wrapper .drag-handle {
  cursor: grab;
  opacity: 0.3;
  transition: opacity 0.2s ease;
}

.nested-form-wrapper .drag-handle:hover {
  opacity: 1;
}
