/*
    Created on : Apr 7, 2020, 9:52:01 AM
    Author     : teja
*/

/** GCODE file manager */

:is(#files, #prepared_jobs_library) .gcode_files {
  padding-right: 7px;
}
:is(#files, #prepared_jobs_library) .gcode_files .entry {
  padding: 12px;
  line-height: 20px;
  border-bottom: 0;
  position: relative;
  width: 25%;
  float: left;
  box-sizing: border-box;
}

@media only screen and (max-width: 1200px) {
  :is(#files, #prepared_jobs_library) .gcode_files .entry {
    width: 33%;
  }
}

@media only screen and (max-width: 979px) {
  :is(#files, #prepared_jobs_library) .gcode_files .entry {
    width: 50%;
  }
}

@media only screen and (max-width: 767px) {
  :is(#files, #prepared_jobs_library) .gcode_files .entry {
    width: 100%;
  }
}

:is(#files, #prepared_jobs_library) .gcode_files .entry:hover {
  background-color: transparent;
  transform: scale(1.018);
  transition: transform 0.3s ease;
}
:is(#files, #prepared_jobs_library) .gcode_files .entry .title {
  text-overflow: ellipsis;
  word-break: break-all;
  margin-right: 0;
}

#files .upload-buttons {
  margin-top: 10px;
}
#files .form-search {
  text-align: center;
  margin-bottom: 5px !important;
}

:is(#files, #prepared_jobs_library) .file_list_entry .title {
  padding: 0.8em 0.8em 0.2em;
  white-space: nowrap;
  border-top: 1px dotted lightgray;
}

.title_shortened {
  width: calc(100% - 1.2em);
  overflow: hidden;
  display: inline-block;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Selection of multiple items in the design library */

#files .file_list_entry .selection_box {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 30px;
  width: 30px;
  height: 30px;
  background-color: white;
  /*border: 2px solid #383e42;*/
  border: 1.5px solid #e25303;
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.2s ease-in;
  z-index: 999;
}

#files .file_list_entry:hover .selection_box,
#files .file_list_entry .selection_box.selected {
  opacity: 1;
}

#files .selection_box i {
  display: none;
}
#files .selection_box.selected i {
  display: inline;
}

#bulkActions {
  border-bottom: 1px solid #e25303;
  /*padding: 2em;*/
  /*border-radius: 3px;*/
    display: flex;
    flex-direction: column;
    gap: 1em; /* Space between description line and button line */
    width: 100%;
    padding: 0 0 1em;
    box-sizing: border-box;
}

#bulkActions .description {
  text-align: center;
  margin-bottom: 1em;
}
#bulkActions .description_head {
  font-size: 1.5em;
  margin-bottom: 0.5em;
}
.description_details {
  color: #999;
}

#bulkActionsDeleteBtn, #bulkActionsUnselectBtn {
    width: fit-content;
    min-width: 20%;
}

#bulkActions .controls-row {
    display: flex;
    justify-content: flex-start; /* Pins Unselect to left, Actions to right */
    align-items: center;
}

/* Grouping Move and Delete together */
#bulkActions .action_btns {
    display: flex;
    gap: .5em;
    margin-left: auto;
    flex-direction: row;
    flex-wrap: nowrap;
    /* align-content: center; */
    justify-content: flex-end;
}

#bulkActions #move_to_folder_dropdown li button {
    text-align: left;
    color: #383e42;
    margin-left: .5em;
}

#bulkActions #move_to_folder_dropdown li button:active,
#bulkActions #move_to_folder_dropdown li button:hover {
    box-shadow: none;
    text-decoration: none;
    border-color: transparent;
}


#bulkActions #move_to_folder_dropdown li button i.fa.fa-arrow-left,
#bulkActions #move_to_folder_dropdown li button i.fa.fa-arrow-right {
    opacity: 0.2;
    transition: opacity 0.2s ease-in;
}
#bulkActions #move_to_folder_dropdown li button:hover i.fa.fa-arrow-left,
#bulkActions #move_to_folder_dropdown li button:hover i.fa.fa-arrow-right {
    opacity: 1;
}

/* End Selection of multiple items in the design library */

#files .file_list_entry li.size,
#files .file_list_entry li.uploaded {
  font-size: x-small;
  color: #383e42;
  padding: 0px 20px;
}

.file_list_icon {
  color: #999;
  font-size: 3em;
  display: block;
  float: left;
  margin-right: 12px;
  min-width: 1.1em;
}

.file_list_entry_gcode {
  color: #ccc;
}

/* file tab preview cards */
.file_list_entry.icon_card,
.file_list_entry.preview_card {
  position: relative;
  width: 100%;
  box-shadow: rgba(0, 0, 0, 0.3) 0 0 9px 0;
}

#files .preview_card div.preview,
#files .icon_card div.preview {
  padding-top: 80%;
  width: 100%;
  cursor: pointer;
}

#files .preview_card div.preview {
  background-position: center;
  background-size: contain;
  background-repeat: no-repeat;
}

#files .icon_card div.preview > i {
  text-align: center;
  font-size: 6rem;
  color: #999;
  height: 0;
  position: absolute;
  top: calc(50% - 6rem / 2);
  left: 0;
  width: 100%;
}

#files .preview.disabled {
  opacity: 0.2;
}

#designlib #files .entry.model,
#designlib #files .entry.recentjob,
#designlib #files .entry.machinecode {
  display: none;
}
#designlib.show_design #files .entry.model,
#designlib.show_recentjob #files .entry.recentjob,
#designlib.show_machinecode #files .entry.machinecode {
  display: block;
}

#designlib #files_filter li.filter.design a i,
#designlib #files_filter li.filter.machinecode a i,
#designlib #files_filter li.filter.recentjob a i {
  visibility: hidden;
}

#designlib.show_design #files_filter li.filter.design a i,
#designlib.show_machinecode #files_filter li.filter.machinecode a i,
#designlib.show_recentjob #files_filter li.filter.recentjob a i {
  visibility: visible;
}

#files .preview_card div.preview,
#files .icon_card div.preview {
  padding-top: 80%; /* this is specifying the height */
  height: 0;
  width: 100%;
  cursor: pointer;
}
#files .preview_card div.preview {
  background-image: url(../img/designlib_preview_dummy.svg);
}

#files .preview_card div.preview > img.lazy_loader {
  height: 0;
  margin-top: -90%; /* triggers loading 10% earlier than scroll in */
}

#files .file_list_entry.folder {
  background-image: url(../img/folder.svg);
  background-repeat: no-repeat;
  background-size: contain;
  background-position: 50% 100%;
  margin: 0 1.5em;
  position: relative;
}
#files .file_list_entry.folder .preview {
  padding-top: 55%;
}

#files .file_list_entry.folder .title,
#files .file_list_entry.folder .title a.dropdown-toggle {
  color: #fff;
}

#files .folder_navigation {
  padding: 0em 3em 0em 2em;
  /* border-bottom: lightgray 1px dotted; */
  box-shadow: #999 0px 10px 15px -15px;
}

#files .folder_navigation > * {
  padding: 0.5em 0 1em;
}

/* drop up menus */
:is(#files, #prepared_jobs_library) .file_list_entry ul.dropdown-menu {
  z-index: 1000;
}

@keyframes highlightframes {
  0% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(-3deg);
  }
  50% {
    transform: rotate(0deg);
  }
  75% {
    transform: rotate(3deg);
  }
  100% {
    transform: rotate(0deg);
  }
}
:is(#files, #prepared_jobs_library) .gcode_files .entry.highlight {
  animation: highlightframes 0.2s 4 ease-in-out normal;
}

/* Hack to hide our own special folders. Collateral damage: user can't create folders with those names' */
#designlib #files .entry.folder[mrb_name="cam"],
#designlib #files .entry.folder[mrb_name="local"] {
  display: none;
}

#designlib #onlyFoldersList.design_drag_in_progress .file_list_entry.folder {
    border: 1px solid red;
}
