/* ─────────────────────────────────────────────────────────────────────────────
   evidence-upload.css
   Styles for the per-question file attachment widget (Sprint 2 — Data Vault)
   Dark-theme consistent with the existing assessment colour palette.
   ───────────────────────────────────────────────────────────────────────────── */

/* ── Upload widget container ─────────────────────────────────────────────── */
.ev-upload-widget {
  margin-top: 6px;
}

/* ── Hidden native file input ────────────────────────────────────────────── */
.ev-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* ── Paperclip attach button ─────────────────────────────────────────────── */
.ev-attach-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border: 1px solid var(--border, #334155);
  border-radius: 5px;
  background: transparent;
  color: var(--text-muted, #94a3b8);
  font-size: .75rem;
  font-family: inherit;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}

.ev-attach-btn:hover:not(:disabled) {
  border-color: var(--accent, #06b6d4);
  color: var(--accent, #06b6d4);
  background: rgba(6, 182, 212, .06);
}

.ev-attach-btn:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.ev-attach-icon {
  font-size: .85rem;
  line-height: 1;
}

/* ── Upload progress bar ─────────────────────────────────────────────────── */
.ev-progress {
  display: block;
  width: 100%;
  height: 4px;
  margin-top: 6px;
  border: none;
  border-radius: 2px;
  background: var(--border, #334155);
  accent-color: var(--accent, #06b6d4);
}

/* ── Status text (Preparing / Uploading / Confirming / error) ────────────── */
.ev-status {
  display: block;
  font-size: .72rem;
  color: var(--text-muted, #94a3b8);
  margin-top: 3px;
}

/* ── File chip list ──────────────────────────────────────────────────────── */
.ev-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

/* ── Individual file chip ────────────────────────────────────────────────── */
.ev-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 240px;
  padding: 3px 6px;
  border: 1px solid var(--border, #334155);
  border-radius: 4px;
  background: var(--card, #1e293b);
  font-size: .73rem;
  color: var(--text, #e2e8f0);
  overflow: hidden;
}

.ev-chip-icon {
  flex-shrink: 0;
  font-size: .82rem;
  line-height: 1;
}

.ev-chip-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.ev-chip-remove {
  flex-shrink: 0;
  border: none;
  background: none;
  color: var(--text-muted, #94a3b8);
  font-size: .9rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
  margin-left: 2px;
}

.ev-chip-remove:hover {
  color: #f87171;
}

/* ── SharePoint source badge (inside chip) ───────────────────────────────── */
.ev-chip-sp {
  flex-shrink: 0;
  font-size: .63rem;
  font-weight: 600;
  letter-spacing: .03em;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  line-height: 1.4;
}

/* ── SharePoint import button ────────────────────────────────────────────── */
.ev-sp-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border: 1px solid rgba(99, 102, 241, 0.4);
  border-radius: 5px;
  background: rgba(99, 102, 241, 0.08);
  color: #a5b4fc;
  font-size: .75rem;
  font-family: inherit;
  cursor: pointer;
  margin-left: 6px;
  transition: border-color .15s, background .15s;
}
.ev-sp-btn:hover:not(:disabled) {
  border-color: rgba(99, 102, 241, 0.65);
  background: rgba(99, 102, 241, 0.16);
}
.ev-sp-btn:disabled {
  opacity: .5;
  cursor: not-allowed;
}

/* ── Print: hide upload controls, keep chip list ─────────────────────────── */
@media print {
  .ev-attach-btn,
  .ev-sp-btn,
  .ev-file-input,
  .ev-progress,
  .ev-status,
  .ev-chip-remove {
    display: none !important;
  }

  .ev-chip {
    border-color: #ccc;
    background: #f8f8f8;
    color: #333;
  }
}
