/* Upload & Ingest Page Styles
   Copyright (c) 2026 Evident Technologies LLC
*/

/* ── Upload Zone ───────────────────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed oklch(80% 0.03 250deg);
  border-radius: 0.75rem;
  background: oklch(100% 0 0deg);
  padding: 4rem 2rem;
  text-align: center;
  transition:
    border-color 200ms ease,
    background 200ms ease;
  cursor: pointer;
}

.upload-zone:hover,
.upload-zone--drag-over {
  border-color: oklch(60% 0.15 250deg);
  background: oklch(98% 0.01 250deg);
}

.upload-zone--uploading {
  border-color: oklch(60% 0.15 250deg);
  cursor: default;
}

.upload-zone__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.upload-zone__icon {
  color: oklch(60% 0.03 250deg);
  transition: color 0.2s ease;
}

.upload-zone:hover .upload-zone__icon {
  color: oklch(60% 0.15 250deg);
}

.upload-zone__title {
  font-size: 1.5rem;
  font-weight: 700;
  color: oklch(30% 0.02 250deg);
  margin: 0;
}

.upload-zone__description {
  font-size: 1rem;
  color: oklch(50% 0.03 250deg);
  margin: 0;
  max-width: 480px;
  line-height: 1.6;
}

.upload-zone__actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

.upload-zone__max-size {
  font-size: 0.875rem;
  color: oklch(60% 0.03 250deg);
}

/* ── File Queue ────────────────────────────────────────────────────────── */
.file-queue {
  margin-top: 2rem;
  background: oklch(100% 0 0deg);
  border: 1px solid oklch(90% 0.02 250deg);
  border-radius: 0.75rem;
  padding: 1.5rem;
}

.file-queue__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.file-queue__title {
  font-size: 1.125rem;
  font-weight: 700;
  color: oklch(30% 0.02 250deg);
  margin: 0;
}

.file-queue__actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.file-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 1.5rem;
  padding: 0 0.5rem;
  background: oklch(60% 0.15 250deg);
  color: oklch(100% 0 0deg);
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 9999px;
  margin-left: 0.5rem;
}

.file-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.file-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: oklch(97% 0.01 250deg);
  border-radius: 0.5rem;
  border: 1px solid oklch(90% 0.02 250deg);
}

.file-item__icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: oklch(100% 0 0deg);
  border-radius: 0.375rem;
  color: oklch(60% 0.03 250deg);
}

.file-item__info {
  flex: 1;
  min-width: 0;
}

.file-item__name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: oklch(30% 0.02 250deg);
  margin: 0 0 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-item__meta {
  font-size: 0.875rem;
  color: oklch(60% 0.03 250deg);
  margin: 0;
}

.file-item__remove {
  width: 32px;
  height: 32px;
  border-radius: 0.375rem;
  border: 1px solid oklch(80% 0.03 250deg);
  background: oklch(100% 0 0deg);
  display: grid;
  place-items: center;
  cursor: pointer;
  color: oklch(50% 0.03 250deg);
  transition:
    background 150ms ease,
    border-color 150ms ease,
    color 150ms ease;
}

.file-item__remove:hover {
  background: oklch(97% 0.01 250deg);
  border-color: oklch(60% 0.1 250deg);
  color: oklch(40% 0.05 250deg);
}

/* ── Upload Progress ───────────────────────────────────────────────────── */
.upload-progress {
  margin-top: 2rem;
  background: oklch(100% 0 0deg);
  border: 1px solid oklch(90% 0.02 250deg);
  border-radius: 0.75rem;
  padding: 1.5rem;
}

.upload-progress__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.upload-progress__title {
  font-size: 1.125rem;
  font-weight: 700;
  color: oklch(30% 0.02 250deg);
  margin: 0;
}

.upload-progress__stats {
  display: flex;
  gap: 1.5rem;
}

.stat {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.875rem;
}

.stat__label {
  color: oklch(60% 0.03 250deg);
}

.stat__value {
  font-weight: 700;
  color: oklch(30% 0.02 250deg);
}

.stat--uploading .stat__value {
  color: oklch(60% 0.15 250deg);
}

.stat--processing .stat__value {
  color: oklch(55% 0.2 170deg);
}

.stat--complete .stat__value {
  color: oklch(50% 0.2 150deg);
}

.progress-bar-container {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.progress-bar {
  flex: 1;
  height: 0.5rem;
  background: oklch(90% 0.02 250deg);
  border-radius: 9999px;
  overflow: hidden;
}

.progress-bar__fill {
  height: 100%;
  background: linear-gradient(90deg, oklch(60% 0.15 250deg), oklch(55% 0.2 170deg));
  border-radius: 9999px;
  transition: width 0.3s ease;
  width: 0%;
}

.progress-percentage {
  font-size: 0.875rem;
  font-weight: 700;
  color: oklch(30% 0.02 250deg);
  min-width: 3rem;
  text-align: right;
}

.upload-progress__files {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.file-progress-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  background: oklch(97% 0.01 250deg);
  border-radius: 0.375rem;
}

.file-progress-item__name {
  font-size: 0.875rem;
  color: oklch(30% 0.02 250deg);
  margin: 0 0 0.25rem;
}

.file-progress-item__status {
  font-size: 0.75rem;
  color: oklch(60% 0.03 250deg);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-weight: 600;
}

.file-progress-item__status--uploading {
  color: oklch(60% 0.15 250deg);
}

.file-progress-item__status--processing {
  color: oklch(55% 0.2 170deg);
}

.file-progress-item__status--complete {
  color: oklch(50% 0.2 150deg);
}

.file-progress-item__progress {
  width: 100px;
  height: 0.25rem;
  background: oklch(90% 0.02 250deg);
  border-radius: 9999px;
  overflow: hidden;
}

.file-progress-item__fill {
  height: 100%;
  background: oklch(60% 0.15 250deg);
  transition: width 0.3s ease;
}

/* ── Analysis Progress ─────────────────────────────────────────────────── */
.analysis-progress {
  margin-top: 2rem;
  background: oklch(100% 0 0deg);
  border: 1px solid oklch(90% 0.02 250deg);
  border-radius: 0.75rem;
  padding: 2rem;
}

.analysis-progress__header {
  text-align: center;
  margin-bottom: 2rem;
}

.analysis-progress__title {
  font-size: 1.25rem;
  font-weight: 700;
  color: oklch(30% 0.02 250deg);
  margin: 0 0 1rem;
}

.analysis-progress__status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  color: oklch(50% 0.03 250deg);
  font-size: 1rem;
}

.spinner {
  animation: spin 1s linear infinite;
  color: oklch(60% 0.15 250deg);
}

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

.analysis-stages {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stage {
  display: flex;
  gap: 1rem;
  padding: 1.5rem;
  background: oklch(97% 0.01 250deg);
  border-radius: 0.5rem;
  border: 2px solid transparent;
  opacity: 0.5;
  transition:
    opacity 300ms ease,
    border-color 300ms ease,
    background 300ms ease;
}

.stage--active {
  opacity: 1;
  border-color: oklch(60% 0.15 250deg);
  background: oklch(98% 0.03 250deg);
}

.stage--complete {
  opacity: 1;
  border-color: oklch(50% 0.2 150deg);
}

.stage__icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: oklch(100% 0 0deg);
  border-radius: 0.375rem;
  color: oklch(60% 0.03 250deg);
  flex-shrink: 0;
}

.stage--active .stage__icon {
  color: oklch(60% 0.15 250deg);
}

.stage--complete .stage__icon {
  color: oklch(50% 0.2 150deg);
}

.stage__content {
  flex: 1;
  min-width: 0;
}

.stage__title {
  font-size: 1rem;
  font-weight: 700;
  color: oklch(30% 0.02 250deg);
  margin: 0 0 0.25rem;
}

.stage__desc {
  font-size: 0.875rem;
  color: oklch(60% 0.03 250deg);
  margin: 0;
}

/* ── Contradiction Alerts ──────────────────────────────────────────────── */
.contradiction-alerts {
  margin-top: 2rem;
  padding-top: 2rem;
  border-block-start: 1px solid oklch(90% 0.02 250deg);
}

.alerts__title {
  font-size: 1.125rem;
  font-weight: 700;
  color: oklch(30% 0.02 250deg);
  margin: 0 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.alerts__title::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  background: oklch(60% 0.2 25deg);
  border-radius: 9999px;
}

.alerts__list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.alert-item {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: oklch(98% 0.03 25deg);
  border: 1px solid oklch(85% 0.05 25deg);
  border-radius: 0.5rem;
  border-inline-start: 4px solid oklch(60% 0.2 25deg);
}

.alert-item__icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: oklch(60% 0.2 25deg);
  flex-shrink: 0;
}

.alert-item__content {
  flex: 1;
  min-width: 0;
}

.alert-item__title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: oklch(30% 0.02 250deg);
  margin: 0 0 0.25rem;
}

.alert-item__desc {
  font-size: 0.875rem;
  color: oklch(50% 0.03 250deg);
  margin: 0;
  line-height: 1.5;
}

/* ── Analysis Complete ─────────────────────────────────────────────────── */
.analysis-complete {
  margin-top: 2rem;
  background: oklch(100% 0 0deg);
  border: 1px solid oklch(90% 0.02 250deg);
  border-radius: 0.75rem;
  padding: 3rem 2rem;
  text-align: center;
}

.analysis-complete__icon {
  color: oklch(60% 0.15 250deg);
  margin-bottom: 1.5rem;
}

.analysis-complete__title {
  font-size: 1.5rem;
  font-weight: 700;
  color: oklch(30% 0.02 250deg);
  margin: 0 0 0.5rem;
}

.analysis-complete__desc {
  font-size: 1rem;
  color: oklch(50% 0.03 250deg);
  margin: 0 0 2rem;
  line-height: 1.6;
}

.analysis-complete__actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── Error State ───────────────────────────────────────────────────────── */
.error-state {
  margin-top: 2rem;
  background: oklch(100% 0 0deg);
  border: 1px solid oklch(85% 0.05 25deg);
  border-radius: 0.75rem;
  padding: 3rem 2rem;
  text-align: center;
}

.error-state__icon {
  color: oklch(60% 0.2 25deg);
  margin-bottom: 1.5rem;
}

.error-state__title {
  font-size: 1.5rem;
  font-weight: 700;
  color: oklch(30% 0.02 250deg);
  margin: 0 0 0.5rem;
}

.error-state__desc {
  font-size: 1rem;
  color: oklch(50% 0.03 250deg);
  margin: 0 0 2rem;
  line-height: 1.6;
}

.error-state__actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (width <= 768px) {
  .upload-zone {
    padding: 2rem 1rem;
  }

  .upload-zone__title {
    font-size: 1.25rem;
  }

  .file-queue__header,
  .upload-progress__header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .upload-progress__stats {
    width: 100%;
    justify-content: space-between;
  }

  .analysis-stages {
    grid-template-columns: 1fr;
  }

  .analysis-complete__actions,
  .error-state__actions {
    flex-direction: column;
  }

  .analysis-complete__actions .btn,
  .error-state__actions .btn {
    width: 100%;
  }
}

/* ── Accessibility ─────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .upload-zone,
  .file-item__remove,
  .progress-bar__fill,
  .stage,
  .spinner {
    transition: none;
    animation: none;
  }
}
