/* AgentsRepos — Extra UI: Login modal, Run panel, Publish form */

/* ─── Modal ─── */
.modal-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.7); z-index: 1000;
  display: none; align-items: center; justify-content: center;
}
.modal-overlay.show { display: flex; }
.modal {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; padding: 32px; max-width: 440px; width: 90%;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.modal h2 { margin-bottom: 20px; font-size: 1.4rem; }
.modal-actions {
  display: flex; gap: 12px; margin-top: 20px;
}
.modal-link {
  text-align: center; margin-top: 16px; font-size: 0.9rem; color: var(--text-muted);
}
.modal-link a { color: var(--accent); cursor: pointer; }

/* ─── Forms ─── */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block; font-size: 0.85rem; color: var(--text-muted);
  margin-bottom: 6px; font-weight: 600;
}
.form-group input, .form-group select, .form-group textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--border);
  border-radius: 6px; padding: 10px 12px; color: var(--text);
  font-size: 0.95rem; outline: none;
}
.form-group input:focus, .form-group textarea:focus {
  border-color: var(--accent);
}
.form-group textarea { resize: vertical; min-height: 60px; font-family: inherit; }
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }

/* ─── Run Panel ─── */
.run-panel {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 16px; margin-top: 20px;
}
.run-panel-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px;
}
.run-input {
  width: 100%; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 6px; padding: 10px; color: var(--text);
  font-size: 0.9rem; outline: none; min-height: 60px;
  font-family: inherit; resize: vertical;
}
.run-output {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 6px; padding: 12px; margin-top: 12px;
  font-family: 'Monaco', 'Menlo', monospace; font-size: 0.85rem;
  white-space: pre-wrap; word-break: break-all; min-height: 40px;
  color: var(--green);
}
.run-meta {
  font-size: 0.75rem; color: var(--text-muted); margin-top: 8px;
  display: flex; gap: 16px;
}
.run-loading {
  display: inline-block; width: 16px; height: 16px;
  border: 2px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.8s linear infinite;
  margin-right: 8px; vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── User badge ─── */
.user-badge {
  display: none; align-items: center; gap: 8px;
  background: var(--bg-hover); border-radius: 20px; padding: 4px 12px;
  font-size: 0.85rem; cursor: pointer;
}
.user-badge.show { display: flex; }
.user-badge .avatar {
  width: 24px; height: 24px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700; color: white;
}

/* ─── Toast ─── */
.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 2000;
  background: var(--bg-card); border: 1px solid var(--border);
  border-left: 4px solid var(--green); border-radius: 8px;
  padding: 12px 20px; font-size: 0.9rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  transform: translateX(120%); transition: transform 0.3s;
  max-width: 360px;
}
.toast.show { transform: translateX(0); }
.toast.error { border-left-color: #f85149; }
.toast.info { border-left-color: var(--accent); }

/* ─── Publish Form ─── */
.publish-form {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
  max-width: 640px; margin: 0 auto;
}
.json-editor {
  width: 100%; min-height: 200px; background: var(--bg);
  border: 1px solid var(--border); border-radius: 6px;
  padding: 12px; color: var(--text); font-size: 0.85rem;
  font-family: 'Monaco', 'Menlo', monospace; outline: none;
  resize: vertical;
}
