/* Import Review Overlay
 * Modal overlay for reviewing ASCII text before importing into the editor.
 * Split layout: textarea+gutter on left, staff preview on right.
 */

/* Overlay container - covers entire viewport */
#import-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: var(--bg, #1a1a2e);
  flex-direction: column;
}

#import-overlay.open {
  display: flex;
}

/* Prevent scrolling on body when overlay is active */
body.import-overlay-active {
  overflow: hidden;
}

/* ── Header ── */
.import-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border, #333);
  background: var(--bg-surface, #16213e);
  flex-shrink: 0;
}

.import-header-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text, #e0e0e0);
}

.import-cancel-btn,
.import-accept-btn {
  padding: 6px 16px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.import-cancel-btn {
  background: transparent;
  color: var(--text-muted, #999);
}

.import-cancel-btn:hover {
  background: var(--bg-hover, #2a2a4a);
}

.import-accept-btn {
  background: #4ade80;
  color: #111;
}

.import-accept-btn:hover {
  background: #22c55e;
}

/* ── LLM Toggle ── */
.import-llm-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted, #999);
  cursor: pointer;
  user-select: none;
}

.import-llm-toggle input[type="checkbox"] {
  accent-color: #60a5fa;
  cursor: pointer;
}

.import-prompt-btn {
  padding: 4px 10px;
  border: 1px solid var(--border, #444);
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted, #999);
  font-size: 12px;
  cursor: pointer;
}

.import-prompt-btn:hover {
  background: var(--bg-hover, #2a2a4a);
  color: var(--text, #e0e0e0);
}

/* ── Prompt Panel ── */
.import-prompt-panel {
  border-bottom: 1px solid var(--border, #333);
  background: var(--bg-surface, #16213e);
  padding: 8px 16px;
  flex-shrink: 0;
}

.import-prompt-textarea {
  width: 100%;
  padding: 8px;
  background: var(--bg, #1a1a2e);
  color: var(--text, #e0e0e0);
  border: 1px solid var(--border, #333);
  border-radius: 4px;
  outline: none;
  resize: vertical;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 12px;
  line-height: 1.5;
  box-sizing: border-box;
}

.import-prompt-textarea:focus {
  border-color: #60a5fa;
}

.import-prompt-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 6px;
}

.import-prompt-actions button {
  padding: 4px 10px;
  border: 1px solid var(--border, #444);
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted, #999);
  font-size: 12px;
  cursor: pointer;
}

.import-prompt-actions button:hover {
  background: var(--bg-hover, #2a2a4a);
  color: var(--text, #e0e0e0);
}

/* ── Body: split pane ── */
.import-body {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* Left pane: gutter + textarea */
.import-left-pane {
  display: flex;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

/* Gutter */
.import-gutter {
  width: 20px;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--bg-surface, #16213e);
  border-right: 1px solid var(--border, #333);
}

.import-gutter-line {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.import-gutter-line:not(.import-gutter-empty)::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dot-color, #64748b);
}

.import-gutter-empty {
  /* No dot for blank lines */
}

/* Textarea */
.import-textarea {
  flex: 1;
  min-width: 0;
  padding: 12px;
  background: var(--bg, #1a1a2e);
  color: var(--text, #e0e0e0);
  border: none;
  outline: none;
  resize: none;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 15px;
  line-height: 22px;
  white-space: pre;
  overflow-y: auto;
  overflow-x: auto;
}

.import-textarea::placeholder {
  color: var(--text-muted, #666);
}

/* Right pane: staff preview */
.import-right-pane {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  border-left: 1px solid var(--border, #333);
  background: #fff;
}

.import-staff-container {
  width: 100%;
  min-height: 100%;
  padding: 12px;
  box-sizing: border-box;
}

/* ── Footer ── */
.import-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 16px;
  border-top: 1px solid var(--border, #333);
  background: var(--bg-surface, #16213e);
  flex-shrink: 0;
}

.import-footer-status {
  font-size: 13px;
  color: var(--text-muted, #999);
}

.import-footer-hint {
  font-size: 12px;
  color: var(--text-muted, #777);
}

/* ── Responsive: stack on narrow viewports ── */
@media (max-width: 700px) {
  .import-body {
    flex-direction: column;
  }

  .import-right-pane {
    border-left: none;
    border-top: 1px solid var(--border, #333);
    max-height: 40vh;
  }
}
