/* EditorJS FileCollection tool UI */

.file_collection_wrapper {
  border: 1px solid #e6e6e6;
  border-radius: 10px;
  background: #fff;
  padding: 14px;
}

.file_collection_selector {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.file_collection_header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.file_collection_label {
  display: block;
  font-weight: 700;
  font-size: 14px;
  color: #222;
  margin: 0;
}

.file_collection_help {
  margin: 2px 0 0;
  font-size: 12px;
  line-height: 1.3;
  color: #666;
}

.file_collection_actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.file_collection_load_btn {
  white-space: nowrap;
}

.file_collection_load_btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

.file_collection_selected_container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px;
  border: 1px solid #eee;
  border-radius: 10px;
  background: #fafafa;
  min-height: 44px;
}

.file_collection_selected_empty {
  font-size: 12px;
  color: #888;
  padding: 4px 2px;
}

.file_collection_tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 7px 10px;
  border: 1px solid #e4e4e4;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 0 rgba(0,0,0,0.03);
  cursor: grab;
  transition: box-shadow 0.15s, opacity 0.15s, border-color 0.15s;
}

.file_collection_tag:active {
  cursor: grabbing;
}

.file_collection_tag--dragging {
  opacity: 0.35;
  box-shadow: none;
}

.file_collection_tag--drag-over-left {
  border-left: 3px solid #4a9eff;
}

.file_collection_tag--drag-over-right {
  border-right: 3px solid #4a9eff;
}

.file_collection_tag_handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  color: #aaa;
  font-size: 13px;
  line-height: 1;
  cursor: grab;
  user-select: none;
  flex: 0 0 auto;
}

.file_collection_tag_handle:active {
  cursor: grabbing;
}

.file_collection_tag_name {
  display: inline-block;
  font-size: 12px;
  color: #222;
  max-width: 520px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file_collection_tag_remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  color: #666;
  background: #f2f2f2;
  cursor: pointer;
  user-select: none;
  font-size: 14px;
  line-height: 1;
}

.file_collection_tag_remove:hover {
  background: #e9e9e9;
  color: #333;
}

.file_collection_search_wrapper {
  position: relative;
}

.file_collection_search_input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid #d9d9d9;
  border-radius: 10px;
  font-size: 13px;
  outline: none;
}

.file_collection_search_input:focus {
  border-color: #b7b7b7;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.12);
}

.file_collection_dropdown {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 50;
  display: none;
  max-height: 240px;
  overflow: auto;
  background: #fff;
  border: 1px solid #e1e1e1;
  border-radius: 10px;
  box-shadow: 0 14px 30px rgba(0,0,0,0.12);
}

.file_collection_option {
  padding: 10px 12px;
  font-size: 13px;
  cursor: pointer;
  border-bottom: 1px solid #f3f3f3;
}

.file_collection_option:last-child {
  border-bottom: none;
}

.file_collection_option:hover {
  background: #f7f7f7;
}

.file_collection_option.no_results {
  color: #777;
  cursor: default;
}

.file_collection_status {
  font-size: 12px;
  color: #666;
}

.file_collection_status--error {
  color: #b42318;
}

/* Preview */

.file_collection_preview {
  margin-top: 12px;
  border-top: 1px solid #eee;
  padding-top: 12px;
}

.file_collection_preview_header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.file_collection_preview_title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: #222;
}

.file_collection_toggle_mode {
  white-space: nowrap;
}

.file_collection_files {
  display: grid;
  gap: 8px;
}

.file_collection_files--list {
  grid-template-columns: 1fr;
}

.file_collection_files--grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 560px) {
  .file_collection_files--grid {
    grid-template-columns: 1fr;
  }
}

.file_collection_file_item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid #eee;
  border-radius: 10px;
  background: #fff;
}

.file_collection_file_icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 36px;
  border-radius: 10px;
  background: #f4f6f8;
  border: 1px solid #e7eaee;
  color: #445;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  flex: 0 0 auto;
}

.file_collection_file_info {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.file_collection_file_name {
  font-size: 13px;
  color: #222;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file_collection_file_size {
  font-size: 12px;
  color: #666;
}
