/* =========================================================================
   Upload page — split-view sections, file previews, camera capture
   ========================================================================= */

.guest-code-card { margin-bottom: 1.5rem; }

.split-view {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.1rem;
}
@media (max-width: 992px) { .split-view { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 700px) { .split-view { grid-template-columns: 1fr; } }

.upload-section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  min-height: 340px;
}

.upload-header h5 { font-size: 0.98rem; margin: 0; }
.upload-header .section-sub { font-size: 0.78rem; color: var(--ink-500); margin-top: 0.15rem; }

.file-count-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  background: var(--brand-100);
  color: var(--brand-700);
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  margin-left: 0.4rem;
}

.file-preview-container {
  flex: 1;
  min-height: 190px;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-md);
  padding: 0.65rem;
  margin-top: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: border-color 0.15s ease, background-color 0.15s ease;
  position: relative;
}

.file-preview-container.dragover {
  border-color: var(--brand-500);
  background: var(--brand-100);
}

.file-preview-container .drop-hint {
  margin: auto;
  text-align: center;
  color: var(--ink-300);
  font-size: 0.82rem;
  padding: 1rem 0.5rem;
  pointer-events: none;
}
.file-preview-container .drop-hint i { display: block; font-size: 1.4rem; margin-bottom: 0.35rem; color: var(--line-strong); }

.preview-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--canvas);
  overflow: hidden;
  animation: preview-in 0.15s ease;
}
@keyframes preview-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }

.preview-item .preview-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem;
}

.thumbnail-preview {
  width: 52px;
  height: 52px;
  border-radius: 7px;
  background-color: var(--line);
  background-size: cover;
  background-position: center;
  flex: none;
  border: 1px solid var(--line);
}

.preview-meta { flex: 1; min-width: 0; }
.preview-filename {
  font-size: 0.8rem;
  color: var(--ink-700);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.preview-filesize { font-size: 0.72rem; color: var(--ink-300); }

.preview-item select.form-select-sm {
  font-size: 0.78rem;
  padding: 0.25rem 1.6rem 0.25rem 0.5rem;
}

.preview-actions { display: flex; gap: 0.3rem; flex: none; }
.preview-actions .btn { width: 30px; height: 30px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }

.preview-item.is-invalid { border-color: var(--danger); background: var(--danger-bg); }
.preview-item .preview-error {
  font-size: 0.74rem;
  color: var(--danger);
  padding: 0 0.45rem 0.45rem;
}

/* hidden native inputs — replaced entirely by JS + previews, kept for form semantics */
.upload-section > input[type="file"] { display: none; }

.upload-summary-bar {
  position: sticky;
  bottom: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 0.9rem 1.2rem;
  margin-top: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.upload-summary-bar .summary-text { font-size: 0.85rem; color: var(--ink-500); }
.upload-summary-bar .summary-text strong { color: var(--ink-900); }

/* Camera modal */
.camera-container { background: #05100c; border-radius: var(--radius-md); }
#cameraFeed { width: 100%; height: auto; display: block; }
.camera-hint {
  font-size: 0.8rem;
  color: var(--ink-500);
  background: var(--canvas);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.8rem;
  margin-top: 0.75rem;
}

/* Toast alerts */
.toast-stack {
  position: fixed;
  top: calc(var(--nav-height) + 16px);
  right: 16px;
  z-index: 1080;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-width: 340px;
}
.toast-stack .alert { box-shadow: var(--shadow-md); margin: 0; animation: toast-in 0.18s ease; }
@keyframes toast-in { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: translateX(0); } }
