@import url("theme-vars.css");

body {
  background: var(--vsc-bg);
  color: var(--vsc-fg);
}

/* Dropzone and file preview shared styles */

.link {
    color: var(--vsc-link);
    text-decoration: none;
}

.dropzone-area {
  border: 2px dashed var(--vsc-border);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  position: relative;
  border-radius: 10px;
  transition: border-color 0.3s;
  background: var(--vsc-surface);
}
.dropzone-area:hover {
  border-color: var(--vsc-accent);
}
.dropzone-area.drag-over {
  border-color: var(--vsc-accent);
  background-color: var(--vsc-surface-alt);
}
.global-drag-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: var(--vsc-accent);
  opacity: 0.1;
  z-index: 9999;
  pointer-events: none;
  transition: background 0.2s;
}
.hidden-input {
  display: none;
}
.upload-preview-item {
  border: 1px solid var(--vsc-border-light);
  padding: 8px;
  border-radius: 4px;
  background-color: var(--vsc-surface-alt);
  box-sizing: border-box;
  transition: box-shadow 0.2s;
}
.upload-preview-item.dragging {
  opacity: 0.2;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  z-index: 10;
}
.upload-preview-item .drag-handle {
  cursor: grab;
  width: 24px;
  height: 24px;
  margin-right: 8px;
  user-select: none;
  opacity: 0.7;
  vertical-align: middle;
}
.upload-preview-item.drag-over {
  background: #f0f4fa;
}
.upload-preview-item.drag-placeholder {
  background: var(--vsc-surface-alt, #f0f4fa);
  border: 2px dashed var(--vsc-accent, #0078d4);
  min-height: 40px;
  opacity: 0.7;
}
.upload-preview-item .remove-button {
  border: none;
  cursor: pointer;
  width: 24px;
  height: 24px;
  margin: auto 0;
}
.upload-preview-item .remove-container.mobile {
  display: none;
}
.upload-preview-item .remove-container {
  display: block;
  margin-left: auto;
}
.upload-preview-item .content-section, .upload-preview-item .content-section-manage {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
}
.upload-preview-item .content-container {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
}
.upload-preview-item .file-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.upload-preview-item .file-info .file-info-inner {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.upload-preview-item .file-info .file-name {
  font-weight: bold;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  display: block;
  word-break: break-all;
  min-width: 0;
}
.upload-preview-item .file-info .file-number {
  font-size: 1rem;
  font-weight: bold;
}
.upload-preview-item .file-preview {
  max-height: 55px;
  max-width: 150px;
  border-radius: 4px;
  object-fit: cover;
  margin-right: 6px;
}
.upload-preview-item .file-stats {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.file-disabled {
  opacity: 0.5;
  pointer-events: none;
  filter: grayscale(0.5);
  transition: opacity 0.3s;
  background: var(--vsc-muted-bg);
  color: var(--vsc-muted-fg);
}
.file-action-btn.disabled,
.file-action-btn[disabled] {
  pointer-events: none;
  opacity: 0.7;
  background: var(--vsc-surface-alt);
  color: var(--vsc-muted-fg);
  cursor: not-allowed;
}
.file-error {
  background-color: var(--vsc-error-bg);
}
.error-reason {
  color: var(--vsc-error);
  font-weight: bold;
}
.file-last-updated {
  color: var(--vsc-fg-muted);
}
.dropzone-error-list {
  display: none;
  flex-direction: column;
  gap: 6px;
  background-color: var(--vsc-error-bg);
  color: var(--vsc-error);
  padding: 10px;
  margin: 10px 0;
  border-radius: 5px;
}
.error-list-item {
  margin-top: 4px;
  margin-bottom: 4px;
}
.content-container {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 auto;
    min-width: 0;
}
@media (max-width: 767px) {
  .upload-preview-item {
    border: 1px solid var(--vsc-border-med);
  }
  .upload-preview-item .content-section {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }
  .upload-preview-item .content-section-manage {
    flex-direction: column;
    align-items: start;
    justify-content: space-between;
    width: 100%;
  }
  .upload-preview-item .content-container {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    margin-top: 4px;
  }
  .upload-preview-item .file-preview {
    max-height: 70px;
    max-width: 300px;
  }
  .upload-preview-item .file-preview.generic-file-icon {
    display: none;
  }
  .upload-preview-item .file-width-wrapper:has(.generic-file-icon) {
    display: none;
  }
  .upload-preview-item .remove-container.mobile {
    display: none;
  }
  .upload-preview-item .remove-container {
    display: block;
    margin-left: auto;
  }
  .upload-preview-item .file-info .file-name {
    max-width: 87vw;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    word-break: break-all;
    min-width: 0;
  }
}
.file-manage-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
@media (max-width: 767px) {
  .file-manage-row {
    width: 100%;
  }
}

/* Drop indicator for drag-and-drop reordering */
.drop-indicator {
  height: 8px;
  display: block;
  background: transparent;
  border: none;
  margin: 0 0 2px 0;
  transition: background 0.15s, border 0.15s;
  cursor: pointer;
  box-sizing: border-box;
}
.drop-indicator.active-drop {
  background: #0078d477;
  border-radius: 4px;
  height: 8px;
}
@media (max-width: 767px) {
  .drop-indicator, .drop-indicator.active-drop {
    height: 14px;
  }
}
.content-section.dragging {
opacity: 0.5;
}
.drag-handle {
cursor: grab;
margin-right: 8px;
width: 20px;
height: 20px;
vertical-align: middle;
user-select: none;
}
@media (min-width: 768px) {
  .file-width-wrapper {
      min-width: 100px;
      align-items: center;
      justify-content: center;
      display: flex;
  }
}
#add-file-btn.drag-over {
  outline: 2px solid var(--vsc-border);
  background: var(--vsc-accent); 
}