/*
 * Copyright (C) 2026 Yzapre
 * SPDX-License-Identifier: AGPL-3.0-or-later
 */

/* ── Import / Export ──────────────────────────────────
   Covers both the standalone Import / Export page and the export/
   import popups that backup.js injects into any page that includes
   it. */

.bk-wrap {
  max-width: min(100%, 980px);
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.bk-toolbar {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.bk-btn {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.55rem 1rem;
  font-family: inherit;
  transition: background 0.1s;
}
.bk-btn:hover { background: var(--border); }
.bk-btn-primary {
  background: #1a3a1a;
  border-color: #2d6b2d;
  color: #8eff8e;
}
.bk-btn-primary:hover { background: #254825; }

.section-title-bar {
  padding: 0.55rem 1rem;
  border-bottom: 1px solid var(--border);
}
.section-title-bar strong { font-size: 0.9rem; }

/* ── Summary list (Import / Export page) ─────────────── */
.bk-summary-list { display: flex; flex-direction: column; }
.bk-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border);
}
.bk-summary-row:last-child { border-bottom: none; }
.bk-summary-text { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.bk-summary-label { font-size: 0.87rem; font-weight: 600; }
.bk-summary-desc { font-size: 0.78rem; color: var(--muted); }
.bk-summary-status {
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}
.bk-summary-status.has-data { color: #8eff8e; }
.bk-summary-status.no-data { color: var(--muted); font-weight: 400; }

/* ── Info panel + Azure Mines Tools tutorial ─────────── */
.bk-info-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.2rem;
}
.bk-info-panel h3 { font-size: 0.95rem; margin-bottom: 0.5rem; }
.bk-info-panel p { font-size: 0.85rem; color: var(--muted); margin-bottom: 0.6rem; line-height: 1.45; }
.bk-info-panel ul { margin: 0 0 0.6rem 1.1rem; font-size: 0.85rem; color: var(--text); display: flex; flex-direction: column; gap: 0.25rem; }

.bk-steps {
  margin: 0.4rem 0 0.9rem 1.2rem;
  font-size: 0.85rem;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.bk-steps li { line-height: 1.45; }

.bk-info-panel kbd {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.05rem 0.4rem;
  font-family: monospace;
  font-size: 0.82rem;
}
.bk-info-panel p code,
.bk-steps code {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.05rem 0.35rem;
  font-family: monospace;
  font-size: 0.8rem;
}

.bk-code-block {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 0.6rem;
  /* The AMT console command is one long line with unbroken tokens
     (template literals, etc). Without this, that intrinsic width
     propagates up through .bk-wrap/.main and stops the whole page
     from shrinking below it, unlike every other page. Containing the
     overflow here (same pattern as shared-table.css's table wrapper)
     keeps any unavoidable horizontal scroll local to this box. */
  max-width: 100%;
  overflow-x: auto;
}
.bk-code-block pre {
  margin: 0;
  padding: 0.9rem 1rem;
}
.bk-code-block code {
  font-family: 'SFMono-Regular', Consolas, monospace;
  font-size: 0.78rem;
  color: var(--text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.bk-copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  cursor: pointer;
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  font-family: inherit;
}
.bk-copy-btn:hover { background: var(--border); }

.bk-code-note { font-size: 0.78rem; color: var(--muted); margin-bottom: 0; }

/* Modals (injected by backup.js) reuse the shared .modal-overlay /
   .modal-box / .modal-actions family from styles.css; this page just
   widens the box a bit since its checkbox lists run longer. */
.bk-modal-box { max-width: 500px; }

/* ── Select all/none row ──────────────────────────────── */
.bk-select-row {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}
.bk-select-row button {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  font-family: inherit;
}
.bk-select-row button:hover { background: var(--border); color: var(--text); }

/* ── Checkbox list ────────────────────────────────────── */
.bk-check-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.25rem;
}
.bk-check-row {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.55rem 0.7rem;
}
.bk-check-row.disabled { opacity: 0.45; }
.bk-check-main {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}
.bk-check-main input[type="checkbox"] {
  margin-top: 0.2rem;
  flex-shrink: 0;
  cursor: pointer;
}
.bk-check-row.disabled .bk-check-main input[type="checkbox"] { cursor: default; }
.bk-check-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
  cursor: pointer;
}
.bk-check-row.disabled .bk-check-text { cursor: default; }
.bk-check-label { font-size: 0.86rem; font-weight: 600; }
.bk-check-desc { font-size: 0.76rem; color: var(--muted); line-height: 1.35; }
.bk-check-missing { font-size: 0.74rem; color: var(--muted); font-style: italic; }
.bk-check-partial { font-size: 0.74rem; color: #eba163; font-weight: 600; }
.bk-check-warning { font-size: 0.74rem; color: #ff9999; font-weight: 600; }
.bk-merge-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--text);
  padding-left: 1.85rem;
  cursor: pointer;
}
.bk-merge-row input { cursor: pointer; }

@media (max-width: 520px) {
  .bk-summary-row { flex-direction: column; align-items: flex-start; gap: 0.3rem; }
}
