/*
 * css/obz-import.css
 *
 * Wave 12 F1a — styles for the OBZ import pill, drop-zone affordance,
 * and preview modal. Companion to /js/builder/obz-import.js.
 *
 * No external CSS deps — uses the same tokens the rest of the
 * builder modals do (--tap-target-min from mobile-tokens.css if
 * present, otherwise sensible fallbacks).
 */

/* ── Modal host (full-screen overlay used by BottomSheet) ───────── */
.obz-import-modal-host {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.48);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9000;
  padding: 16px;
  box-sizing: border-box;
}
.obz-import-modal-host.open {
  /* Fallback when BottomSheet primitive isn't present — show via
     class toggle. The primitive itself adds .open. */
  display: flex;
}

.obz-import-modal-card {
  background: #ffffff;
  border-radius: 14px;
  padding: 20px 22px;
  max-width: 560px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 16px 64px rgba(0, 0, 0, 0.25);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #1a1a1a;
}

.obz-import-title {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
}
.obz-import-fname {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 16px;
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
}
.obz-import-help {
  margin: 0 0 14px;
  color: #475569;
  font-size: 14px;
  line-height: 1.4;
}
.obz-import-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 10px 12px;
}

/* ── Stats grid (board count, tile count, name) ─────────────────── */
.obz-import-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin: 12px 0;
}
.obz-import-stat {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px;
  text-align: center;
  min-width: 0;
}
.obz-import-stat-num {
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.obz-import-stat-lbl {
  font-size: 12px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 4px;
}

/* ── License pill ───────────────────────────────────────────────── */
.obz-import-license {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  border-radius: 8px;
  padding: 10px 12px;
  margin: 12px 0;
  font-size: 13px;
  line-height: 1.45;
}
.obz-import-license-unknown {
  background: #fffbeb;
  color: #92400e;
  border-color: #fde68a;
}
.obz-import-license a {
  color: inherit;
  text-decoration: underline;
}
.obz-import-note {
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  padding: 10px 12px;
  margin: 8px 0 14px;
  font-size: 13px;
  line-height: 1.45;
}

/* ── Warnings disclosure ────────────────────────────────────────── */
.obz-import-warnings {
  background: #fafafa;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  padding: 8px 10px;
  margin: 6px 0 12px;
  font-size: 12px;
  color: #525252;
}
.obz-import-warnings summary {
  cursor: pointer;
  font-weight: 600;
  padding: 4px 0;
}
.obz-import-warnings ul {
  margin: 4px 0 0 16px;
  padding: 0;
}
.obz-import-warnings li {
  margin: 2px 0;
  line-height: 1.4;
}

/* ── Action button row ──────────────────────────────────────────── */
.obz-import-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  justify-content: flex-end;
}
.obz-import-btn {
  appearance: none;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
  border-radius: 8px;
  padding: 10px 16px;
  /* honor mobile-tokens.css --tap-target-min when present */
  min-height: var(--tap-target-min, 44px);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.obz-import-btn:hover {
  background: #f1f5f9;
}
.obz-import-btn-primary {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
}
.obz-import-btn-primary:hover {
  background: #1d4ed8;
}
.obz-import-btn-secondary {
  background: #f8fafc;
  color: #475569;
}

/* ── Spinner ────────────────────────────────────────────────────── */
.obz-import-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #e2e8f0;
  border-top-color: #2563eb;
  border-radius: 50%;
  margin: 12px auto;
  animation: obz-import-spin 0.9s linear infinite;
}
@keyframes obz-import-spin {
  to { transform: rotate(360deg); }
}

/* ── Drop-zone highlight ────────────────────────────────────────── */
.obz-dropzone-active {
  outline: 4px dashed #2563eb;
  outline-offset: -8px;
  background-color: rgba(37, 99, 235, 0.06);
  transition: outline-color 0.12s ease, background-color 0.12s ease;
}
.obz-dropzone-active::before {
  content: "Drop .obz to import";
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: #2563eb;
  color: #ffffff;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  z-index: 8500;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
}
