/* Colors are semantic tokens from bookwise-tokens.css, so dark mode needs no overrides. */

.upload-drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  border: 2px dashed var(--border-strong);
  border-radius: 12px;
  background-color: var(--surface-tertiary);
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.upload-drop-zone:hover {
  border-color: var(--text-tertiary);
}

.upload-drop-zone.drag-over {
  border-color: var(--interactive-default);
}

.upload-drop-zone-text {
  color: var(--text-secondary);
  font-size: 1rem;
  text-align: center;
  pointer-events: none;
}

.upload-drop-zone-icon {
  color: var(--text-tertiary);
  margin-bottom: 1rem;
}

/* Uploading state */
.upload-drop-zone.uploading {
  cursor: not-allowed;
  pointer-events: none;
  opacity: 0.8;
}

.hidden {
  display: none !important;
}

#drop-zone-default,
#drop-zone-uploading {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Spinner matches the upload icon's footprint so the state swap doesn't shift layout. */
.upload-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border-medium);
  border-top-color: var(--interactive-default);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Results */
.upload-result-row {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--component-panel-background);
  border: 1px solid var(--border-medium);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 0.875rem;
  color: var(--text-primary);
}

.upload-result-row--error {
  background: var(--feedback-error-surface);
  border-color: var(--feedback-error);
}

.upload-result-text {
  min-width: 0;
}

/* Clamp only the filename so the outcome text stays visible and can wrap. */
.upload-result-filename {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

/* Same circle-check as the shelf switcher dropdown's selected state. */
.upload-result-check {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  fill: var(--component-shelf-currently-reading);
}

.upload-result-error-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  border-radius: 999px;
  background: var(--feedback-error);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.upload-result-error-icon svg {
  width: 10px;
  height: 10px;
  stroke: var(--surface-elevated);
  stroke-width: 2.5;
  fill: none;
}
