/* ── MODALS.CSS ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(4px);
  z-index: 999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-overlay.open { display: flex; }

/* ── WALLET MODAL ── */
.modal {
  background: var(--bg-panel);
  border: 1px solid var(--border-bright);
  border-radius: 16px;
  padding: 24px;
  width: 100%;
  max-width: 360px;
  position: relative;
  box-shadow: 0 24px 80px rgba(0,0,0,0.8), 0 0 0 1px rgba(0,212,255,0.1);
  animation: modalIn 0.2s ease;
  max-height: 90dvh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.modal-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close {
  width: 28px; height: 28px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all 0.2s;
  flex-shrink: 0;
}

.modal-close:hover { color: var(--text-primary); background: var(--bg-hover); }

.modal-subtitle {
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 18px;
  font-family: 'JetBrains Mono', monospace;
}

.wallet-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 8px;
}

.wallet-option:hover {
  border-color: var(--border-bright);
  background: var(--bg-hover);
  transform: translateX(2px);
}

.wallet-option:last-child { margin-bottom: 0; }

.wallet-option-icon {
  width: 34px; height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}

.wallet-option-info { flex: 1; min-width: 0; }

.wallet-option-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.wallet-option-desc {
  font-size: 10px;
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
}

.wallet-option-arrow {
  color: var(--text-muted);
  font-size: 12px;
  transition: all 0.2s;
  flex-shrink: 0;
}

.wallet-option:hover .wallet-option-arrow { color: var(--accent); transform: translateX(2px); }

.modal-footer {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  line-height: 1.5;
}

.wallet-detected {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(0,255,136,0.06);
  border: 1px solid rgba(0,255,136,0.2);
  border-radius: 8px;
  margin-bottom: 12px;
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--green);
}

.wallet-detected-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
  flex-shrink: 0;
}

.no-wallet-notice {
  padding: 10px;
  background: rgba(255,71,87,0.06);
  border: 1px solid rgba(255,71,87,0.2);
  border-radius: 8px;
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--red);
  text-align: center;
  margin-bottom: 10px;
  line-height: 1.5;
}

.wallet-option.disabled { opacity: 0.4; pointer-events: none; }

.wallet-option-badge {
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  letter-spacing: 0.3px;
  flex-shrink: 0;
}

.badge-detected {
  background: rgba(0,255,136,0.12);
  color: var(--green);
  border: 1px solid rgba(0,255,136,0.3);
}

.badge-install {
  background: rgba(122,143,168,0.12);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.wallet-disconnect-area {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wallet-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-secondary);
}

.wallet-info-row span:last-child { color: var(--text-muted); }

.btn-disconnect {
  width: 100%;
  padding: 9px;
  background: rgba(255,71,87,0.08);
  border: 1px solid rgba(255,71,87,0.3);
  border-radius: 8px;
  color: var(--red);
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-disconnect:hover {
  background: rgba(255,71,87,0.14);
  border-color: var(--red);
  box-shadow: 0 0 12px rgba(255,71,87,0.15);
}

/* ── NEW FILE MODAL ── */
.new-file-modal {
  background: var(--bg-panel);
  border: 1px solid var(--border-bright);
  border-radius: 14px;
  padding: 22px;
  width: 100%;
  max-width: 360px;
  position: relative;
  box-shadow: 0 24px 80px rgba(0,0,0,0.85), 0 0 0 1px rgba(0,212,255,0.08);
  animation: modalIn 0.2s ease;
}

.new-file-modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.new-file-modal-sub {
  font-size: 11px;
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
  margin-bottom: 16px;
}

.new-file-input {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-bright);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  margin-bottom: 10px;
}

.new-file-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(0,212,255,0.12);
}

.new-file-type-row {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.file-type-btn {
  flex: 1;
  min-width: 50px;
  padding: 8px 4px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text-secondary);
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.file-type-btn:hover { border-color: var(--border-bright); color: var(--text-primary); }
.file-type-btn.selected { border-color: var(--accent); color: var(--accent); background: var(--accent-glow); }

.new-file-hint {
  font-size: 10px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  margin-bottom: 16px;
  min-height: 14px;
}

/* ── DELETE MODAL ── */
.delete-modal {
  background: var(--bg-panel);
  border: 1px solid var(--border-bright);
  border-radius: 14px;
  padding: 24px;
  width: 100%;
  max-width: 340px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.85), 0 0 0 1px rgba(255,71,87,0.08);
  animation: modalIn 0.2s ease;
  text-align: center;
}

.delete-modal-icon { font-size: 30px; margin-bottom: 10px; }

.delete-modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.delete-modal-body {
  font-size: 12px;
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
  margin-bottom: 6px;
}

.delete-modal-filename {
  font-size: 12px;
  color: var(--red);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  margin-bottom: 18px;
  padding: 5px 10px;
  background: rgba(255,71,87,0.08);
  border: 1px solid rgba(255,71,87,0.2);
  border-radius: 6px;
  display: inline-block;
  word-break: break-all;
}

/* ── CONFIRM MODALS ── */
.confirm-modal {
  background: var(--bg-panel);
  border: 1px solid var(--border-bright);
  border-radius: 14px;
  padding: 24px;
  width: 100%;
  max-width: 380px;
  position: relative;
  box-shadow: 0 24px 80px rgba(0,0,0,0.85), 0 0 0 1px rgba(0,212,255,0.08);
  animation: modalIn 0.2s ease;
}

.confirm-modal-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  margin: 0 auto 14px;
}

.confirm-modal-icon.run-icon-bg {
  background: rgba(0,212,255,0.1);
  border: 1px solid rgba(0,212,255,0.25);
}

.confirm-modal-icon.deploy-icon-bg {
  background: rgba(0,255,136,0.08);
  border: 1px solid rgba(0,255,136,0.2);
}

.confirm-modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
  margin-bottom: 6px;
}

.confirm-modal-body {
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  line-height: 1.6;
  margin-bottom: 16px;
}

.confirm-modal-detail {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-muted);
  margin-bottom: 18px;
  line-height: 1.7;
}

.confirm-modal-detail span { color: var(--text-secondary); }
.confirm-modal-detail .hl-accent { color: var(--accent); }
.confirm-modal-detail .hl-green { color: var(--green); }
.confirm-modal-detail .hl-orange { color: var(--orange); }

.confirm-btns { display: flex; gap: 10px; }

.confirm-cancel {
  flex: 1;
  padding: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 13px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.confirm-cancel:hover {
  border-color: var(--border-bright);
  color: var(--text-primary);
  background: var(--bg-hover);
}

.confirm-yes-run {
  flex: 1;
  padding: 10px;
  background: linear-gradient(135deg, rgba(0,212,255,0.15), rgba(168,85,247,0.15));
  border: 1px solid var(--accent-dim);
  border-radius: 8px;
  color: var(--accent);
  font-size: 13px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.confirm-yes-run:hover {
  border-color: var(--accent);
  box-shadow: 0 0 16px rgba(0,212,255,0.2);
}

.confirm-yes-deploy {
  flex: 1;
  padding: 10px;
  background: linear-gradient(135deg, #0a4a2a, #0d6035);
  border: 1px solid var(--green-dim);
  border-radius: 8px;
  color: var(--green);
  font-size: 13px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.confirm-yes-deploy:hover {
  border-color: var(--green);
  box-shadow: 0 0 16px rgba(0,255,136,0.2);
}

.confirm-yes-delete {
  flex: 1;
  padding: 10px;
  background: rgba(255,71,87,0.1);
  border: 1px solid rgba(255,71,87,0.4);
  border-radius: 8px;
  color: var(--red);
  font-size: 13px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.confirm-yes-delete:hover {
  background: rgba(255,71,87,0.18);
  border-color: var(--red);
  box-shadow: 0 0 14px rgba(255,71,87,0.15);
}
