/* Drag and Drop Upload Styles */
.drag-drop-area {
  border: 2px dashed #ddd;
  border-radius: 8px;
  padding: 40px 20px;
  text-align: center;
  background-color: #fafafa;
  transition: all 0.3s ease;
  cursor: pointer;
  margin-bottom: 20px;
}

.drag-drop-area:hover,
.drag-drop-area.drag-over {
  border-color: #007bff;
  background-color: #f0f8ff;
}

.drag-drop-content {
  color: #666;
}

.drag-drop-content i {
  font-size: 48px;
  color: #ddd;
  margin-bottom: 15px;
  display: block;
}

.drag-drop-content p {
  margin: 0;
  font-size: 16px;
}

.browse-link {
  color: #007bff;
  text-decoration: underline;
  cursor: pointer;
}

.browse-link:hover {
  color: #0056b3;
}

/* Attachments Container */
.attachments-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

/* Attachment Field */
.attachment-field {
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 15px;
  background-color: #fff;
  transition: box-shadow 0.3s ease;
}

.attachment-field:hover {
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Image Preview */
.attachment-preview {
  margin-bottom: 15px;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f8f9fa;
  border-radius: 4px;
  overflow: hidden;
}

.image-preview {
  width: 100%;
  text-align: center;
}

.preview-image {
  max-width: 100%;
  max-height: 150px;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.file-info {
  margin-top: 10px;
  padding: 8px;
  background-color: rgba(0,0,0,0.05);
  border-radius: 4px;
}

.file-name {
  display: block;
  font-weight: 500;
  color: #333;
  font-size: 14px;
  margin-bottom: 4px;
  word-break: break-word;
}

.file-size {
  font-size: 12px;
  color: #666;
}

/* File Input Wrapper */
.file-input-wrapper {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.file-input {
  display: none;
}

.file-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.3s ease;
  text-decoration: none;
}

.file-label:hover {
  background-color: #0056b3;
  color: white;
}

.file-label i {
  font-size: 14px;
}

/* Remove Button */
.remove-attachment {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background-color: #dc3545;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: background-color 0.3s ease;
}

.remove-attachment:hover {
  background-color: #c82333;
}

/* Destroy Checkbox for Existing Attachments */
.destroy-checkbox {
  margin-right: 8px;
}

.destroy-label {
  color: #dc3545;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Add More Button */
#add-attachment {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: 2px dashed #007bff;
  background-color: transparent;
  color: #007bff;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 14px;
}

#add-attachment:hover {
  background-color: #007bff;
  color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
  .attachments-container {
    grid-template-columns: 1fr;
  }
  
  .drag-drop-area {
    padding: 30px 15px;
  }
  
  .drag-drop-content i {
    font-size: 36px;
  }
  
  .file-input-wrapper {
    flex-direction: column;
    align-items: stretch;
  }
}

/* Loading States */
.attachment-field.uploading {
  opacity: 0.7;
  pointer-events: none;
}

.attachment-field.uploading::after {
  content: "Uploading...";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(0,0,0,0.8);
  color: white;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 14px;
}
