.hidden {
  display: none;
}
.attachment-upload {
  text-align: center;
  font-weight: bold;
}
.attachment-gallery {
  display: flex;
  flex-direction: column;
}
.attachment-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  margin-top: 16px;
}
.attachment-item:hover {
  background: #e0e0e0;
}
.attachment-thumbnail-container {
  display: block;
  width: 150px;
  min-width: 150px;
  max-height: 150px;
  padding-right: 16px;
}
.attachment-thumbnail {
  max-width: 150px;
  max-height: 150px;
  min-height: 2em;
  cursor: pointer;
}
.attachment-thumbnail-text {
  min-height: 2em;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2em;
  cursor: pointer;
  border: 1px solid #ccc;
  border-radius: 5px;
}
.attachment-details-container {
  display: block;
  flex-grow: 1;
}
.attachment-details {
  display: flex;
  justify-content: space-between;
  margin-right: 25px; /* Make sure the icons are not to far to the right */
}
.attachment-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
}
.add-attachment {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed #555;
  border-radius: 5px;
  padding: 10px;
  cursor: pointer;
  margin-top: 16px;
}
.icon {
  font-size: 1.5em;
  cursor: pointer;
  margin-left: 10px;
}
.icon:hover {
  color: #666;
}
#viewer-overlay {
  width: 100%;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999 !important;
  background: rgba(13, 13, 13, 0.95);
}
#viewer-container {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  height: 100%;
}
#viewer-top-bar {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  width: 100%;
  padding: 16px;
}
#attachment-name {
  color: white;
  font-size: 1.5em;
  max-width: calc(
    100% - 50px
  ); /* Make sure the name does not overlap the close button */
}
#viewer-close {
  color: white;
  cursor: pointer;
  font-size: 4em;
  top: 0;
  right: 8px;
  position: absolute;
}
.attachment-arrow {
  font-size: 4em;
  color: white;
  cursor: pointer;
  align-self: center;
  margin: 0 20px;
}
#viewer-content {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: calc(100% - 50px);
}
#image-viewer {
  background: repeating-conic-gradient(#808080 0% 25%, transparent 0% 50%) 50% /
    20px 20px; /* Checkerboard background for transparent images */
  max-width: 100%;
  max-height: 100%;
}
#pdf-viewer {
  width: 40vw;
  height: 100%;
}
#txt-viewer {
  background-color: white;
  width: 40vw;
  height: 100%;
}
.pdf-preview-error {
  margin-top: 20vh;
  display: block;
  font-size: 2em;
  color: white;
}

@media screen and (max-width: 1600px) {
  #pdf-viewer {
    width: 60vw;
  }
}

@media screen and (max-width: 800px) {
  #viewer-container {
    display: block;
  }
  .attachment-arrow {
    position: absolute;
    bottom: 2.2em;
    font-size: 1.6em;
    padding: 16px;
  }
  #prev-attachment {
    left: 0;
  }
  #next-attachment {
    right: 0;
  }
  #pdf-viewer {
    width: 100%;
    height: calc(
      100vh - 155px
    ); /* Full height - height of top and bottom bars */
  }
  #txt-viewer {
    width: 100%;
    height: calc(
      100vh - 155px
    ); /* Full height - height of top and bottom bars */
  }
  #audio-viewer {
    margin-top: 20%;
    width: 100%;
  }
  .attachment-thumbnail-container {
    width: 100px;
    min-width: 100px;
  }
  .attachment-thumbnail {
    max-width: 100px;
  }
  .attachment-details {
    flex-direction: column;
    margin-right: 0px;
  }
  .attachment-actions {
    flex-direction: row;
    margin-top: 10px;
  }
}
