.file-upload-wrapper {
  position: relative;
}

.drag-drop-area {
  border: 2px dashed #ccc;
  border-radius: 8px;
  padding: 40px;
  text-align: center;
  background-color: #f8f9fa;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-bottom: 10px;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.drag-drop-area:hover {
  border-color: #026937;
  background-color: #f0f8f4;
}

.drag-drop-area.drag-over {
  border-color: #FFD100;
  background-color: #fffef0;
  transform: scale(1.02);
}

.drag-drop-text {
  pointer-events: none;
}

.drag-drop-text i {
  color: #026937;
}

.drag-drop-text p {
  margin: 0;
  color: #333;
}

/* Ensure the drag-drop area is clickable */
.drag-drop-area {
  position: relative;
  z-index: 2;
  cursor: pointer;
}

/* Hide only the visible parts of the managed file widget */
.file-upload-wrapper .form-managed-file .js-hide,
.file-upload-wrapper .form-managed-file input[type="submit"] {
  display: none !important;
}

/* Keep the file input accessible but invisible */
.file-upload-wrapper .form-managed-file input[type="file"] {
  position: absolute;
  opacity: 0.01;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  pointer-events: auto;
  z-index: -1;
}

/* Ensure the managed file wrapper doesn't interfere */
.file-upload-wrapper .form-managed-file {
  position: relative;
  min-height: 0;
}

/* Handle dynamic IDs with attribute selectors */
.file-upload-wrapper [id^="edit-file-browse"] {
  position: relative;
}

/* Show the uploaded files list */
.file-upload-wrapper .file-widget,
.file-upload-wrapper [class*="file-widget"] {
  position: static !important;
  left: auto !important;
  width: auto !important;
  height: auto !important;
  overflow: visible !important;
  margin-top: 10px;
}

/* Ensure file list items are visible */
.file-upload-wrapper .form-managed-file > div {
  height: auto !important;
  overflow: visible !important;
}

/* Ensure the ajax wrapper doesn't interfere */
.file-upload-wrapper [id^="ajax-wrapper"] {
  position: static;
}

/* Fix checkbox alignment with filenames */
.file-upload-wrapper .form-type-checkbox {
  display: flex !important;
  align-items: center !important;
  margin-bottom: 0.5rem !important;
  width: 100% !important;
}

.file-upload-wrapper .form-type-checkbox input[type="checkbox"] {
  position: relative !important;
  opacity: 1 !important;
  width: auto !important;
  height: auto !important;
  margin-right: 0.5rem !important;
  margin-top: 0 !important;
  margin-left: 0 !important;
  flex-shrink: 0 !important;
  display: inline-block !important;
  float: none !important;
  clip: auto !important;
  overflow: visible !important;
}

.file-upload-wrapper .form-type-checkbox label {
  margin-bottom: 0 !important;
  margin-left: 0 !important;
  display: inline-block !important;
  width: auto !important;
  max-width: none !important;
  flex: 1 !important;
  padding-left: 0 !important;
}

/* Remove Bootstrap grid classes effects */
.file-upload-wrapper .form-type-checkbox label.ml-5 {
  margin-left: 0 !important;
}

.file-upload-wrapper .form-type-checkbox label.col-10 {
  width: auto !important;
  max-width: none !important;
  flex: 1 !important;
}

/* Remove row class from inside label */
.file-upload-wrapper .form-type-checkbox label .row {
  display: inline !important;
  margin: 0 !important;
  width: auto !important;
}

/* Ensure file links don't break layout */
.file-upload-wrapper .file {
  word-break: break-word;
  display: inline !important;
}

/* Override form-control on checkbox */
.file-upload-wrapper .form-type-checkbox input.form-control {
  width: auto !important;
  display: inline-block !important;
}

/* Target checkboxes specifically within the shed form */
#le-shed-form-shed .file-upload-wrapper .form-type-checkbox input.form-checkbox,
#le-shed-form-shed .file-upload-wrapper .form-type-checkbox input.form-control {
  width: 20px !important;
  height: 20px !important;
  min-width: 20px !important;
  max-width: 20px !important;
  display: inline-block !important;
  position: relative !important;
  margin: 0 10px 0 0 !important;
  flex-shrink: 0 !important;
  vertical-align: middle !important;
}

/* Ensure the checkbox container uses flexbox properly */
#le-shed-form-shed .file-upload-wrapper .form-type-checkbox {
  display: flex !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
  margin-bottom: 10px !important;
}

/* Fix label alignment within shed form */
#le-shed-form-shed .file-upload-wrapper .form-type-checkbox label {
  display: inline-flex !important;
  align-items: center !important;
  margin: 0 !important;
  padding-left: 0 !important;
  flex: 1 !important;
  width: auto !important;
  max-width: calc(100% - 30px) !important;
}

/* Remove any Bootstrap column classes on labels */
#le-shed-form-shed .file-upload-wrapper .form-type-checkbox label.col-10,
#le-shed-form-shed .file-upload-wrapper .form-type-checkbox label.ml-5 {
  width: auto !important;
  max-width: calc(100% - 30px) !important;
  margin-left: 0 !important;
  flex: 1 !important;
}

/* Mobile responsive adjustments */
@media (max-width: 576px) {
  #le-shed-form-shed .file-upload-wrapper .form-type-checkbox {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }
  
  #le-shed-form-shed .file-upload-wrapper .form-type-checkbox label {
    font-size: 14px !important;
  }
}
