/* ── Gnoke DataForge — modals.css ───────────────────────────────── */

/* ── Shared Buttons ──────────────────────────────────────────────── */
.btn {
  padding: 9px 18px; border-radius: var(--radius);
  border: none; font-family: var(--font-sans);
  font-size: 0.875rem; font-weight: 500;
  cursor: pointer; transition: all 0.15s;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-primary { background: var(--amber); color: #fff; }
.btn-primary:hover { background: var(--amber-dk); }
.btn-ghost {
  background: var(--surface2); color: var(--text);
  border: 1px solid var(--border2);
}
.btn-ghost:hover { border-color: var(--text2); background: var(--surface3); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { filter: brightness(1.08); }

/* ── Overlay ─────────────────────────────────────────────────────── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.45); z-index: 500;
  align-items: center; justify-content: center;
  padding: 20px; backdrop-filter: blur(3px);
}
.modal-overlay.show { display: flex; }

/* ── Modal Box ───────────────────────────────────────────────────── */
.modal {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: var(--shadow-lg);
  padding: 0; width: 100%; max-width: 480px;
  max-height: 90dvh; overflow-y: auto;
  animation: modalIn 0.2s ease;
  transition: background var(--transition), border-color var(--transition);
}
@keyframes modalIn {
  from { transform: translateY(14px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* Modal head */
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px 14px; border-bottom: 1px solid var(--border);
}
.modal-head h3 {
  font-family: var(--font-serif);
  font-size: 1.1rem; font-weight: 700; color: var(--text);
}
.modal-close {
  background: none; border: 1px solid var(--border);
  font-size: 0.85rem; cursor: pointer; color: var(--muted);
  padding: 4px 9px; border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}
.modal-close:hover { background: var(--surface2); color: var(--text); }

/* Content padding when no head used */
.modal > input[type=text],
.modal > .export-grid,
.modal > ul,
.modal > .modal-body,
.modal > #import-step-format,
.modal > #import-step-tables,
.modal > #import-step-paste {
  padding: 18px 22px 0;
}

.modal-actions {
  display: flex; gap: 8px; justify-content: flex-end;
  padding: 14px 22px 22px; margin-top: 4px;
}

/* ── Modal File List ─────────────────────────────────────────────── */
.modal ul {
  list-style: none; max-height: 260px;
  overflow-y: auto; padding: 0;
}
.modal ul li { margin: 6px 0; }
.modal ul li button {
  width: 100%; text-align: left;
  padding: 10px 14px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text);
  font-family: var(--font-sans); font-size: 0.875rem;
  cursor: pointer; transition: border-color 0.15s, background 0.15s;
}
.modal ul li button:hover { border-color: var(--amber); background: var(--amber-lt); }

/* ── Text input in modal ─────────────────────────────────────────── */
.modal input[type=text] {
  width: 100%; background: var(--surface2);
  border: 1px solid var(--border); color: var(--text);
  border-radius: var(--radius); padding: 9px 12px;
  font-family: var(--font-sans); font-size: 0.875rem;
  outline: none; transition: border-color 0.15s;
  margin-bottom: 4px;
}
.modal input[type=text]:focus { border-color: var(--amber); box-shadow: 0 0 0 3px var(--amber-lt); }

/* ── Export/Import Grid ──────────────────────────────────────────── */
.export-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px; margin-top: 4px;
}
.export-opt {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 16px 10px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  font-size: 0.75rem; color: var(--muted); text-align: center;
}
.export-opt:hover { border-color: var(--amber); color: var(--text); background: var(--amber-lt); }
.export-opt .icon { font-size: 1.4rem; }
.export-opt strong {
  font-family: var(--font-mono); font-size: 0.7rem; color: var(--text);
}
/* AI-ready highlight */
.export-opt.recommended {
  border-color: var(--amber);
  background: var(--amber-lt);
}
.export-opt.recommended strong { color: var(--amber); }

/* ── Confirm Modal ───────────────────────────────────────────────── */
.modal-body {
  font-size: 0.875rem; color: var(--muted); line-height: 1.6;
}
.modal-body strong { color: var(--text); }

/* ── Import ──────────────────────────────────────────────────────── */
.import-hint {
  font-size: 0.75rem; color: var(--muted);
  font-family: var(--font-mono); margin-bottom: 12px; line-height: 1.5;
}

.import-textarea {
  width: 100%; background: var(--surface2);
  border: 1px solid var(--border); color: var(--text);
  border-radius: var(--radius); padding: 10px 12px;
  font-family: var(--font-mono); font-size: 0.78rem;
  line-height: 1.55; resize: vertical; outline: none;
  transition: border-color 0.15s; margin-bottom: 4px;
}
.import-textarea:focus { border-color: var(--amber); box-shadow: 0 0 0 3px var(--amber-lt); }

.import-opt-disabled {
  opacity: 0.38; cursor: not-allowed; pointer-events: none;
}
