/*
 * desktop-import.css — DesktopImportModal styling
 * (unbifurcating-vault-surfaces S6, Joe ruling 4).
 *
 * This mirrors the fallback CSS injected inline by app/js/modal/desktop-import.js
 * (the module ships its own <style> so it works even if this sheet is missing).
 * Keep the two in sync when tuning; this linked sheet is the design-audit home.
 * All values use CSS-var fallbacks so the modal reads correctly under any theme.
 */

.desktop-import-overlay {
  position: fixed;
  inset: 0;
  z-index: 10600;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 8, 20, 0.62);
  backdrop-filter: blur(6px);
  padding: 24px;
}

.di-card {
  width: min(680px, 94vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  background: var(--color-bg-card, #161824);
  color: var(--color-text-primary, #f2f3f7);
  border: 1px solid var(--color-border, rgba(255, 255, 255, 0.08));
  border-radius: 18px;
  box-shadow: 0 24px 68px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.di-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 22px 24px 16px;
  border-bottom: 1px solid var(--color-border, rgba(255, 255, 255, 0.06));
}

.di-header-text { flex: 1; min-width: 0; }
.di-title { margin: 0; font-size: 1.25rem; font-weight: 650; letter-spacing: 0.01em; }
.di-subtitle { margin: 5px 0 0; font-size: 0.9rem; opacity: 0.7; line-height: 1.4; }

.di-close {
  flex: none;
  background: transparent;
  border: none;
  color: inherit;
  opacity: 0.6;
  cursor: pointer;
  padding: 4px;
  border-radius: 8px;
  transition: opacity 0.15s, background 0.15s;
}
.di-close:hover { opacity: 1; background: rgba(255, 255, 255, 0.08); }

.di-body { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 24px; }

.di-dropzone {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 44px 24px;
  background: transparent;
  cursor: pointer;
  color: inherit;
  border: 2px dashed var(--color-border, rgba(255, 255, 255, 0.16));
  border-radius: 14px;
  transition: border-color 0.15s, background 0.15s;
}
.di-dropzone:hover,
.di-drag-over {
  border-color: var(--color-accent, #7c8cff);
  background: rgba(124, 140, 255, 0.06);
}
.di-dropzone-icon { opacity: 0.7; }
.di-dropzone-label { font-size: 1rem; font-weight: 600; }
.di-dropzone-sub { font-size: 0.85rem; opacity: 0.6; }

.di-list { display: flex; flex-direction: column; gap: 10px; }

.di-row {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 12px;
  background: var(--color-bg-tertiary, rgba(255, 255, 255, 0.03));
  border-radius: 12px;
  border: 1px solid var(--color-border, rgba(255, 255, 255, 0.05));
}
.di-row-done { border-color: rgba(80, 200, 140, 0.4); }
.di-row-duplicate { opacity: 0.72; }
.di-row-failed { border-color: rgba(230, 110, 110, 0.5); }

.di-thumb {
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: 9px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: rgba(0, 0, 0, 0.28);
  color: rgba(255, 255, 255, 0.55);
}
.di-thumb img { width: 100%; height: 100%; object-fit: cover; }
.di-thumb-play { position: absolute; font-size: 0.8rem; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7); }

.di-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.di-row-top { display: flex; align-items: center; gap: 8px; min-width: 0; }

.di-chip {
  flex: none;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(124, 140, 255, 0.18);
  color: var(--color-accent, #9aa8ff);
}
.di-chip-video { background: rgba(255, 150, 90, 0.18); color: #ffb184; }
.di-chip-audio { background: rgba(120, 210, 180, 0.18); color: #8fe0c2; }

.di-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.9rem;
}
.di-size { flex: none; font-size: 0.75rem; opacity: 0.55; }

.di-caption {
  width: 100%;
  box-sizing: border-box;
  padding: 7px 10px;
  font-size: 0.85rem;
  color: inherit;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--color-border, rgba(255, 255, 255, 0.08));
  border-radius: 8px;
}
.di-caption:disabled { opacity: 0.5; }

.di-progress { display: flex; align-items: center; gap: 9px; position: relative; }
.di-progress-bar {
  height: 5px;
  flex: 1;
  border-radius: 3px;
  background: linear-gradient(90deg, #667eea, #7c8cff);
  width: 0;
  transition: width 0.25s ease;
  min-width: 0;
}
.di-progress-note { flex: none; font-size: 0.72rem; opacity: 0.7; white-space: nowrap; }
.di-row-failed .di-progress-note { color: #ffa3a3; opacity: 1; }
.di-row-done .di-progress-note { color: #8ee0b4; opacity: 1; }

.di-remove {
  flex: none;
  background: transparent;
  border: none;
  color: inherit;
  opacity: 0.5;
  cursor: pointer;
  padding: 4px;
  border-radius: 7px;
  transition: opacity 0.15s, background 0.15s;
}
.di-remove:hover:not(:disabled) { opacity: 1; background: rgba(255, 255, 255, 0.08); }
.di-remove:disabled { opacity: 0.25; cursor: default; }

.di-add-more {
  margin-top: 12px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--color-accent, #9aa8ff);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 6px 2px;
}
.di-add-more:hover { text-decoration: underline; }

.di-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px;
  border-top: 1px solid var(--color-border, rgba(255, 255, 255, 0.06));
}
.di-footnote { font-size: 0.76rem; opacity: 0.55; flex: 1; min-width: 0; }
.di-footer-actions { flex: none; display: flex; gap: 10px; }

.di-btn {
  padding: 9px 18px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: opacity 0.15s, background 0.15s;
}
.di-btn-ghost {
  background: transparent;
  color: inherit;
  border-color: var(--color-border, rgba(255, 255, 255, 0.14));
}
.di-btn-ghost:hover:not(:disabled) { background: rgba(255, 255, 255, 0.06); }
.di-btn-primary { background: var(--color-accent, #7c8cff); color: #0b0d18; }
.di-btn-primary:hover:not(:disabled) { filter: brightness(1.08); }
.di-btn:disabled { opacity: 0.45; cursor: default; }

@media (max-width: 560px) {
  .di-card { width: 96vw; max-height: 92vh; }
  .di-footer { flex-direction: column; align-items: stretch; }
  .di-footer-actions { justify-content: flex-end; }
}
