:root {
  --upload-panel-height: 0px;
}

body.dragging {
  background: linear-gradient(135deg, rgba(13, 110, 253, 0.08), rgba(13, 202, 240, 0.12));
}

.navbar .container-fluid {
  flex-wrap: wrap;
  gap: 0.75rem;
}

.navbar .container-fluid > .d-flex {
  flex-wrap: wrap;
  gap: 0.5rem;
}

.toolbar .form-select {
  min-width: 180px;
}

.toolbar .search-input {
  min-width: 220px;
}

.table tbody tr {
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.table tbody tr.table-folder-row {
  background-color: rgba(255, 193, 7, 0.12);
}

.table tbody tr.table-folder-row:hover {
  background-color: rgba(255, 193, 7, 0.22);
}

.table tbody tr.table-folder-row .column-name {
  font-weight: 600;
}

.table tbody tr.drag-origin {
  opacity: 0.7;
}

.selection-column {
  width: 3rem;
}

.selection-column .form-check-input {
  cursor: pointer;
}

.drop-target {
  outline: 2px dashed var(--bs-primary);
  outline-offset: -4px;
}

.breadcrumb .drop-target {
  text-decoration: underline;
  text-decoration-thickness: 0.2rem;
}

.context-menu {
  position: absolute;
  z-index: 1055;
  display: none;
  min-width: 200px;
}

.context-menu .list-group-item {
  cursor: pointer;
}

.context-menu .list-group-item:hover,
.context-menu .list-group-item:focus {
  background-color: rgba(13, 110, 253, 0.12);
}

.context-menu .list-group-item.disabled {
  color: var(--bs-secondary-color);
  cursor: not-allowed;
}

.progress-bar {
  transition: width 0.3s ease;
}

.table-responsive.table-scrollable {
  --table-row-height: 3.5rem;
}

.table-responsive.table-scrollable table {
  margin-bottom: 0;
}

.table-responsive.table-scrollable thead,
.table-responsive.table-scrollable tbody tr {
  display: table;
  width: 100%;
  table-layout: fixed;
}

.table-responsive.table-scrollable thead {
  position: sticky;
  top: 0;
  z-index: 1;
}

.table-responsive.table-scrollable thead th {
  background-color: var(--bs-table-bg);
}

.table-responsive.table-scrollable tbody {
  display: block;
  max-height: calc(var(--table-row-height) * 10);
  overflow-y: auto;
}

.table-responsive.table-scrollable tbody tr {
  height: var(--table-row-height);
}

.table-responsive.table-scrollable tbody td {
  vertical-align: middle;
}

.upload-notifications {
  bottom: 1rem;
  width: min(320px, 90vw);
  z-index: 1090;
}

.upload-panel {
  --upload-item-height: 4.5rem;
}

.upload-panel .card-header {
  background-color: var(--bs-body-bg);
}

.upload-panel .upload-list {
  margin-bottom: 0;
}

.upload-panel .upload-list.upload-list-scroll {
  max-height: calc(var(--upload-item-height) * 3);
  overflow-y: auto;
}

.upload-panel .upload-list .list-group-item {
  padding: 0.75rem 1rem;
}

.upload-panel .upload-name {
  max-width: 180px;
}

.upload-batch-list {
  max-height: 240px;
  overflow-y: auto;
}

.upload-batch-list .list-group-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.upload-batch-list .text-truncate {
  min-width: 0;
}

.toast-container {
  bottom: 1rem;
  z-index: 1080;
}

body.has-active-uploads #toastContainer {
  bottom: calc(1rem + var(--upload-panel-height));
}

.file-preview {
  min-height: 240px;
  background-color: rgba(248, 249, 250, 0.6);
  overflow: hidden;
  position: relative;
}

.file-preview img,
.file-preview video,
.file-preview iframe,
.file-preview audio {
  width: 100%;
  max-height: 60vh;
  object-fit: contain;
}

.file-preview video {
  background-color: #000;
}

.file-preview pre {
  width: 100%;
  max-height: 50vh;
  overflow: auto;
  margin-bottom: 0;
  white-space: pre-wrap;
  font-family: var(--bs-font-monospace);
  padding: 1rem;
  background-color: rgba(0, 0, 0, 0.03);
}

.file-preview .preview-placeholder {
  text-align: center;
  width: 100%;
}

@media (max-width: 991.98px) {
  .toolbar .form-select {
    min-width: 140px;
  }

  .toolbar .search-input {
    min-width: 180px;
  }
}

@media (max-width: 767.98px) {
  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar > * {
    width: 100%;
  }

  .toolbar .btn,
  .toolbar label,
  .toolbar .btn-group {
    width: 100%;
  }

  .toolbar .ms-auto {
    width: 100%;
    margin-left: 0 !important;
  }

  .toolbar .input-group,
  .toolbar .form-select {
    width: 100%;
    min-width: 0;
  }

  .table-responsive.table-scrollable tbody {
    max-height: none;
  }

  .upload-notifications {
    width: min(360px, 94vw);
  }
}

@media (max-width: 575.98px) {
  .navbar .container-fluid {
    justify-content: center;
  }

  .navbar .navbar-brand {
    margin-right: 0;
  }

  .selection-column {
    width: 2.75rem;
  }

  .column-size,
  .column-modified {
    display: none;
  }

  .column-actions .btn-group {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
  }

  .column-actions .btn {
    flex: 1 1 auto;
  }
}
